I am using konsole-4.14.3, tmux-2.6 and my shell is bash. Outside tmux, line wrapping work perfectly and the text is moved to the next line. In tmux, this does not work though. I googled for a long time, but did not find any working fixes. In my ~/.bashrc I have

export PS1="\[\e[1;92m\]\u@\h: \w \\$ \[\e[m\]"
export PS2='> '

I removed them and tried again, but the result was the same. I am on Slackware 14.2 and it seems that the problem is related to some system setting because with the same ~/.tmux.conf, line wrapping works as expected on Ubuntu 16.04.


EDIT: Found the problem. It seems to be happening in bash 4.3, maybe older versions as well. The default value of TERM for my OS (outside tmux) was xterm. As soon as TERM is set to screen or screen-256color, line wrapping stops working. Since tmux requires that TERM is set to screen or screen-256color, line wrapping would not work. The problem was fixed after updating to bash 4.4.

  • 1
    Let's mention for the record that inside tmux and screen the expected value of TERM is something related to screen (e.g. screen-256color), whereas outside of tmux and screen it should be whatever the terminal emulator sets for you by default (often xterm or xterm-256color). Don't expect the same value (whatever it is) to work both outside and inside of tmux. – egmont Nov 9 '17 at 23:16
  • Experiencing this with Bash 5.0.3 – zoechi Dec 2 at 8:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.