Weird tmux vim through ssh [closed]

你。 提交于 2021-02-08 10:53:35

问题


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

after I start tmux, it turns to this

[1.9.3@lizhe] ~ 
→    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

another big problem is the vim, it's totally unusable, just check the following screen record, I don't konw how to describe it.

wierd vim in tmux throug ssh

I use j k to move, but the current line is not it look like, and some lines are not visiable.


回答1:


It seems like your TERM variable is set wrong.

According to the man page for TMUX found here

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.

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.



来源:https://stackoverflow.com/questions/15892092/weird-tmux-vim-through-ssh

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!