我正在尝试在Terminal.app中使用Emacs和tmux,并且很难让鼠标正确工作。
如果我在tmux的外部使用Emacs ,那么可以使用鼠标单击文本来跳过缓冲区。
但是,如果我在tmux中,并且开始编辑Emacs中的文件,那么我就不能点击周围。我必须做M加载文件~/ . emacs.d/init.el .才能让它起作用。
这是我的init.el的内容
(require 'package) ;; You might already have this line
(when (< emacs-major-version 24)
;; For important compatibility libraries like cl-lib
(add-to-list 'package-archives '("gnu" . "http://stable.gnu.org/packages/")
'("melpa" . "http://melpa.org/packages/")))
(package-initialize) ;; You might already have this line
;; magit
(global-set-key (kbd "C-x g") 'magit-status)
(global-set-key (kbd "C-x M-g") 'magit-dispatch-popup)
(global-set-key (kbd "C-c SPC") 'ace-jump-mode)
;; mouse
;; enable mouse reporting for terminal emulators
(unless window-system
(xterm-mouse-mode 1)
(global-set-key [mouse-4] (lambda ()
(interactive)
(scroll-down 1)))
(global-set-key [mouse-5] (lambda ()
(interactive)
(scroll-up 1))))..and my tmux.conf
set -g mouse on
bind X confirm-before kill-session
bind C-s set-window-option synchronize-panes
bind r source-file ~/.tmux.conf \; display "Reloaded!"
set -g window-active-style 'fg=colour250,bg=black'
bind -t emacs-copy C-WheelUpPane halfpage-up
bind -t emacs-copy C-WheelDownPane halfpage-down
# plugins
set -g @plugin 'nhdaly/tmux-scroll-copy-mode'
run '~/.tmux/plugins/tpm/tpm'版本
tmux version 2.1
emacsclient 24.5
macOS 10.11.4 发布于 2019-02-12 07:14:47
这对我起了作用:
(xterm-mouse-mode 1)https://stackoverflow.com/questions/36620518
复制相似问题