From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Daniel Colascione Newsgroups: gmane.emacs.bugs Subject: bug#17357: 24.4.50; garbage characters when pasting in an OS X terminal Date: Sun, 27 Apr 2014 16:31:11 -0700 Message-ID: <535D933F.6070605@dancol.org> References: <10EFA706-8A14-4F49-81B2-403D770E1CCE@twistedmatrix.com> <535D4211.6030706@dancol.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="9WtBvQwMGFhmGtCbq5Mv71gUTB9IBgWkK" X-Trace: ger.gmane.org 1398641542 7405 80.91.229.3 (27 Apr 2014 23:32:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 27 Apr 2014 23:32:22 +0000 (UTC) Cc: 17357@debbugs.gnu.org To: Jan =?UTF-8?Q?Dj=C3=A4rv?= , Glyph Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Apr 28 01:32:16 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 1WeYYR-0003qJ-73 for geb-bug-gnu-emacs@m.gmane.org; Mon, 28 Apr 2014 01:32:15 +0200 Original-Received: from localhost ([::1]:40888 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WeYYQ-0004vS-Km for geb-bug-gnu-emacs@m.gmane.org; Sun, 27 Apr 2014 19:32:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36896) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WeYYJ-0004vC-Nf for bug-gnu-emacs@gnu.org; Sun, 27 Apr 2014 19:32:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WeYYF-00076s-GU for bug-gnu-emacs@gnu.org; Sun, 27 Apr 2014 19:32:07 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:54211) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WeYYF-00076o-9y for bug-gnu-emacs@gnu.org; Sun, 27 Apr 2014 19:32:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1WeYYE-0005nn-DD for bug-gnu-emacs@gnu.org; Sun, 27 Apr 2014 19:32:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Daniel Colascione Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 27 Apr 2014 23:32:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17357 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 17357-submit@debbugs.gnu.org id=B17357.139864148422246 (code B ref 17357); Sun, 27 Apr 2014 23:32:02 +0000 Original-Received: (at 17357) by debbugs.gnu.org; 27 Apr 2014 23:31:24 +0000 Original-Received: from localhost ([127.0.0.1]:43329 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WeYXa-0005mj-OG for submit@debbugs.gnu.org; Sun, 27 Apr 2014 19:31:23 -0400 Original-Received: from dancol.org ([96.126.100.184]:42002) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WeYXU-0005mX-SS for 17357@debbugs.gnu.org; Sun, 27 Apr 2014 19:31:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=dancol.org; s=x; h=Content-Type:In-Reply-To:References:Subject:CC:To:MIME-Version:From:Date:Message-ID; bh=dHD0cWPnngEoY0ZkZ4sp1o43ekWm4ALufZY8Vy+NC0s=; b=ALN0J3ABhf62jUVm2dBTf2Rd5hEbgEHaca5yjjIeLFmxRslSqaoyomuq//2PrmGESCvD1QryDZvJ9XYsupfFA+4tZWR0q1owaAjl28A9NqIGnpYRCr8EKTIyx67DWykkNTkQVZnizGZmsSv7MVO/FXa6GL/sThiOhnhwxzOG3uI60HxWO5f0KO7Hf6wNcTQ7qsQhQc8s31SyrhcX7cJFMtZcMjJkvx5oI38c4CEHcpvWDT2oSHWUxXF5G2//wdhHKY/TkU3EU/bhchWsE8tb4XOJRYwQcobAKTT9E0aS1ktDhp4CCPAvQKca5YtiKoz/y36RxmhYI+hpZw8K06uuzQ==; Original-Received: from [2601:8:b200:2b6::2b1] by dancol.org with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1WeYXR-0000Xo-KJ; Sun, 27 Apr 2014 16:31:13 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 In-Reply-To: <535D4211.6030706@dancol.org> X-Enigmail-Version: 1.6 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:88340 Archived-At: This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --9WtBvQwMGFhmGtCbq5Mv71gUTB9IBgWkK Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 04/27/2014 10:44 AM, Daniel Colascione wrote: > On 04/27/2014 10:27 AM, Jan Dj=E4rv wrote: >> 27 apr 2014 kl. 09:47 skrev Glyph : >> >>> >>> I'm using snapshot builds from http://emacsformacosx.com/. Somewhere= >>> between the 4/13 snapshot and the 4/24 snapshot, "paste" in an OS X >>> terminal (running with -nw) results in garbage characters on either s= ide >>> of the paste. >>> >>> For example, if I paste the URL, it looks like >>> 200~http://emacsformacosx.com/201~, or causes jumping around within t= he >>> buffer (for example, when filing this bug, it jumped to the beginning= of >>> the buffer and pasted the URL and the "201~" before the From:). >>> >>> >> >> I can't reproduce this. Did you start emacs with -Q? >> What application did you copy from? >> What key combination did you use to paste? >=20 > That's the new bracketed paste system supoport. Emacs is correctly > sending the terminal the sequence to enable bracketed paste mode, but > isn't correctly the start sequence. I hope we don't have to make this > feature conditional. >=20 > OP, what's in *Messages*? If you M-x trace-function-background > xterm-paste, do you see messages in *trace-output*? What happens if you= > manually type ESC [ 2 0 0 ~ ? >=20 I have an idea, actually. What if Terminal.app, in its infinite glory, is sending ESC twice, once because bracketed paste support is enabled, and once because Command is held down? Does the following patch help or change the behavior in any way? =3D=3D=3D modified file 'lisp/term/xterm.el' --- lisp/term/xterm.el 2014-04-27 23:26:42 +0000 +++ lisp/term/xterm.el 2014-04-27 23:30:39 +0000 @@ -428,6 +428,8 @@ ;; Recognize the start of a bracketed paste sequence. The handler ;; internally recognizes the end. (define-key map "\e[200~" [xterm-paste]) + ;; Work around Terminal.app bug? + (define-key map "\e\e[200~" [xterm-paste]) map) "Function key map overrides for xterm.") --9WtBvQwMGFhmGtCbq5Mv71gUTB9IBgWkK Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBAgAGBQJTXZM/AAoJEMAaIROpHW7Ik0EP/jeSSsdoe9Xm+MvQTV/AVoSb wK/vvUcpLIdOcnGRhtz6MFOscHr2vTvGXjWwMcFZQ8k8B7X5GVOKoTyfFrGJdFY8 gFwvZVujyraG9lIaQeW4i7Ah7/HJvImk7P2rdI0P+SRcnKDtzCIQ+teq+bNyLtDF VuFwfSuVU/VjWRvLz6Z48MyYCElGyPTPYO9AqKrcy8uF/bU+A7OPrQZVPPG//xvf dwniJf9hDizcz+zupES4tmcHrCgYU2BuaDTDbWJnzWRa52xM47T0VTbXJtNMn55w 8nCEZI+Ei4EfdMpKIqN5nnKyi28I9hO4gSUDPxQH3TiMkhLVADknvH91RJ+DCCBl mUugZGTbUXtDEb3cgYXjgmX3cSFJNxY4FqCxmHmx1tAFdkTeIfYeqQgfX5NVs0gc ZitTX31hMHbkzSbBrB/Ke0kbdcWJVJjpHYI/E5l2MKJg+ERSB2CrQGrIcwYnIFek 1E1QdsNRNumJTGUmXxPDIDV3XLUNGyRMqTFnL9L0Y7FdrY4114Ak5to93Ld0q5Q0 GxtUhKfFmNDMshBM9AMBj9zucCsC6z6bmEapoZylcyQmgQGsj2Jv8FTc3z5NUXz/ Jywulvi/WqxarxkOOOvtcisiuYK4FAD1cFoFEyDu+L7xzWXTb9S4XuKMxsFHJev/ 6qW7tLXk6MML2M7L1eMF =UQaX -----END PGP SIGNATURE----- --9WtBvQwMGFhmGtCbq5Mv71gUTB9IBgWkK--