tmux如何覆盖emacs快捷键

3
所以我已经搜索了大约40分钟,没有成功,而“C-x”对于大多数搜索引擎来说比较晦涩,这一点也没有帮助。几周前,我曾经使用过tmux与控制台emacs结合使用,并且一切都很正常。然后我有一段时间没有使用它,现在我又回到了这个配置,因为我想要一个完全没有干扰的工作环境,而tmux TTY似乎是个不错的选择。问题是现在当我输入C-x时,emacs不再响应了,你可以猜到,这非常令人恼火。我不知道为什么它不能工作,我敢肯定我没有设置任何与此命令重叠的东西。当然,在tmux之外它可以工作。所以这一定是一个冲突,但是为什么呢?如何解决它而不需要重新映射emacs的命令?
另外,我读到在TTY中无法使用256色模式,真的没有办法吗?:/
编辑:关于256色TTY,我看到一些帖子建议使用fbterm或其他终端,但所有被引用的终端都已经过时了。还有没有其他办法?另外,我一直在尝试让unicode字符在那里工作,但答案要么与256色相同,要么是在Fedora 28的当前版本上无法工作的配置。
这是我的.tmux.conf文件。
# Reload config using C-b r
bind r source-file ~/.tmux.conf

# split panes using | and -
bind | split-window -h
bind - split-window -v
unbind '"'
unbind %

# switch panes using Ctrl-arrow without prefix
bind -n C-Left select-pane -L
bind -n C-Right select-pane -R
bind -n C-Up select-pane -U
bind -n C-Down select-pane -D
bind-key -r x kill-pane

# Resize panes
bind -n M-< resize-pane -L 5
bind -n M-> resize-pane -R 5
bind -n M-w resize-pane -U 5
bind -n M-W resize-pane -D 5

# Enable mouse control (clickable windows, panes, resizable panes)
set -g mouse on
set -g pane-border-fg colour8
set -g pane-active-border-fg colour7
set -g pane-active-border-bg default

# Status bar
set -g status-position top

这是我的.emacs文件:

;; .emacs


;; Added by Package.el.  This must come before configurations of
;; installed packages.  Don't delete this line.  If you don't want it,
;; just comment it out by adding a semicolon to the start of the line.
;; You may delete these explanatory comments.
(package-initialize)

(add-to-list 'package-archives
             '("melpa-stable" . "https://stable.melpa.org/packages/") t)

;; Irony
(add-hook 'after-init-hook 'global-company-mode)
;; Always start smartparens mode in js-mode.
;(add-hook 'js-mode-hook #'smartparens-mode)

;; Company-Irony backend
(eval-after-load 'company
  '(add-to-list 'company-backends 'company-irony))

(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(ansi-color-faces-vector
   [default default default italic underline success warning error])
 '(column-number-mode t)
 '(cua-mode t nil (cua-base))
 '(custom-enabled-themes (quote (misterioso)))
 '(diff-switches "-u")
 '(package-selected-packages
   (quote
    (company-irony flycheck-irony company irony autopair which-key w3)))
 '(show-paren-mode t))

;;
;; Epitech configuration
;;
(add-to-list 'load-path "~/.emacs.d/lisp")
(load "site-start.d/epitech-init.el")
(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 )

;; Add a "lines" column
(global-linum-mode t)
(setq linum-format "%4d \u2502 ")

;; `lines-tail`, highlight the part that goes beyond the
;; limit of `whitespace-line-column`
(require 'whitespace)
(setq whitespace-style '(face empty tabs lines-tail trailing))
(global-whitespace-mode t)

;; Auto whitespace-cleanup
(add-hook 'before-save-hook #'whitespace-cleanup)

;; Set TAB behaviour
;; TABS should AWLAYS be spaces
(setq-default indent-tabs-mode nil)
;; Make TABS 4 spaces
(setq default-tab-width 4)

;; Autopair
(electric-pair-mode)

;; Fix "<<EOF \n<" issue in bash mode
(add-hook 'sh-mode-hook (lambda () (sh-electric-here-document-mode -1)))

;; Add in-terminal mouse support
(when (eq window-system nil)
  (xterm-mouse-mode t))

感谢您抽出时间来阅读这篇文章。

也许在 tmux 中绑定了 C-x 到某个操作上了。你尝试过解除绑定吗? - Jim Janney
我确定我尝试过了,但它仍然无法工作。我会再试一次。 编辑:好吧,我刚刚打开了.tmux.conf文件,看起来我在发布后尝试了“unbind C-x”,因为它正好位于r的绑定下面。现在它可以工作了...奇怪。 - Sir Wrexes
1个回答

0

我解除了C-x的绑定,但它没有起作用,所以我让这个解绑保留在我的配置文件中。现在我已经启动了一个新会话并回到了这个问题上,它可以正常工作了。问题解决。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接