Richard Lyons wrote:
On Wednesday, 25 January 2006 at 10:19:52 -0600, Andrew Nelson wrote:Hello all, Recently I've noticed my xterm's doesn't seem to be handling line wrapping of commands correctly. Instead of wrapping to a new line the characters start wrapping back on the current line.I've noticed this intermittently over a long time. I note that resizing the window -- enlarging it by a minute amount -- seems to overcome the problem when it occurs.
Yeah, that sounds like a bash problem. In some cases, if I re-size a window while a foreground command is executing, then if I edit a command line that's long enough to wrap, bash doesn't seem to know about the new window size (it wraps wrong). Re-sizing the window again while bash is prompting for a command (e.g., when I am editing a command line) reliably fixes the problem. (I wonder exactly how bash deals with WINCH (window size changed) signals. The executing foreground command does get the WINCH signal. (I can run something like "watch" and resize the window and on the next update watch will adjust to the new window size.) My impression (possibly wrong) is that bash initially gets the WINCH signal and then forwards/repeats it to the foreground command. If that's true, I'm surprised that bash doesn't take note of the signal and the new window size (and that behavior would seem to be a bash bug). Of course, if the original WINCH signal is sent directly to the foreground command and bash never sees it, then that would explain things and there might be nothing that bash could do to notice the new window size (efficiently).) Daniel