top: avoid potential xterm state corruption
authorJim Warner <james.warner@comcast.net>
Mon, 1 Oct 2012 15:00:00 +0000 (10:00 -0500)
committerCraig Small <csmall@enc.com.au>
Thu, 11 Oct 2012 10:10:44 +0000 (21:10 +1100)
commitedd8aae5bafaeb7c43c1733873cda614ec2cb0c9
treeabdfd93aac01ae9ea5e3fa563d93abaad14f4b61
parentbb6cc9c15927981b874bc7cec1ff46bfa8300271
top: avoid potential xterm state corruption

To support the cursor navigation keys, after saving
the termios structure top issues 'smkx/keypad_xmit'
during startup.  However, some terminals appear to
treat that directive as persistent which leaves a
corrupted tty state after top exit.

This commit reverses the above terminal directive
via 'rmkx/keypad_local' just prior to restoring the
saved termios structure at program end.

For discovering this bug, and providing the 'rmkx'
clue to its solution, thanks to:
  Kirill A. Shutemov <kirill@shutemov.name>

Signed-off-by: Jim Warner <james.warner@comcast.net>
top/top.c