Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Specifically when -w/--watch is specified, and the terminal is narrowed to the point where the header takes up more than one line, and there are more visible processes than are lines available on the screen, only the bottommost header line is displayed (at least on the terminal emulator "Terminal" on Debian). This is because the number of visible processes scrolls the view window and cuts off upper lines (I discovered this by using tmux's scrollback buffer to investigate what was above the confines of the regular screen). Such behavior can be seen with the output of
procs -w
on a 24x80 terminal:This off-by-one error also causes the scrollback to get polluted with duplicate header lines, although this is simply annoying rather than detrimental (again running
procs -w
, just scrolling up a few lines):This PR changes
Watcher::display_header
to returnResult<usize, Error>
where theOk
variant has the number of lines the header takes up, so that the the (new)header_lines
parameter ofView::filter
can be populated. It also changesView::filter
to break a bit earlier according to how many lines were taken up by the header, so as to prevent the two behaviors identified above.