On Wed, Sep 05, 2012 at 08:52, LEVAI Daniel wrote: > On k, szept 04, 2012 at 18:15:29 -0400, Ted Unangst wrote: >> I move my windows around and even resize them sometimes. Sometimes >> ksh catches on, but a lot of the time it doesn't. The problem is if >> I'm running an editor like vi (kinda common reason why I'd want to >> resize the terminal), sigwinch doesn't get to ksh. Then when I exit >> the editor, command line editing is all messed. >> >> Fix is simple. Pretend we got a sigwinch whenever we do the regular >> mailcheck/jobs notify stuff. Then the edit code will check the >> current status. > [...] > > This doesn't work for me inside either urxvt or xterm. I've resized the > windows but the end of the line remained more far than the windows' > edge. Do I understand correctly that this patch would make ksh always > recalculate the editor's line end if a terminal window resize occurs?
The did we get sigwinch code only runs after you hit enter. The next prompt (assuming the signal was received) will be correct. Easiest way to see what's happening is to run "set | grep COLUMNS". What the diff fixes is the fact that in a lot of cases ksh *doesn't* get the signal. sigwinch is only delievered to the process group that controls the terminal, and ksh runs children in a different group. Ergo, it will never get the signal if another program is running. I changed ksh to always act as if it received a sigwinch sometime during execution of the command it just ran. But I didn't change anything about how frequently it checks to see if it received the signal. If you want the command line to update in realtime to window changes, that's a trickier change.
