我想使用Emacs和TMUX在Terminal.app,并且无法获得鼠标正常工作。
如果我使用TMUX以外的Emacs,那么我可以用鼠标点击文本跳来跳去缓冲区。
但是,如果我是里面TMUX,我开始编辑在Emacs一个文件,然后我不能按一下周围。我要做的M-X装载文件〜/ .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))))
..和我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
这为我工作:
(xterm-mouse-mode 1)