Possible bug in top or tmux?

Just wanted to do a sanity check with you people on what I think might be a bug either in the "top" or in the "tmux" package.

My system is FreeBSD 14.2-rc2

The "top" manual says:

Code:
     -d count
             Show only count displays, then exit.  A display is considered to
             be one update of the screen.  The default is 1 for dumb
             terminals.  Note that for count = 1 no information is available
             about the percentage of time spent by the CPU in every state.

This works as expected in the console, "top -d1" shows one page of output, but it doesn't show anything when using tmux.
Generally, with tmux, there seems to be 1 less page of output, i.e. "top -d2" shows it once, "top -d3" shows it twice, etc.

It doesn't seem to matter if I'm on the system console or a terminal emulator like foot.

Should I file a bug?
 
This works as expected in the console, "top -d1" shows one page of output, but it doesn't show anything when using tmux.
Generally, with tmux, there seems to be 1 less page of output, i.e. "top -d2" shows it once, "top -d3" shows it twice, etc.

It doesn't seem to matter if I'm on the system console or a terminal emulator like foot.

Should I file a bug?
This looks like a termcap issue, not a bug.

When not set specifically, the terminal description (see /usr/share/misc/termcap) in a tmux session is set to "tmux-256color".

I suspect "tmux-256color" clears the screen after top -d1 for the first page, no output is visible, but -d2+ shows following pages. Similar can be observed when using man pages. After quitting man, the screen is cleared, no last page view of the manual page remains.

Try this, run following commands in the login shells terminal:
Code:
% tmux

% echo $TERM
tmux-256color

% export TERM=xterm-256color
[1]

% echo $TERM
xterm-256color

% top -d1

[1] on tcsh/csh like shells: setenv TERM xterm-256color
To make "xterm-256color" permanently, set it in the tmux configuration file or login shells configuration (startup) file.

I haven't looked at /usr/share/misc/termcap which terminal description of "tmux-256color" causes the issue.
 
Back
Top