]> git.eshelyaron.com Git - emacs.git/commitdiff
Send text received by bracketed paste to process
authorPhilipp Stephani <phst@google.com>
Sun, 6 Nov 2016 18:21:10 +0000 (19:21 +0100)
committerPhilipp Stephani <phst@google.com>
Thu, 10 Nov 2016 21:56:08 +0000 (22:56 +0100)
See Bug#24639.

* term.el (term--xterm-paste): New function.
(term-raw-map): Use it.
(xterm--pasted-text): Declare function from xterm.el.

lisp/term.el

index 993e5803059a93df1062d04e11fb7bc9ce529f02..18d67757d0c26732e64a205e2c7f2224cc3322a1 100644 (file)
@@ -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 ...