5

When typing a long command in tmux instead of printing to the next line the end of the command shows up at the beginning of the same line.

So instead of user@computer:~$ aaaaaaaaaaa aaaaa this happens aaaaacomputer:~$ aaaaaaaaaaa

Using the standard terminal everything is fine.

André Betz
  • 1,291
  • 2
  • 10
  • 9
  • 4
    See [Wooledge BashFAQ 53](http://mywiki.wooledge.org/BashFAQ/053), "I have a fancy prompt with colors, and now bash doesn't seem to know how wide my terminal is. Lines wrap around incorrectly." – that other guy Feb 14 '18 at 22:02
  • 1
    like https://superuser.com/questions/1266577/line-wrap-not-working-in-tmux/1266581#1266581 – Günter Zöchbauer Dec 02 '19 at 08:57

2 Answers2

4

If you have unescaped characters in your PS1 variable it might not wrap lines correctly.

Try

export PS1="\u@\h-\\$\[$(tput sgr0)\]"

If that fixes your problem you need to update your .bashrc file.

otuva
  • 81
  • 5
-1

The answer might be the content of your TERM variable. What's the answer to

echo $TERM

?

Get the value of TERM before starting tmux and compare it with the value withing tmux! Try setting it to some other value like vt100 or xterm with

export TERM=vt100

or

export TERM=xterm