From d00df0aaf9105128d80f6e395974474cf5975499 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Daniel=20Gr=C3=B6ber?= Date: Sun, 8 Mar 2020 14:04:13 -0400 Subject: [PATCH] * lisp/term/rxvt.el: Enable backeted paste and window title rxvt-unicode uses the same escape sequences as xterm so just re-use the xterm functions to enable them. The `xterm-rxvt-function-map` keymap already has (define-key map "\e[200~" [xterm-paste]) so we're already handling the paste sequence and only need to enable it. Tested on rxvt-unicode version 9.22. (rxvt-set-window-title): New var. (terminal-init-rxvt): Use it; enable bracketed paste mode; run terminal-init-rxvt-hook. --- lisp/term/rxvt.el | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/lisp/term/rxvt.el b/lisp/term/rxvt.el index ca6c468f525..31e3d6ede4f 100644 --- a/lisp/term/rxvt.el +++ b/lisp/term/rxvt.el @@ -26,6 +26,16 @@ (require 'term/xterm) +(defgroup rxvt nil + "(U)RXVT support." + :version "28.1" + :group 'terminals) + +(defcustom rxvt-set-window-title nil + "Whether Emacs should set window titles to an Emacs frame in RXVT." + :version "28.1" + :type 'boolean) + (defvar rxvt-function-map (let ((map (make-sparse-keymap))) (set-keymap-parent map xterm-rxvt-function-map) @@ -171,7 +181,16 @@ (xterm-register-default-colors rxvt-standard-colors) (rxvt-set-background-mode) ;; This recomputes all the default faces given the colors we've just set up. - (tty-set-up-initial-frame-faces)) + (tty-set-up-initial-frame-faces) + + ;; Unconditionally enable bracketed paste mode: terminals that don't + ;; support it just ignore the sequence. + (xterm--init-bracketed-paste-mode) + + (when rxvt-set-window-title + (xterm--init-frame-title)) + + (run-hooks 'terminal-init-rxvt-hook)) ;; rxvt puts the default colors into an environment variable ;; COLORFGBG. We use this to set the background mode in a more -- 2.39.2