I have a Bash Terminal via a SSH connection in GNOME terminal. Server is Debian Linux, Client is Ubuntu Linux.

The output of long lines is displayed well, but when I use the UP-key to scroll in the bash history, the output goes only 80 characters, is then broken and starts in the same line again.

It should look like this:

server01:/usr/local/bin# very-long-command parameter1 paramter2 paramter3

But it looks similar like this:

parameter3 usr/local/bin# very-long-command parameter1 paramter2 
  • To clear that use 'CTRL + L', the 'clear' or the 'reset' command.
    – Shadok
    May 16, 2012 at 9:56

2 Answers 2


This can happen when you have escape sequences (as generated by tput) in your prompt that are not surrounded by \[ and \]. Those backslashed brackets tell Bash that the escape sequences do not take up any horizontal space on the screen. Without them around the escape sequences, Bash counts each byte of the escape sequence as a visible character, which messes up previously displayed commands as you move back and forth through command history.

  • I do not think I have such in my prompt ... it's a standard Debian prompt.
    – Alex
    Jul 20, 2012 at 16:30
  • 2
    Type echo "$PS1" | od -c. If the output shows any characters with the value 033, then you have escape sequences in your prompt.
    – Fran
    Jul 20, 2012 at 17:17

What do you get when you type echo $TERM?

If it mentions gnome or something else which seems gnome specific, you may want to try something more generic like vt100, xterm, or xterm-256color.

Is this problem the same if the Gnome Terminal window is much wider than 80 characters?

  • It is "xterm". And if the gnome terminal is wider than 80 characters, only a smaller width is used.
    – Alex
    Jul 20, 2012 at 16:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .