Whenever I type in a bash command longer than about half the width of the shell window I'm in, the command breaks like it would if I filled the whole screen

image of problem

  • 3rd command in image - typed a few xs and got the expected result.
  • 4th command - typed a load more xs, and the command broke back to the start as though it had filled the whole line.

I'm connecting through Putty.

I'm running Raspbian (a distro based on Debian)

If I'm not being clear enough please say, it's not easy to explain.

  • Is that putty your using?
    – Secko
    Aug 1, 2012 at 11:28
  • Yes, should have said.
    – ACarter
    Aug 1, 2012 at 11:32
  • What is your $PS1 variable?
    – Random832
    Aug 1, 2012 at 14:51

1 Answer 1


I think that your tty is reporting the wrong tty size. Try running

pi@raspberrypi$ stty -aF /dev/ttyO0

There you will see how many rows and columns the tty thinks it has. This size should match the size set in putty. You can also change parameters, such as number of columns, using stty. The command would be something like

pi@raspberrypi$ stty -F /dev/ttyO0 cols 80

You can check more parameters at http://unixhelp.ed.ac.uk/CGI/man-cgi?stty

  • I am using PuTTY with all my Linux machines, like SCO and Ubuntu, and I just tried what you did @ACarter, and I didn't get any oddity. My PuTTY settings are default. So I am not sure if you might've changed something, or it could be an issue with how it is displaying for Raspbian.
    – Kevdog777
    Aug 1, 2012 at 12:44

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.