Long commands typed in bash overwrite the same line

Since We updated Bash to 4.3.27 whenever I type a long command, if it reach the end of terminal window, instead of continuing in a new line, it overwrites over the same line using a ">" at the beginning to mark that the line was wrapped (I can go back and forward over the line. I mean, it doesn't just overwrites the current line)

Something like:

Lets say my terminal its 30 chars width

Before update user@HOSTNAME ~$ echo "hello w orld!"

After update <ME ~$ echo "hello world!"

Nothing was changed in my environment since that bash update. $BASHOPTS shows the same values as it has before except "complete_fullquote"

How can I restore the "multiline behaviour"?

Regards


Change your TERM variable. For instance, if I do

~$ export TERM=xterm

Then the behaviour is nicely wrap, like before your update

With

~$ export TERM=linux

The behaviour is the one after your update

This post on askubuntu may help you if you have a colored PS1.


Short answer:

echo "set horizontal-scroll-mode off" >> ~/.inputrc

Bit longer answer:

In an interactive bash shell, user input is handled by the READLINE library (look for it in bash man page to get more informations). Per bash documentation, the default behaviour is to wrap to a new line when the input is longer than the screen width. You can override this default by setting the horizontal-scroll-mode variable.

As you don't get the default behaviour you might want to check:

  • the file pointed by $INPUTRC to see if horizontal-scroll-mode is set. Worth noting that a readline variable is set if it reads to empty, null, on (case insensitive) or 1.
  • the configure options you used if you compiled your version of bash