From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "W. Trevor King" Newsgroups: gmane.emacs.bugs Subject: bug#16988: xterm--version-handler, accepting any terminal type rather than 0 Date: Wed, 12 Mar 2014 09:13:24 -0700 Message-ID: <20140312161324.GW29333@odin.tremily.us> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="9+ohdFDUqiMJzwPo" X-Trace: ger.gmane.org 1394640867 10903 80.91.229.3 (12 Mar 2014 16:14:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 12 Mar 2014 16:14:27 +0000 (UTC) Cc: 16988@debbugs.gnu.org, Nicolas Richard To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Mar 12 17:14:37 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WNlng-0005Vb-KC for geb-bug-gnu-emacs@m.gmane.org; Wed, 12 Mar 2014 17:14:36 +0100 Original-Received: from localhost ([::1]:33434 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WNlng-0003HS-6M for geb-bug-gnu-emacs@m.gmane.org; Wed, 12 Mar 2014 12:14:36 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46218) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WNlnE-0002kG-4H for bug-gnu-emacs@gnu.org; Wed, 12 Mar 2014 12:14:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WNln8-0005p3-TD for bug-gnu-emacs@gnu.org; Wed, 12 Mar 2014 12:14:08 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:33648) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WNln8-0005ox-OO for bug-gnu-emacs@gnu.org; Wed, 12 Mar 2014 12:14:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1WNln7-0003bV-Ts for bug-gnu-emacs@gnu.org; Wed, 12 Mar 2014 12:14:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: "W. Trevor King" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 12 Mar 2014 16:14:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16988 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 16988-submit@debbugs.gnu.org id=B16988.139464081013791 (code B ref 16988); Wed, 12 Mar 2014 16:14:01 +0000 Original-Received: (at 16988) by debbugs.gnu.org; 12 Mar 2014 16:13:30 +0000 Original-Received: from localhost ([127.0.0.1]:34830 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WNlmb-0003aN-UU for submit@debbugs.gnu.org; Wed, 12 Mar 2014 12:13:30 -0400 Original-Received: from qmta12.westchester.pa.mail.comcast.net ([76.96.59.227]:47601) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WNlmZ-0003aB-7j for 16988@debbugs.gnu.org; Wed, 12 Mar 2014 12:13:28 -0400 Original-Received: from omta14.westchester.pa.mail.comcast.net ([76.96.62.60]) by qmta12.westchester.pa.mail.comcast.net with comcast id cdVr1n0031HzFnQ5CgDSGU; Wed, 12 Mar 2014 16:13:26 +0000 Original-Received: from odin.tremily.us ([24.18.63.50]) by omta14.westchester.pa.mail.comcast.net with comcast id cgDR1n00U152l3L3agDSlu; Wed, 12 Mar 2014 16:13:26 +0000 Original-Received: by odin.tremily.us (Postfix, from userid 1000) id C328010839D8; Wed, 12 Mar 2014 09:13:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tremily.us; s=odin; t=1394640804; bh=R8jEk4FesJxk3sZd0qvPc/i4lqdP2xDV/SGJqBjVhNw=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=UupMcT6XuMRglgJUFwd30T9D4wnw6AVstXn4BiOYGb3xvDqUaePZiGbsMP3jG+3u9 5WNbLARlLjZDwTB7MVthrdbP7w9/WeXZhGxjssVaLLh34N5urGXv7v6fALhVWzXxd1 KN1VaXYrwqMag/LUVxzxkNgEYoTvAOLSFZDtkPvw= Content-Disposition: inline In-Reply-To: OpenPGP: id=39A2F3FA2AB17E5D8764F388FC29BDCDF15F5BE8; url=http://tremily.us/pubkey.txt User-Agent: Mutt/1.5.22 (2013-10-16) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20121106; t=1394640806; bh=dk9TbzDllBNJHgRDJTiEdJHYcJigodogiDcmek+wVLM=; h=Received:Received:Received:Date:From:To:Subject:Message-ID: MIME-Version:Content-Type; b=nUH3xCmumm8QV8zSYZwzbsd6r5ROt5x6jYvkDsRNaem02jiKCVNZxOIRX1bcaNQF1 59o44WA1rjlPSZPWCMbfjps+jB55c0SL9Qn4vI+GED08SyAbZk2FA1HrXbOzdx1lvm eXT1CMCHSLOLTjkaDEDV1Ic6dJW/OZmGaZ7nRfvokj5Ykfh13bvELpwJ29zOic/d+p MmN8S/3W9OF69LprU5/HNDw6uJtMZNvnN+UGR1EWTJFJDUqDt+28EypVmsZh0+N61P Z61co2xDHK3KFz4rzbS4T3CQBw4Z2teg2h5AJ31lgAr+Cp9eGNad7r0vghRP/QraDW o+0mlEXBZN5mg== X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:86776 Archived-At: --9+ohdFDUqiMJzwPo Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Mar 12, 2014 at 10:32:21AM -0400, Stefan Monnier wrote: > Looks like my fear about "other terminal types" was not unfounded > after all: gnome-terminal uses a terminal type of 1 and that leads > to problems (see http://debbugs.gnu.org/16988 for the discussion). >=20 > I'm leaning towards the conservative option of replacing your "[0-9]+" > with "0\\|41", WDYT? That's going to cause problems for folks who run their XTerm in VT220 mode (xterm -ti vt220), where you'll get secondary device attributes like '1;297;0c' (VT220, XTerm v297, ROM cartridge registration number 0). It looks like the GNOME Terminal and it's underlying VTE widget could use some love on the XTerm-emulation front [1,2]. On Wed, Mar 12, 2014 at 09:59:13AM +0100, Nicolas Richard wrote: > I now see three approaches : > 0. Do nothing, and let users fix their terminal emulator and/or > terminfo entries. (alternatively : provide guidance for doing > this.) > 1. Like it is done now for rxvt (in function terminal-init-xterm), > add some ad-hoc code for detecting gnome-terminal which pretends > to be xterm (in fact the exact same approach might work : > $COLORTERM is gnome-terminal when using gnome-terminal). > 2. Test also (match-string 1 str) in the above code and make sure it > is either 0 or 41. (it is equal to 1 in my gnome-terminal) That sounds right to me, and those choices are listed in my order of preference ;). VTE's handling of this particular sequence (vte_sequence_handler_send_secondary_device_attributes) hasn't changed much since it was added in 2003 [3,4], and I haven't looked up the sequence behind xterm--query, so I'm not sure how difficult it would be to add support for it to VTE. I also don't know enough about it to know how to reliably distinguish it from true XTerms (although if you can COLORTERM, that sounds good). Approach #3 fixes things for VTE users, but breaks detection for 'xterm -ti vt220' users. I don't know any such users personally though ;). Cheers, Trevor [1]: http://invisible-island.net/xterm/xterm.faq.html#bug_gnometerm [2]: http://invisible-island.net/xterm/xterm.faq.html#vte_widget [3]: https://git.gnome.org/browse/vte/commit/?id=3D3c6d81bf06becda3f9ab005c= 7310b2343588115e [4]: https://git.gnome.org/browse/vte/commit/?id=3Dddad9e00e4d0442d76139048= 0aafd9c85713121f -- This email may be signed or encrypted with GnuPG (http://www.gnupg.org). For more information, see http://en.wikipedia.org/wiki/Pretty_Good_Privacy --9+ohdFDUqiMJzwPo Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQIcBAEBAgAGBQJTIIeiAAoJEKKfehoaNkbtimoP/0HNzDAM3mCs6Q6pqsiA58Ca H6i5Y2AgyWGdf06cH1wtE0tARkCAfAuqpIkwhoobSIlxvDcE56Y02Fajn4t57Fls aEGewl1P8zqq6ZatSQBLeF9jcncx2dvvdcAWv/RFnZvvvXtNxXYSRGbP27T2DUdS tqg8fPZ/bmrD48smT/cbfLABwY3E8XiUh0gj7TZZumHOB+eQsEw1EcJMyfx+ayRw Cs+oy/mbKE5D6gybi882cIHEQanGOJed3/NWrtv3A31A3m1lg/l04Vl7UM/VBYuQ wOuLf34YRFKOxwU+sWqdWONzgLIRAVOTfpBH1VReYOI+KOtnBrWRyOy/Ae1qAe3V YgxqwLqiCoHedf7bC/hB8B2KAnYehfLDIpesrumMjD/YFL02iOo4fybJcJYbTdUq w+7EZJxDCM5hoXrdE1vlz1oZlRBHVeb7/zrZm42IRt+GL3W5/q1nnCJojAxkZ7QJ /kmb6BbUJw6Hslfr9R3IO97jxUP2HS093kdRNBFWMjEfgVdZ0bP4M2B2ra55bmBd 7r7MUGCwLHqLGxlmIoXpYNLeoabbWRm+JxrZ0WfNtxxUt6WaCAI6Duq8MHbWEWH/ GBzqI5m1cqnTlc36NIWdlQxyxzbQiquO1SJ3UMX9vMewlDaWM1it54JSUCw+aoJi cm9TLCjBJQZQ1RFa/jOz =UIqc -----END PGP SIGNATURE----- --9+ohdFDUqiMJzwPo--