* lisp/term.el (term--xterm-paste): Read pasted text from the
input event. Suggested by Jared Finder <jared@finder.org>.
(Bug#49253)
(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" ())