views:

224

answers:

4

I'm using Putty to log into a debian server. I have this odd problem that when a command I'm typing gets too long, it doesn't wraparound and start a new line, instead it starts at the beginning of the same line and starts to overwrite the prompt and then the beginning of the command.

The command will run just fine, but it is really annoying, I'm assuming there is some setting that would fix this for me?

A: 

Nothing to do with putty its a "bash"ism.

Its quite useful once you are used to it, but, if it bothers you you can switch to "ksh" which does something different with long command lines (not sure what on Debian!)

James Anderson
No, not in putty, usually it wraps the command. Its another thing, that sometimes occurs.
frunsi
Readline (which Bash uses for interactive line editing) does have a `horizontal-scroll-mode` option, but it doesn't entirely match OP's reported symptoms.
ephemient
A: 

I've seen this behavior when you resize the Putty window while another command is running since bash doesn't get the signal telling it the window has resized.

If this is the problem adding:

shopt -s checkwinsize

should make it go away.

R Samuel Klatchko
A: 

try eval $(resize)

Rob Curtis
A: 

try pressing Ctrl+L. (or maybe Alt+L - something-L anyway) If I remember rightly this re-runs the code to figure out your terminal size, and adjusts accordingly.

Orion Edwards