I am using gnome-terminal in Ubuntu 11.10 and seem to get long lines overlapping in the terminal window.

When I copy a long command line and paste it into the terminal, the text gets overlapped to the start of the line and often covers the user prompt.

If I resize the terminal window, making it wider the overlapping gets undone and everything looks normal. In previous versions of Ubuntu, if a line was too long it would continue on the next line below.

Another problem I have noticed that may be related, is when using the up arrow key to show previously typed commands, sometimes instead of the output command line being replaced by the previous command each time the key is pressed, the lines get partially merged. A portion of the old line remains, and the next command gets joined onto the end.

This leftover part of a command is persistent and does not get replaced next time the key is pressed, although the insertion point or blinking cursor is at the end of the latest recalled command, and the leftover has no effect if I press enter.

Is this problem a bug or some setting that needs fixing? Where do I look for the cause? keyboard? gnome-terminal? bash?

Thank you for any help or suggestions offered

  • Can you confirm this happens on other units as well?
    – Huckle
    Apr 16 '12 at 3:14

[SOLVED] I tested for this behaviour using the Ubuntu 11.10 live cd and did not have the same problems in terminal, so I guessed that a change I had made was likely to be the cause.

I had made some changes to the .bashrc file while following a tutorial on customising the bash user prompt, which must have caused this problem.

After restoring the original .bashrc file from backup, the problem with overlapping lines is resolved.

Thanks for your response Huckle. Cheers


The issue is when some non-printed characters are not properly enclosed by \[ \].

make sure every option for colour, bold, underline etc is properly enclosed

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.