[procps] top won the sigwinch war

  • From: Jim Warner <james.warner@xxxxxxxxxxx>
  • To: procps@xxxxxxxxxxxxx
  • Date: Thu, 24 Jan 2013 02:14:18 -0600

Hi Craig,

The attached tarball contains 6 patches for top.

I hope they'll be pushed more promptly than the last bunch.

----------------

Hi Jaromir,

These changes address the two issues you raised back on January 8:
1) retain current context through window resize
2) ignore repeated SIGWINCH with overzealous window managers

The first issue was relatively easy and now top's context will be preserved 
even through a suspend/resume sequence.  Thanks for prompting that improvement.

I was tempted to dodge the second issue because top was just a victim.  The 
flood of signals doesn't occur under all window managers and I knew it would be 
a tougher programming challenge.  However, it was worth the effort.

As you experiment with resize you'll discover that some keystroke is 
usually/always required afterward to produce an updated display.  My revised 
man document now suggests using an innocuous key like a punctuation character 
or cursor motion key.  Personally, I always use the <Left> arrow key as the 
most natural choice.

I can find no way around this requirement after suppressing SIGWINCH.  Even 
with signals unrestrained that extra keystroke is sometimes required.

Part of the problem is doubtless due to the emulator, like Fedora's 
gnome-terminal.  There are internal buffers for optimization (as with top) and 
scrolling plus there is often an emulator preferred way of presenting resized 
results (unlike top).  Sometimes top's view of screen contents differs from the 
emulator's view.

Lastly, please try top with the new OFF_SIGWINCH enabled.  That will restore 
the flood of signals but it also means an extra keystroke is generally not 
necessary.  This is most visible on the Fields Management screen where 
immediate response to SIGWINCH produces some interesting effects as the window 
grows and shrinks.

You may find that with context now preserved, repeated signals and immediate 
response is preferable to that extra keystroke requirement.  If so, I can 
change the default behavior.  Just let me know which you prefer.

Regards,
Jim

ps. Use the 'reset' command before any new test for the most reliable results.


Attachment: top-sigwinch+etc.tgz
Description: Binary data


Other related posts: