]> git.eshelyaron.com Git - emacs.git/commit
Don't always enable xterm-mouse-mode (bug#74833)
authorJared Finder <jared@finder.org>
Thu, 2 Jan 2025 06:36:25 +0000 (22:36 -0800)
committerEshel Yaron <me@eshelyaron.com>
Sat, 4 Jan 2025 20:58:52 +0000 (21:58 +0100)
commit1db1f07b08e854de5f117254c77210d34737e95e
treea6d8d2745f54567f2e5c6b269c6bc1efda14e862
parentf12f7b31ffa289c18ce04f2a254aadaccf133150
Don't always enable xterm-mouse-mode (bug#74833)

Many terminals set the environment variable TERM to "xterm" even when they
don't support all functionality in xterm.  This means that enabling
xterm-mouse-mode can break critical editing workflows like copy/paste.  This
adds checks for the specific terminal Emacs is run in and only enables
xterm-mouse-mode on terminals knows to support all critical editing workflows.

* etc/NEWS: Update announcement
* lisp/term/xterm.el (xterm--auto-xt-mouse-allowed-names)
(xterm--auto-xt-mouse-allowed-types): New variables to control
what terminals automatically enable xterm-mouse-mode.
(xterm--report-background-handler, xterm--version-handler): Use
xterm--read-string.
(xterm--read-string, xterm--query-name-and-version): New
function.
(xterm--init): Check what terminal is running and if
xterm-mouse-mode was manually called.
* lisp/xt-mouse.el (xterm-mouse-mode-called): New variable.
(xterm-mouse-mode): Set xterm-mouse-mode-called.  Mention
automatic call by xterm--init.  Delete outdated comment text.

(cherry picked from commit ba6429081a8560979136cf6fa40ff3f3c4859a53)
etc/NEWS
lisp/term/xterm.el
lisp/xt-mouse.el