Command line and full screen utilities for browsing procfs, a "pseudo" file system dynamically generated by Linux to provide information about the status of entries in its process table.
Go to file
Jim Warner 0fe393ff27 top: inoculated against a window manager like 'screen'
If top were invoked under the 'screen' window manager,
writing the terminfo string 'exit_ca_mode' at top exit
would not restore the display to the state existing at
the time top was started. That's what occurs normally.
The net result of that failure was a corrupted screen.

However, there is a 'screen' configuration option that
will produce proper 'rmcup' behavior, but it is off by
default. That screencr option is known as 'altscreen'.
I stumbled across this provision by cloning the screen
git repository then searching for references to 'cup'.

If 'altscreen on' had been in either the /etc/screenrc
or the $HOME/.screenrc configuration file, my poor old
top would never have been accused of such corruptions.
Of course, the Programming Gods decree that any simple
solution for our problem must always be revealed last.

So before discovering that rc option, another approach
was taken involving top only. With just a little extra
refactoring of top display logic he was made immune to
any such quirk in the implementation of 'smcup/rmcup'.

I always feel good about any enhancement that actually
reduces the total number of lines of code. Even though
this change involved mostly rearranging some logic, it
yielded one less line (can't judge by diffstat because
of braces & notes). Anyway, rather than requiring some
change to a screenrc file, now we are self-sufficient.

Reference(s):
  procps ---------------------------------------------
https://bugzilla.redhat.com/show_bug.cgi?id=962022
http://www.freelists.org/post/procps/top-procpsng337-no-screen-cleaning-at-exit,3
. top : disable tty scrollback buffer to improve SIGWINCH
commit dedaf6e1a8
  screen ---------------------------------------------
git://git.sv.gnu.org/screen.git
. Improve cursor store/restore on smcup/rmcup.
commit f95352946080be803b794c9f2733d8c809c1a39a
. Fix using alternate screen buffers in some cases.
commit ad56f746c6243d45124485d198d577bdbb78071c
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=558724

Signed-off-by: Jim Warner <james.warner@comcast.net>
2013-05-22 14:55:40 +02:00
contrib miscellaneous: clean up trailing whitespace once again 2013-04-07 18:05:01 +10:00
Documentation miscellaneous: fixed current misspell-check's findings 2013-03-14 12:36:47 +01:00
include configure: Check for error.h 2013-03-20 16:32:06 +01:00
lib configure: Check for error.h 2013-03-20 16:32:06 +01:00
misc
po
proc Fix btime handling reading from /proc/stat 2013-05-12 07:17:07 +10:00
ps ps: possibility to display seat for a process 2013-04-24 09:24:44 +02:00
testsuite Improved regexp test for pmap 2013-04-07 18:31:26 +10:00
top top: inoculated against a window manager like 'screen' 2013-05-22 14:55:40 +02:00
.gitignore Added pmap -X and -XX tests 2012-12-24 10:05:24 +11:00
AUTHORS
autogen.sh
ChangeLog
configure.ac top: provide a build option to change memory precision 2013-05-19 09:40:42 +10:00
COPYING
COPYING.LIB miscellaneous: clean up trailing whitespace once again 2013-04-07 18:05:01 +10:00
free.1 miscellaneous: clean up trailing whitespace throughout 2013-03-14 12:36:47 +01:00
free.c configure: check for program_invocation_name 2013-03-20 16:32:06 +01:00
kill.1 docs: fix manual page warnings 2012-04-16 12:55:53 +02:00
Makefile.am
NEWS top: inoculated against a window manager like 'screen' 2013-05-22 14:55:40 +02:00
pgrep.1 support for listing thread ids (useful with iotop) 2013-03-18 11:58:47 +01:00
pgrep.c miscellaneous: clean up trailing whitespace once again 2013-04-07 18:05:01 +10:00
pkill.1
pmap.1
pmap.c Merge commit 'refs/merge-requests/10' of git://gitorious.org/procps/procps into merge-requests/10 2013-04-07 17:58:06 +10:00
pwdx.1
pwdx.c configure: check for program_invocation_name 2013-03-20 16:32:06 +01:00
README
skill.1
skill.c configure: check for program_invocation_name 2013-03-20 16:32:06 +01:00
slabtop.1 miscellaneous: clean up trailing whitespace throughout 2013-03-14 12:36:47 +01:00
slabtop.c miscellaneous: clean up trailing whitespace once again 2013-04-07 18:05:01 +10:00
snice.1
sysctl.8 miscellaneous: clean up trailing whitespace throughout 2013-03-14 12:36:47 +01:00
sysctl.c Merge commit 'refs/merge-requests/10' of git://gitorious.org/procps/procps into merge-requests/10 2013-04-07 17:58:06 +10:00
sysctl.conf
sysctl.conf.5
tload.1
tload.c miscellaneous: clean up trailing whitespace once again 2013-04-07 18:05:01 +10:00
uptime.1 uptime: add since option 2012-12-26 23:14:09 +11:00
uptime.c configure: check for program_invocation_name 2013-03-20 16:32:06 +01:00
vmstat.8
vmstat.c configure: check for program_invocation_name 2013-03-20 16:32:06 +01:00
w.1
w.c miscellaneous: clean up trailing whitespace once again 2013-04-07 18:05:01 +10:00
watch.1
watch.c watch: Remove unused header 2013-03-20 16:32:06 +01:00

COMPATIBILITY

    This code is intended for use with Linux 2.6.xx, 3.x and
    hopefully all future kernels.

INSTALLATION

    If you are using git version of the project you need extra step.

    ./autogen.sh

    After that, and everyone using .tar.xz version of procps-ng, can
    do normal build.  Read './configure --help' to select options for
    your needs.

    ./configure
    make
    make install

    If you have DejaGNU installed you can run optional test suite.

    make check

HOW TO CONTRIBUTE

    See Documentation/BUGS file.

PACKAGING

    If you are a downstream maintainer (packager) for a Linux
    distribution, please avoid causing troubles.  This section
    applies to you.

    Avoid maintaining distribution specific patches.  Send your
    patches to upstream, where they are at least reviewed, if not
    included.

    Please forward bug reports. If your bug database is public and
    busy enough to bother with, please make this known.  Follow
    Debian's lead in making the bug database easy to comment on via
    email without need for an account.

    For normal packages, ensure that you do not add debugging flags
    to the CFLAGS variable.

UPSTREAM & BUG REPORTS

    procps-ng <procps@freelists.org>