在 tmux 中修复在 mate-terminal 中运行的 nano 中的滚动

eoi*_*noc 4 zsh terminal tmux nano

问题:

  • 我打开一个终端(在 Linux Mint 中,所以是 mate-terminal)
  • zsh 是外壳
  • 然后我运行 tmux
  • 使用 nano 编辑文件
  • 使用光标上下滚动该文件
  • 问题:在 nano 中向下滚动时,只有终端窗口的下半部分会刷新
  • 问题:在 nano 中向上滚动时,只有终端窗口的上半部分会刷新

滚动时,我的终端窗口中不会刷新文件的完整纳米视图。有小费吗?

编辑:我的 .tmux.conf

似乎这一行是罪魁祸首(因为注释掉它可以解决问题):

set -g default-terminal "xterm-256color"
Run Code Online (Sandbox Code Playgroud)

我很确定我添加了该行,因为我什至在 SSH 会话期间运行 nano 也有问题。

这是完整的文件:

set-option -g default-shell /bin/zsh

# Make sure tmux knows we're using 256 colours, for
# correct colourised output
set -g default-terminal "xterm-256color"

# The following were marked as "unknown", so
# I do know what I'm doing wrong.
#set -g mode-mouse on
#setw -g mouse-select-window on
#setw -g mouse-select-pane on

# Attempting to stop "alert" sound upon startup
# but none of these are working...
set-option bell-on-alert off
set-option bell-action none
set-option visual-bell off
Run Code Online (Sandbox Code Playgroud)

jas*_*yan 8

来自 tmux 常见问题解答:

****************************************************** ********************************
* 请注意:大多数显示问题是由于不正确的 TERM!前 *
* 报告问题确保 TERM 设置在内部正确且 *
* 在 tmux 之外。*
* *
* tmux 内的 TERM 必须是“screen”或类似的(例如“screen-256color”)。*
* 不要费心报告不存在的问题!*
* *
* 在外面,它必须与您的终端匹配:特别是,对 rxvt 使用“rxvt” *
* 和衍生物。*
****************************************************** ********************************

http://tmux.git.sourceforge.net/git/gitweb.cgi?p=tmux/tmux;a=blob;f=FAQ