From: Eli Zaretskii Date: Sat, 16 Dec 2023 12:44:32 +0000 (+0200) Subject: Fix pasting into terminal-mode on term.el X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c3331cb3659ffca0b04e0b789e9826b53777a70a;p=emacs.git Fix pasting into terminal-mode on term.el * lisp/term.el (term--xterm-paste): Read pasted text from the input event. Suggested by Jared Finder . (Bug#49253) --- diff --git a/lisp/term.el b/lisp/term.el index 68b1136a0b4..b9f739dc8f1 100644 --- a/lisp/term.el +++ b/lisp/term.el @@ -1392,8 +1392,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" ())