Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I use bash shell

$ bash --version
GNU bash, version 3.2.25(1)-release (x86_64-redhat-linux-gnu)
Copyright (C) 2005 Free Software Foundation, Inc.

Sometimes, when typing a command on the prompt that is pretty lengthy and does not fit in the current line, instead of displaying the extra characters on the next line, bash starts again on the current line.. replacing the characters that were there and making a mess.

what should happen :

| $ my big long command takes a lot of argumen|
| s and does not fit in a single line         |
|                                             |

what happens instead :

| s and does not fit in a single linef argumen|
|                                             |
|                                             |
  • The issue is intemittent
  • If I resize my shell window to really small width, normal behaviour is restored

Does anyone have any idea what is happening here?

$ echo $TERM
$ echo $PS1
share|improve this question
What terminal emulator are you using? What is TERM set to? Do you have any color or other formatting sequences in your PS1? – Dennis Williamson Jan 8 '11 at 18:38
@Dennis: updated. – Lazer Jan 8 '11 at 18:50
What terminal emulator are you using (PuTTY, gnome-terminal, etc.)? – Dennis Williamson Jan 8 '11 at 19:20
@Dennis: I am not sure. I VNC to the machine to use it. – Lazer Jan 8 '11 at 19:50
Try shopt -s checkwinsize or put it in your ~/.bashrc. (The command makes bash recheck the window's size every time the prompt is displayed.) – grawity Jan 8 '11 at 20:08

Your shell is getting confused about the width of your terminal. Whenever this happens an eval `resize` should reset everything properly.

share|improve this answer

Your Answer


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.