1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-26 10:49:33 +00:00

t-mouse.el: Make sure we apply the setting to new terminals

* lisp/t-mouse.el (gpm-mouse-tty-setup): New function.
(gpm-mouse-mode): Use it as well as `tty-setup-hook`.
* lisp/term/linux.el (terminal-init-linux): Remove gpm-specific code,
not neded any more.
This commit is contained in:
Stefan Monnier 2022-08-30 17:55:03 -04:00
parent 1feec84b0f
commit a28ede3a61
2 changed files with 6 additions and 3 deletions

View File

@ -62,6 +62,9 @@
(gpm-mouse-stop))
(set-terminal-parameter nil 'gpm-mouse-active nil))
(defun gpm-mouse-tty-setup ()
(if gpm-mouse-mode (gpm-mouse-enable) (gpm-mouse-disable)))
;;;###autoload
(define-minor-mode gpm-mouse-mode
"Toggle mouse support in GNU/Linux consoles (GPM Mouse mode).
@ -80,7 +83,9 @@ GPM. This is due to limitations in GPM and the Linux kernel."
(terminal-parameter terminal 'gpm-mouse-active))))
;; Simulate selecting a terminal by selecting one of its frames ;-(
(with-selected-frame (car (frames-on-display-list terminal))
(if gpm-mouse-mode (gpm-mouse-enable) (gpm-mouse-disable))))))
(gpm-mouse-tty-setup))))
(when gpm-mouse-mode
(add-hook 'tty-setup-hook #'gpm-mouse-tty-setup)))
(provide 't-mouse)

View File

@ -15,8 +15,6 @@
;; Compositions confuse cursor movement.
(setq-default auto-composition-mode "linux")
(ignore-errors (when gpm-mouse-mode (require 't-mouse) (gpm-mouse-enable)))
;; Don't translate ESC TAB to backtab as directed
;; by ncurses-6.3.
(define-key input-decode-map "\e\t" nil)