PuTTY and editing long lines on the command prompt

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I'm having a strange problem with PuTTY that I have been unable to solve
  so far.

I use PuTTY to remotely log in to a Linux server running Bash using SSH.
  The simplest way to reproduce my problem is to simply type characters
on the commandline until it reaches the edge of the screen.  The cursor
now should go one line down and the commandline should continue, but in
PuTTY the cursor goes to the start of the same line and starts
overwriting it.

The commandline still executes as normal, but it makes editing a long
commandline problematic.  The problem is even more apparent when editing
a long line.  When I use cursor-up to go back to a long commandline,
PuTTY will overwrite a number of previous lines to display the full
commandline (instead of scrolling down).  When using backspace to delete
part of the commandline, PuTTY will reprint the line, but each time
scrolling up one line higher, overwriting large parts of the screen.

I've checked the FAQ, the docs, tried various terminal settings, but
cannot seem to solve the problem.  Can anyone help?


Re: PuTTY and editing long lines on the command prompt

Quoted text here. Click to load it

In my experience, the top two causes of this sort of problem have turned
out to be:

 - Failure to use \[ and \] correctly in a custom prompt string
   (e.g. $PS1). Setting PS1 to something simple (e.g. "") should show
   whether this is the problem.

 - Failure of SIGWINCH to propagate properly after a horizontal terminal
   resize. If "kill -WINCH $$" clears the problem up, it's this one.

Site Timeline