奇怪的 tmux vim 通过 ssh [英] Weird tmux vim through ssh
问题描述
首先我通过 ssh 进入这个名为 thor
的服务器,我设置了 bash 提示符,在我启动 tmux 之前它看起来像下面
First I ssh into this server called thor
, I set the bash prompt, before I start tmux it looks like following
[1.9.3@lizhe] ~
→ somecommand
在我启动 tmux 之后,它变成了这个
after I start tmux, it turns to this
[1.9.3@lizhe] ~
→ somecommand
在somecommand
之前留出更多空间,在输入命令后按回车,它看起来像这样
more space before somecommand
, after typing an command I hit enter, it looks like this
[1.9.3@lizhe] ~
→ somecommand
[1.9.3@lizhe] ~
→ somecommand
另一个大问题是vim,它完全无法使用,请查看以下屏幕记录,我不知道如何描述它.
another big problem is the vim, it's totally unusable, just check the following screen record, I don't konw how to describe it.
我用j
k
移动,但是当前行不是它的样子,有些行是不可见的.
I use j
k
to move, but the current line is not it look like, and some lines are not visiable.
推荐答案
您的 TERM
变量似乎设置错误.
It seems like your TERM
variable is set wrong.
根据 TMUX 的手册页找到 here
According to the man page for TMUX found here
TERM 环境变量必须设置为 'screen'在 tmux 中运行的程序.新窗口将自动将 'TERM=screen' 添加到他们的环境中,但必须小心采取不要在 shell 启动文件中重置它.
The TERM environment variable must be set to 'screen' for all programs running inside tmux. New windows will automatically have 'TERM=screen' added to their environment, but care must be taken not to reset this in shell start-up files.
确保将 TERM 设置为 screen
或 screen-256color
(您可以通过键入 echo $TERM
来检查).如果不是,请检查您的 init 文件,例如 .profile
和 .bashrc
并确保您没有覆盖 TERM
变量.
Make sure TERM is set to screen
or screen-256color
(You can check this by typing echo $TERM
). If it is not check your init files such as .profile
and .bashrc
and make sure you do not over write the TERM
variable.
这篇关于奇怪的 tmux vim 通过 ssh的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!