问题
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