Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 
share|improve this question
    
To clear that use 'CTRL + L', the 'clear' or the 'reset' command. –  Shadok May 16 '12 at 9:56

2 Answers 2

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?

share|improve this answer
    
It is "xterm". And if the gnome terminal is wider than 80 characters, only a smaller width is used. –  Alex Jul 20 '12 at 16:31

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.

share|improve this answer
    
I do not think I have such in my prompt ... it's a standard Debian prompt. –  Alex Jul 20 '12 at 16:30
1  
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 '12 at 17:17

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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