diff options
author | Philipp Stephani <phst@google.com> | 2016-11-06 19:21:10 +0100 |
---|---|---|
committer | Philipp Stephani <phst@google.com> | 2016-11-10 22:56:08 +0100 |
commit | 26c3554f88518266a95e228e941425302e25afe4 (patch) | |
tree | 7996264a1fe9d55ef975d3fc35d053c3b13a822b | |
parent | db0b58da1d1e5724c783550103fcf5bb363bb713 (diff) | |
download | emacs-26c3554f88518266a95e228e941425302e25afe4.tar.gz |
Send text received by bracketed paste to process
See Bug#24639.
* term.el (term--xterm-paste): New function.
(term-raw-map): Use it.
(xterm--pasted-text): Declare function from xterm.el.
-rw-r--r-- | lisp/term.el | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lisp/term.el b/lisp/term.el index 993e5803059..18d67757d0c 100644 --- a/lisp/term.el +++ b/lisp/term.el @@ -845,6 +845,7 @@ is buffer-local." (define-key map [S-insert] 'term-paste) (define-key map [prior] 'term-send-prior) (define-key map [next] 'term-send-next) + (define-key map [xterm-paste] #'term--xterm-paste) map) "Keyboard map for sending characters directly to the inferior process.") @@ -1211,6 +1212,13 @@ without any interpretation." (interactive) (term-send-raw-string (current-kill 0))) +(defun term--xterm-paste () + "Insert the text pasted in an XTerm bracketed paste operation." + (interactive) + (term-send-raw-string (xterm--pasted-text))) + +(declare-function xterm--pasted-text "term/xterm" ()) + ;; Which would be better: "\e[A" or "\eOA"? readline accepts either. ;; For my configuration it's definitely better \eOA but YMMV. -mm ;; For example: vi works with \eOA while elm wants \e[A ... |