From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Robert Cochran Newsgroups: gmane.emacs.bugs Subject: bug#24420: 25.1.50; Work around terminal differences for bracketed-paste/mouse-2 Date: Wed, 14 Sep 2016 11:36:57 -0700 Message-ID: <8737l2pbue.fsf@cochranmail.com> References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1473878312 17961 195.159.176.226 (14 Sep 2016 18:38:32 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 14 Sep 2016 18:38:32 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) Cc: 24420@debbugs.gnu.org To: Philipp Stephani Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Sep 14 20:38:28 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bkF4b-0003E8-B6 for geb-bug-gnu-emacs@m.gmane.org; Wed, 14 Sep 2016 20:38:17 +0200 Original-Received: from localhost ([::1]:58083 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkF4Z-0008Lv-GJ for geb-bug-gnu-emacs@m.gmane.org; Wed, 14 Sep 2016 14:38:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42260) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkF4Q-0008Lm-RQ for bug-gnu-emacs@gnu.org; Wed, 14 Sep 2016 14:38:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bkF4M-000477-JY for bug-gnu-emacs@gnu.org; Wed, 14 Sep 2016 14:38:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:33833) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkF4M-00046v-8o for bug-gnu-emacs@gnu.org; Wed, 14 Sep 2016 14:38:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bkF4M-0005Rg-1A for bug-gnu-emacs@gnu.org; Wed, 14 Sep 2016 14:38:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Robert Cochran Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 14 Sep 2016 18:38:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24420 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 24420-submit@debbugs.gnu.org id=B24420.147387822520858 (code B ref 24420); Wed, 14 Sep 2016 18:38:01 +0000 Original-Received: (at 24420) by debbugs.gnu.org; 14 Sep 2016 18:37:05 +0000 Original-Received: from localhost ([127.0.0.1]:59778 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bkF3Q-0005QM-N4 for submit@debbugs.gnu.org; Wed, 14 Sep 2016 14:37:04 -0400 Original-Received: from mail.workgrouplinux.net ([207.195.177.82]:54326) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bkF3P-0005Q3-88 for 24420@debbugs.gnu.org; Wed, 14 Sep 2016 14:37:04 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=simple; d=cochranmail.com; h=from:to :cc:subject:references:date:in-reply-to:message-id:mime-version :content-type; s=dkim1; bh=b8nJZXIqplH+jZcZwGre744NoGU=; b=i0ki9 fndu9+nt7tHsDz45tmeD/0bBqBxwUaurUldUBo3BHXP1mQhOc8GwZhr8RmZQ7ydt HbefwJhcrnh0zRYw5h7M44mgWwD26PMVBKNRjzr7fbRUlar/lqUKPyCdjTSK/gCH r4QXy6VcBhJHYAh7PAl7QJbJVafZAJCmuxRJgGvMDktrx3WrHYduYcEb/uHo3rOs pk9tzWWjDiv6vBwmsWuQiTbu/BryDfUy18U7dujsdbatYdQ47DanqbIAPnwfsSe3 7i4bVZxXE3zVQGu6WPghowcYum1w8uiZQ5AZNw6cDFTrfYGJLx8nHFn1vbyoZKE5 je1oSuJlwtv+QcArg== Original-Received: (qmail 30101 invoked by uid 0); 14 Sep 2016 18:37:00 -0000 Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=private; d=cochranmail.com; b=MDJC6o9VhHU7yrQiJochHEtJI+HORFHcclECtvtqPW+iWFx0CHY0gbPsdkH+kNGOE2//SJSrIFEhuDsQUSjKAw==; Original-Received: from 131-191-86-130.as.clicknet.org (HELO SoraLaptop) (robert@cochranmail.com@131.191.86.130) by mail.cochrantribe.org with ESMTPA; 14 Sep 2016 18:37:00 -0000 In-Reply-To: (Philipp Stephani's message of "Mon, 12 Sep 2016 15:39:25 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:123304 Archived-At: Philipp Stephani writes: > There are several terminals that announce themselves as XTerm and > partially implement the XTerm control sequences > (http://invisible-island.net/xterm/ctlseqs/ctlseqs.html), but have some > slightly different behavior. That sounds like breakage waiting to happen. Maybe I'm not entirely familiar with how things are done in terminal-emulator-land, but why would you declare yourself as an XTerm if you only partially implement or differ from the real thing? _That_ sounds like the bug to me. Don't claim to be something you're not. When a program *still* has to account for differences in terminals after getting a terminal descriptor, then IMO you've lost the whole point of term{cap,info}. How does one get new entries into the database (and curses) nowadays anyhow? Maybe part of the problem here is that people piggy-back off of xterm's descriptor because they don't have their own entry... Also, how do you communicate the advanced features (like mouse support)? Is it simply that it's there if a terminal claims to be an xterm? Or is there a real query method for those things? > I've tried out XTerm, HTerm, and gnome-terminal, and found the > following behavior differences: > > - XTerm sends xterm-paste (ESC [ 200~ ... ESC [ 201~) if > xterm-mouse-mode is disabled. If xterm-mouse-mode is enabled, it > sends down-mouse-2 + up-mouse-2 using SGR coordinates (ESC [<1;x;yM > ESC [<1;x;ym), which gets translated to mouse-yank-primary. > > - Gnome Terminal sends xterm-paste if xterm-mouse-mode is disabled. If > xterm-mouse-mode is enabled, it only sends down-mouse-2 using SGR > coordinates, which is ignored by Emacs. > > - HTerm doesn't use bracketed paste mode if xterm-mouse-mode is disabled > (i.e. pasted text gets inserted using individual > self-insert-commands). If xterm-mouse-mode is enabled, it uses both > (!) down-mouse-2 + down-mouse-up (using basic coordinates) and then a > bracketed paste. > > The HTerm and Gnome-Terminal behaviors are probably bugs, and I'll try > to get them fixed. However, maybe we want to work around these issues > on the Emacs side, e.g. by not requiring an up-mouse-2 if > xterm-mouse-mode is enabled. I could go either way on this one... Emacs maybe ought not to be so choosy about what it gets from a control character standpoint, but how relatively difficuly would it be to fix the emulators to do both up and down? That way both flavors of program are satisfied: the ones looking for down-only get their event, and those looking for both get both. -- ~Robert Cochran GPG Fingerprint - E778 2DD4 FEA6 6A68 6F26 AD2D E5C3 EB36 4886 8871