Disable bracketed paste in a terminal in char mode
commitcf566b46a6cf85c6d54d0b0db80e32ed6ae8d1ca
authorPhilipp Stephani <phst@google.com>
Sat, 15 Oct 2016 13:19:56 +0000 (15 15:19 +0200)
committerPhilipp Stephani <phst@google.com>
Sat, 15 Oct 2016 15:13:27 +0000 (15 17:13 +0200)
tree976d4825752ceee0fd7baf0df5e666b810a57c72
parentf68b463d1b05c7cd45b66a5cb0977c21016f5ea5
Disable bracketed paste in a terminal in char mode

In char mode, a terminal doesn't accept bracketed paste events,
therefore we should disable them; see Bug#24639.  To decouple the XTerm
management from term.el, introduce a per-buffer setting to disable
bracketed paste for that buffer.  If bracketed paste is inhiited for at
least one buffer in a terminal, it is disabled for the whole terminal.

* term/xterm.el (xterm-inhibit-bracketed-paste-mode): New mode to
inhibit XTerm bracketed paste per buffer.
(xterm--buffer-terminals, xterm--update-bracketed-paste)
(xterm--bracketed-paste-possible, xterm--is-xterm): New helper
functions.
(xterm--init-bracketed-paste-mode): Remove unused helper
function.
(terminal-init-xterm): Update bracketed paste status when
initializing an XTerm and on window configuration change.

* term.el (term-char-mode, term-line-mode): Inhibit XTerm
bracketed paste in char mode.
lisp/term.el
lisp/term/xterm.el