* 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.
(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).
(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)
;; 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)