]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix pasting into terminal-mode on term.el
authorEli Zaretskii <eliz@gnu.org>
Sat, 16 Dec 2023 12:44:32 +0000 (14:44 +0200)
committerEshel Yaron <me@eshelyaron.com>
Sat, 16 Dec 2023 19:16:13 +0000 (20:16 +0100)
* lisp/term.el (term--xterm-paste): Read pasted text from the
input event.  Suggested by Jared Finder <jared@finder.org>.
(Bug#49253)

(cherry picked from commit c3331cb3659ffca0b04e0b789e9826b53777a70a)

lisp/term.el

index 81746e0c20d2a2272364475099f4c25ad651ba4c..7507f8ed806433f625373b634d23811789125cc8 100644 (file)
@@ -1395,8 +1395,13 @@ Entry to this mode runs the hooks on `term-mode-hook'."
 
 (defun term--xterm-paste ()
   "Insert the text pasted in an XTerm bracketed paste operation."
-  (interactive)
-  (term-send-raw-string (xterm--pasted-text)))
+  (interactive "e")
+  (unless (eq (car-safe event) 'xterm-paste)
+    (error "term--xterm-paste must be found to xterm-paste event"))
+  (let ((str (nth 1 event)))
+    (unless (stringp str)
+      (error "term--xterm-paste provided event does not contain paste text"))
+    (term-send-raw-string str)))
 
 (declare-function xterm--pasted-text "term/xterm" ())