GNU bug report logs - #25005
25.1; Support disabling bracketed paste mode.

Previous Next

Package: emacs;

Reported by: Jay Lee <jay <at> hanjaelee.com>

Date: Wed, 23 Nov 2016 16:30:04 UTC

Severity: minor

Tags: moreinfo

Found in version 25.1

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

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 25005 in the body.
You can then email your comments to 25005 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#25005; Package emacs. (Wed, 23 Nov 2016 16:30:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jay Lee <jay <at> hanjaelee.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 23 Nov 2016 16:30:04 GMT) Full text and rfc822 format available.

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

From: Jay Lee <jay <at> hanjaelee.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 25.1; Support disabling bracketed paste mode.
Date: Wed, 23 Nov 2016 23:47:37 +0900
[Message part 1 (text/plain, inline)]
I see that bracketed paste mode is automatically enabled in emacs 25.1 running in terminal.
I know this mode is very good at security. But while I’m editing text, this mode annoy me. because something text is added.
ex) 200~hello, world201~

I copy text frequently from safari or other applications and paste it to emacs running in terminal. then I have to remove "200~ 201~”.
this process reduce my productivity. So I want to disable bracketed paste mode in emacs running in terminal.

I have googled this issue But there is no information. and I even make questions in reddit and stackexchage.
I think that No one know disabling bracketed paste mode.
Below is my question links
https://www.reddit.com/r/emacs/comments/5eehv5/how_to_turn_off_bracketed_paste_mode/ <https://www.reddit.com/r/emacs/comments/5eehv5/how_to_turn_off_bracketed_paste_mode/>
http://emacs.stackexchange.com/questions/28851/how-to-turn-off-bracketed-paste-mode?noredirect=1#comment44234_28851 <http://emacs.stackexchange.com/questions/28851/how-to-turn-off-bracketed-paste-mode?noredirect=1#comment44234_28851>

There is no problem in emacs -q session. I think that bracketed paste mode is not enabled in this case Because configuration about bracketed paste mode is not loaded.
If I have misunderstanding, please let me know.

If there is solution for this issue, I want to know how to disabling bracketed paste mode or Not, please create functions for disable bracketed paste mode.
Thank you.

My development environment is macOS sierra, emacs 25.1 (running in Terminal)

In GNU Emacs 25.1.1 (x86_64-apple-darwin16.0.0, NS appkit-1504.00 Version 10.12 (Build 16A323))
of 2016-11-04 built on Macs-iMac.local
Configured using:
'configure --disable-dependency-tracking --disable-silent-rules
--enable-locallisppath=/usr/local/share/emacs/site-lisp
--infodir=/usr/local/Cellar/emacs/25.1/share/info/emacs
--prefix=/usr/local/Cellar/emacs/25.1 --without-x --with-xml2
--without-dbus --without-gnutls --with-ns --disable-ns-self-contained'

Configured features:
NOTIFY ACL LIBXML2 ZLIB TOOLKIT_SCROLL_BARS NS

Important settings:
  value of $LC_ALL: en_US.UTF-8
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  multi-web-global-mode: t
  show-paren-mode: t
  display-time-mode: t
  which-function-mode: t
  icomplete-mode: t
  iswitchb-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent messages:
Checking 34 files in /usr/local/Cellar/emacs/25.1/share/emacs/25.1/lisp/emulation...
Checking 167 files in /usr/local/Cellar/emacs/25.1/share/emacs/25.1/lisp/emacs-lisp...
Checking 24 files in /usr/local/Cellar/emacs/25.1/share/emacs/25.1/lisp/cedet...
Checking 57 files in /usr/local/Cellar/emacs/25.1/share/emacs/25.1/lisp/calendar...
Checking 87 files in /usr/local/Cellar/emacs/25.1/share/emacs/25.1/lisp/calc...
Checking 120 files in /usr/local/Cellar/emacs/25.1/share/emacs/25.1/lisp/obsolete...
Checking for load-path shadows...done
previous-line: Beginning of buffer [4 times]
Auto-saving...done
Buffer *unsent mail to bug-gnu-emacs <at> gnu.org* modified; kill anyway? (y or n) y

Load-path shadows:
None found.

Features:
(url-util url-parse auth-source cl-seq eieio eieio-core url-vars pp
shadow sort mail-extr emacsbug message dired format-spec rfc822 mml
mml-sec password-cache epg gnus-util mm-decode mm-bodies mm-encode
mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047
rfc2045 ietf-drums mm-util help-fns mail-prsvr mail-utils term/xterm
xterm jade-mode sws-mode multi-web-mode easy-mmode cl-macs cl swift-mode
derived smie comint ansi-color ring rx go-mode-autoloads advice
find-file atom-dark-theme paren time time-date which-func imenu
icomplete iswitchb edmacro kmacro finder-inf package epg-config seq
byte-opt gv bytecomp byte-compile cl-extra help-mode easymenu cconv
cl-loaddefs pcase cl-lib mule-util tooltip eldoc electric uniquify
ediff-hook vc-hooks lisp-float-type mwheel ns-win ucs-normalize
term/common-win tool-bar dnd fontset image regexp-opt fringe
tabulated-list newcomment elisp-mode lisp-mode prog-mode register page
menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock
syntax facemenu font-core frame cl-generic cham georgian utf-8-lang
misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms
cp51932 hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese charscript case-table epa-hook jka-cmpr-hook help
simple abbrev minibuffer cl-preloaded nadvice loaddefs button faces
cus-face macroexp files text-properties overlay sha1 md5 base64 format
env code-pages mule custom widget hashtable-print-readable backquote
kqueue cocoa ns multi-tty make-network-process emacs)

Memory information:
((conses 16 233992 15725)
(symbols 48 23489 4)
(miscs 40 51 193)
(strings 32 25882 4560)
(string-bytes 1 763153)
(vectors 16 35757)
(vector-slots 8 663111 6726)
(floats 8 230 579)
(intervals 56 230 8)
(buffers 976 19))
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25005; Package emacs. (Wed, 23 Nov 2016 16:38:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Jay Lee <jay <at> hanjaelee.com>
Cc: 25005 <at> debbugs.gnu.org
Subject: Re: bug#25005: 25.1; Support disabling bracketed paste mode.
Date: Wed, 23 Nov 2016 18:37:35 +0200
> From: Jay Lee <jay <at> hanjaelee.com>
> Date: Wed, 23 Nov 2016 23:47:37 +0900
> 
> I see that bracketed paste mode is automatically enabled in emacs 25.1 running in terminal.
> I know this mode is very good at security. But while I’m editing text, this mode annoy me. because something
> text is added.
> ex) 200~hello, world201~

That sounds like some bug, so please provide a recipe, preferably
starting from "emacs -Q".

Also, I suggest to try the current emacs-25 branch, I think there were
some improvements in that area since 25.1 was released.

> There is no problem in emacs -q session. I think that bracketed paste mode is not enabled in this case

I think it is enabled in "emacs -Q" as well.  So the fact it only
happens with your customizations would suggest that some of those
customizations might interfere with bracketed paste.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25005; Package emacs. (Thu, 24 Nov 2016 00:28:02 GMT) Full text and rfc822 format available.

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

From: Jay Lee <jay <at> hanjaelee.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 25005 <at> debbugs.gnu.org
Subject: Re: bug#25005: 25.1; Support disabling bracketed paste mode.
Date: Thu, 24 Nov 2016 09:27:31 +0900
If I start from emacs -q, It works well.
I checked again yesterday, I found reason about this issue.

(global-set-key (kbd "M-[") 'previous-multiframe-window) this keybindings affect this issue.
after removing this configuration, It works well. Not added “200~201~” I don't understand why is this reason. I think It is just keybinding.

So in this case, is my emacs bracketed paste mode disabled? if so I want to know why bracketed paste mode is disabled. I just remove configuration for keybinding.
And is there way to turn off bracketed paste mode officially?



Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25005; Package emacs. (Thu, 24 Nov 2016 00:56:01 GMT) Full text and rfc822 format available.

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

From: Daniel Colascione <dancol <at> dancol.org>
To: Jay Lee <jay <at> hanjaelee.com>, Eli Zaretskii <eliz <at> gnu.org>
Cc: 25005 <at> debbugs.gnu.org
Subject: Re: bug#25005: 25.1; Support disabling bracketed paste mode.
Date: Wed, 23 Nov 2016 16:55:39 -0800
On 11/23/2016 04:27 PM, Jay Lee wrote:
> If I start from emacs -q, It works well.
> I checked again yesterday, I found reason about this issue.
>
> (global-set-key (kbd "M-[") 'previous-multiframe-window) this keybindings affect this issue.
> after removing this configuration, It works well. Not added “200~201~” I don't understand why is this reason. I think It is just keybinding.
>
> So in this case, is my emacs bracketed paste mode disabled? if so I want to know why bracketed paste mode is disabled. I just remove configuration for keybinding.
> And is there way to turn off bracketed paste mode officially?
>

That keybinding probably isn't the best anyway. It's a prefix for a lot 
of terminal control sequences.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25005; Package emacs. (Thu, 24 Nov 2016 03:09:02 GMT) Full text and rfc822 format available.

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

From: Clément Pit--Claudel <clement.pit <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Re: bug#25005: 25.1; Support disabling bracketed paste mode.
Date: Wed, 23 Nov 2016 22:08:02 -0500
[Message part 1 (text/plain, inline)]
On 2016-11-23 19:27, Jay Lee wrote:
> If I start from emacs -q, It works well.
> I checked again yesterday, I found reason about this issue.
> 
> (global-set-key (kbd "M-[") 'previous-multiframe-window) this keybindings affect this issue.
> after removing this configuration, It works well. Not added “200~201~” I don't understand why is this reason. I think It is just keybinding.
> 
> So in this case, is my emacs bracketed paste mode disabled? if so I want to know why bracketed paste mode is disabled. I just remove configuration for keybinding.
> And is there way to turn off bracketed paste mode officially?

Stefan responded to your question on stackexchange, and explained why this keybinding was causing issues.

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

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25005; Package emacs. (Thu, 24 Nov 2016 03:38:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Clément Pit--Claudel <clement.pit <at> gmail.com>
Cc: 25005 <at> debbugs.gnu.org
Subject: Re: bug#25005: 25.1; Support disabling bracketed paste mode.
Date: Thu, 24 Nov 2016 05:37:27 +0200
> From: Clément Pit--Claudel <clement.pit <at> gmail.com>
> Date: Wed, 23 Nov 2016 22:08:02 -0500
> 
> On 2016-11-23 19:27, Jay Lee wrote:
> > If I start from emacs -q, It works well.
> > I checked again yesterday, I found reason about this issue.
> > 
> > (global-set-key (kbd "M-[") 'previous-multiframe-window) this keybindings affect this issue.
> > after removing this configuration, It works well. Not added “200~201~” I don't understand why is this reason. I think It is just keybinding.
> > 
> > So in this case, is my emacs bracketed paste mode disabled? if so I want to know why bracketed paste mode is disabled. I just remove configuration for keybinding.
> > And is there way to turn off bracketed paste mode officially?
> 
> Stefan responded to your question on stackexchange, and explained why this keybinding was causing issues.

It would be useful to have those explanations here.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25005; Package emacs. (Thu, 24 Nov 2016 16:08:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Jay Lee <jay <at> hanjaelee.com>
Cc: 25005 <at> debbugs.gnu.org
Subject: Re: bug#25005: 25.1; Support disabling bracketed paste mode.
Date: Thu, 24 Nov 2016 18:06:45 +0200
> From: Jay Lee <jay <at> hanjaelee.com>
> Date: Thu, 24 Nov 2016 09:27:31 +0900
> Cc: 25005 <at> debbugs.gnu.org
> 
> If I start from emacs -q, It works well.
> I checked again yesterday, I found reason about this issue.
> 
> (global-set-key (kbd "M-[") 'previous-multiframe-window) this keybindings affect this issue.
> after removing this configuration, It works well. Not added “200~201~” I don't understand why is this reason. I think It is just keybinding.

The bracketed paste sequence also starts with M-[, so when you paste,
Emacs invokes previous-multiframe-window instead of the function that
handles the paste.  The function that handles the paste knows about
the “200~201~” stuff, and removes it from the pasted text.  But
previous-multiframe-window doesn't.

> So in this case, is my emacs bracketed paste mode disabled?

No, I think it's enabled.  That's why you get those garbled characters
when you paste.

> if so I want to know why bracketed paste mode is disabled. I just remove configuration for keybinding.

When you remove the key binding, bracketed pastes should work
correctly.  Do they?

> And is there way to turn off bracketed paste mode officially?

No, not yet.  Not through Emacs, anyway.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25005; Package emacs. (Sun, 27 Nov 2016 20:43:02 GMT) Full text and rfc822 format available.

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

From: Philipp Stephani <p.stephani2 <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>,
 Clément Pit--Claudel <clement.pit <at> gmail.com>
Cc: 25005 <at> debbugs.gnu.org
Subject: Re: bug#25005: 25.1; Support disabling bracketed paste mode.
Date: Sun, 27 Nov 2016 20:42:01 +0000
[Message part 1 (text/plain, inline)]
Eli Zaretskii <eliz <at> gnu.org> schrieb am Do., 24. Nov. 2016 um 04:38 Uhr:

> > From: Clément Pit--Claudel <clement.pit <at> gmail.com>
> > Date: Wed, 23 Nov 2016 22:08:02 -0500
> >
> > On 2016-11-23 19:27, Jay Lee wrote:
> > > If I start from emacs -q, It works well.
> > > I checked again yesterday, I found reason about this issue.
> > >
> > > (global-set-key (kbd "M-[") 'previous-multiframe-window) this
> keybindings affect this issue.
> > > after removing this configuration, It works well. Not added “200~201~”
> I don't understand why is this reason. I think It is just keybinding.
> > >
> > > So in this case, is my emacs bracketed paste mode disabled? if so I
> want to know why bracketed paste mode is disabled. I just remove
> configuration for keybinding.
> > > And is there way to turn off bracketed paste mode officially?
> >
> > Stefan responded to your question on stackexchange, and explained why
> this keybinding was causing issues.
>
> It would be useful to have those explanations here.
>
>
>
>
Copied from SE:

"My crystal ball said you should remove

(global-set-key (kbd "M-[") 'previous-multiframe-window)

from your ~/.emacs. You might like to M-x report-emacs-bug and ask for
global-set-key to complain when the key sequence conflicts with something in
 input-decode-map (as is the case here, because the byte sequence ESC [ (which
corresponds to the M-[ event) is used by text terminal as a prefix for
encoding all kinds of special events)."
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25005; Package emacs. (Thu, 03 Feb 2022 20:43:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Philipp Stephani <p.stephani2 <at> gmail.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 25005 <at> debbugs.gnu.org,
 Clément Pit--Claudel <clement.pit <at> gmail.com>
Subject: Re: bug#25005: 25.1; Support disabling bracketed paste mode.
Date: Thu, 03 Feb 2022 21:42:26 +0100
Philipp Stephani <p.stephani2 <at> gmail.com> writes:

> "My crystal ball said you should remove (global-set-key (kbd "M-[")
> 'previous-multiframe-window) from your ~/.emacs. You might like to M-x
> report-emacs-bug and ask for global-set-key to complain when the key
> sequence conflicts with something in input-decode-map (as is the case
> here, because the byte sequence ESC [ (which corresponds to the M-[
> event) is used by text terminal as a prefix for encoding all kinds of
> special events)."

This would be easy enough to do...  does anybody have any comments?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Thu, 03 Feb 2022 20:43:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25005; Package emacs. (Fri, 04 Feb 2022 10:00:02 GMT) Full text and rfc822 format available.

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

From: Robert Pluim <rpluim <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Philipp Stephani <p.stephani2 <at> gmail.com>, 25005 <at> debbugs.gnu.org,
 Clément Pit--Claudel <clement.pit <at> gmail.com>
Subject: Re: bug#25005: 25.1; Support disabling bracketed paste mode.
Date: Fri, 04 Feb 2022 10:59:50 +0100
>>>>> On Thu, 03 Feb 2022 21:42:26 +0100, Lars Ingebrigtsen <larsi <at> gnus.org> said:

    Lars> Philipp Stephani <p.stephani2 <at> gmail.com> writes:
    >> "My crystal ball said you should remove (global-set-key (kbd "M-[")
    >> 'previous-multiframe-window) from your ~/.emacs. You might like to M-x
    >> report-emacs-bug and ask for global-set-key to complain when the key
    >> sequence conflicts with something in input-decode-map (as is the case
    >> here, because the byte sequence ESC [ (which corresponds to the M-[
    >> event) is used by text terminal as a prefix for encoding all kinds of
    >> special events)."

    Lars> This would be easy enough to do...  does anybody have any comments?

Hmm, so if I start emacs under a window system, where input-decode-map
doesnʼt contain ESC [, and then create a tty frame inside an xterm,
this would still fail, no? Or did you want the terminal setup to
complain if input-decode-map conflicts with a key binding as well?

And no doubt there are daemon use-cases to consider as well.

Robert
-- 




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25005; Package emacs. (Sat, 05 Feb 2022 06:42:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Robert Pluim <rpluim <at> gmail.com>
Cc: Philipp Stephani <p.stephani2 <at> gmail.com>, 25005 <at> debbugs.gnu.org,
 Clément Pit--Claudel <clement.pit <at> gmail.com>
Subject: Re: bug#25005: 25.1; Support disabling bracketed paste mode.
Date: Sat, 05 Feb 2022 07:41:42 +0100
Robert Pluim <rpluim <at> gmail.com> writes:

> Hmm, so if I start emacs under a window system, where input-decode-map
> doesnʼt contain ESC [, and then create a tty frame inside an xterm,
> this would still fail, no? Or did you want the terminal setup to
> complain if input-decode-map conflicts with a key binding as well?

Yes, that sounds really messy.

So I don't think there's anything realistic that can be done here, and
I'm therefore closing this bug report.  (If somebody has ideas, please
respond to the debbugs address and we'll reopen.)

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug closed, send any further explanations to 25005 <at> debbugs.gnu.org and Jay Lee <jay <at> hanjaelee.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sat, 05 Feb 2022 06:43:01 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 05 Mar 2022 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 118 days ago.

Previous Next


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