From: Jared Finder Date: Tue, 10 Dec 2024 06:16:40 +0000 (-0800) Subject: Enable xterm-mouse-mode by default in xterm X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=72b1465cbd270b8e7ddef2ae234d67a88385aa03;p=emacs.git Enable xterm-mouse-mode by default in xterm * lisp/xt-mouse.el (xterm-mouse-mode): Change default value of xterm-mouse-mode to t. * lisp/term/xterm.el (xterm--init): Enable xterm-mouse-mode if the default value is still set. * etc/NEWS: Document new behavior. (cherry picked from commit 9ccd459e8452cc9e6e81e53f26bbeef20d2d5bb7) --- diff --git a/etc/NEWS b/etc/NEWS index 694a0e49b05..ab11a363338 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -41,6 +41,12 @@ why the mark trace buffer is enabled by default. * Startup Changes in Emacs 31.1 +** When run inside xterm, 'xterm-mouse-mode' is turned on by default. +This means that the mouse will work by default inside xterm terminals. +If your terminal does not behave properly with xterm mouse tracking +enabled, you can disable mouse tracking by putting '(xterm-mouse-mode +-1)' in your init file. + * Changes in Emacs 31.1 diff --git a/lisp/term/xterm.el b/lisp/term/xterm.el index 82f9a60b53b..c4f33cd0faa 100644 --- a/lisp/term/xterm.el +++ b/lisp/term/xterm.el @@ -907,6 +907,8 @@ We run the first FUNCTION whose STRING matches the input events." (when xterm-set-window-title (xterm--init-frame-title)) + (when xterm-mouse-mode + (xterm-mouse-mode 1)) ;; Unconditionally enable bracketed paste mode: terminals that don't ;; support it just ignore the sequence. (xterm--init-bracketed-paste-mode) diff --git a/lisp/xt-mouse.el b/lisp/xt-mouse.el index 8cbb44ece14..c77d763702c 100644 --- a/lisp/xt-mouse.el +++ b/lisp/xt-mouse.el @@ -358,6 +358,8 @@ single clicks are supported. When turned on, the normal xterm mouse functionality for such clicks is still available by holding down the SHIFT key while pressing the mouse button." :global t :group 'mouse + :init-value t + :version "31.1" (funcall (if xterm-mouse-mode 'add-hook 'remove-hook) 'terminal-init-xterm-hook 'turn-on-xterm-mouse-tracking-on-terminal)