GNU bug report logs - #17357
24.4.50; garbage characters when pasting in an OS X terminal

Previous Next

Package: emacs;

Reported by: Glyph <glyph <at> twistedmatrix.com>

Date: Sun, 27 Apr 2014 08:28:01 UTC

Severity: normal

Found in version 24.4.50

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #20 received at 17357 <at> debbugs.gnu.org (full text, mbox):

From: Daniel Colascione <dancol <at> dancol.org>
To: Glyph <glyph <at> twistedmatrix.com>
Cc: 17357 <at> debbugs.gnu.org, Jan Djärv <jan.h.d <at> swipnet.se>
Subject: Re: bug#17357: 24.4.50; garbage characters when pasting in an OS
 X terminal
Date: Sun, 27 Apr 2014 17:11:35 -0700
[Message part 1 (text/plain, inline)]
On 04/27/2014 05:03 PM, Glyph wrote:
> 
> On Apr 27, 2014, at 10:44 AM, Daniel Colascione <dancol <at> dancol.org> wrote:
> 
>> On 04/27/2014 10:27 AM, Jan Djärv wrote:
>>> 27 apr 2014 kl. 09:47 skrev Glyph <glyph <at> 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.

Dammit. Why do I only notice typos in my emails after I send them?

> 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.
> 
> I did figure this out a couple of hours after I discovered the weird behavior.

Eh, at least I found an unrelated bug in the bracketed paste support as
a result of your message.

>> 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 can save you some trouble - bracketed paste support works fine, the terminal sends the right control codes :-).
> 
> The problem is that I had this key-binding in some emacs-lisp code I wrote a while ago:
> 
> (global-set-key [(meta \])] 'something)
> (global-set-key [(meta \[)] 'something-else)

Your numeric keypad bindings should have broken too.

Also, we bind these keys in xterm-function-map. Shouldn't that map
override global-map?

> After removing those global key bindings, it works great.
> 
> It might be worth putting some nicer error-reporting around those
> though, since M-] and M-[ are perfectly cromulent keys to want to bind
> (and I still bind them, I just have an (if (not (eq window-system nil)))
> around it now.

I'd advise something a bit more subtle, in case you want to use emacs
server with tty frames.

[signature.asc (application/pgp-signature, attachment)]

This bug report was last modified 4 years and 259 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.