all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Daniel Colascione <dancol@dancol.org>
To: "Jan Djärv" <jan.h.d@swipnet.se>, Glyph <glyph@twistedmatrix.com>
Cc: 17357@debbugs.gnu.org
Subject: bug#17357: 24.4.50; garbage characters when pasting in an OS X terminal
Date: Sun, 27 Apr 2014 16:31:11 -0700	[thread overview]
Message-ID: <535D933F.6070605@dancol.org> (raw)
In-Reply-To: <535D4211.6030706@dancol.org>

[-- Attachment #1: Type: text/plain, Size: 2004 bytes --]

On 04/27/2014 10:44 AM, Daniel Colascione wrote:
> On 04/27/2014 10:27 AM, Jan Djärv wrote:
>> 27 apr 2014 kl. 09:47 skrev Glyph <glyph@twistedmatrix.com>:
>>
>>>
>>> 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 side
>>> of the paste.
>>>
>>> For example, if I paste the URL, it looks like
>>> 200~http://emacsformacosx.com/201~, or causes jumping around within the
>>> 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?
> 
> 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.
> 
> 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 ~ ?
> 

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?

=== 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.")



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 884 bytes --]

  reply	other threads:[~2014-04-27 23:31 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-27  7:47 bug#17357: 24.4.50; garbage characters when pasting in an OS X terminal Glyph
2014-04-27 17:27 ` Jan Djärv
2014-04-27 17:44   ` Daniel Colascione
2014-04-27 23:31     ` Daniel Colascione [this message]
2014-04-28  0:03     ` Glyph
2014-04-28  0:11       ` Daniel Colascione
2014-04-28  3:55         ` Stefan Monnier
2014-04-28 19:12         ` Glyph Lefkowitz
2020-09-09 12:14       ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=535D933F.6070605@dancol.org \
    --to=dancol@dancol.org \
    --cc=17357@debbugs.gnu.org \
    --cc=glyph@twistedmatrix.com \
    --cc=jan.h.d@swipnet.se \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.