Fixed a problem that output of top command are not displayed on dumb terminal or terminal where TERM is not defined.
Details
Details
Add the following settings.
/etc/ttys:
nmdm0B "/usr/libexec/getty 3wire" dumb on secure
/etc/remote:
dumb:dv=/dev/nmdm0A:br#9600:pa=none:
Do the following operation to prepare a dumb terminal.
sudo kldload nmdm sudo kill -HUP 1 sudo tip dumb …login process… unset TERM (or unsetenv TERM)
top(1) before applying patch:
# top last pid: 2402; load averages: 0.23, 0.20, 0.20 up 0+01:44:43 19:03:34 36 processes: 1 running, 35 sleeping CPU: 0.1% user, 0.0% nice, 0.2% system, 0.1% interrupt, 99.7% idle Mem: 21M Active, 6032K Inact, 191M Wired, 138M Buf, 1735M Free Swap: 1024M Total, 1024M Free #
# top -a last pid: 2403; load averages: 0.28, 0.22, 0.21 up 0+01:45:26 19:04:17 36 processes: 1 running, 35 sleeping CPU: 0.1% user, 0.0% nice, 0.2% system, 0.1% interrupt, 99.7% idle Mem: 21M Active, 6036K Inact, 191M Wired, 138M Buf, 1735M Free Swap: 1024M Total, 1024M Free #
top(1) after applying patch:
# /usr/obj/usr/src/amd64.amd64/usr.bin/top/top last pid: 2406; load averages: 0.16, 0.19, 0.20 up 0+01:46:21 19:05:12 36 processes: 1 running, 35 sleeping CPU: 0.1% user, 0.0% nice, 0.2% system, 0.1% interrupt, 99.7% idle Mem: 21M Active, 6036K Inact, 191M Wired, 138M Buf, 1734M Free Swap: 1024M Total, 1024M Free PID USERNAME THR PRI NICE SIZE RES STATE C TIME WCPU COMMAND 729 daichi 1 20 0 18M 8048K select 0 0:02 0.00% sshd 361 root 1 20 0 10M 1516K select 0 0:01 0.00% devd 1254 daichi 1 20 0 18M 8040K select 1 0:00 0.00% sshd 432 root 1 20 0 11M 2724K select 1 0:00 0.00% syslogd 754 root 1 20 0 13M 4336K ttyin 1 0:00 0.00% csh 813 daichi 1 20 0 18M 8040K select 0 0:00 0.00% sshd 1369 root 1 20 0 12M 3200K wait 0 0:00 0.00% sh 1716 daichi 1 20 0 18M 8164K select 0 0:00 0.00% sshd 818 root 1 20 0 13M 4184K ttyin 0 0:00 0.00% csh 1264 root 1 20 0 11M 2444K ttyin 1 0:00 0.00% tip 1265 root 1 20 0 11M 2432K ttyin 1 0:00 0.00% tip 1717 daichi 1 20 0 12M 3376K ttyin 0 0:00 0.00% sh 628 root 1 20 0 11M 2720K nanslp 0 0:00 0.00% cron 1259 root 1 20 0 13M 4204K pause 1 0:00 0.00% csh 726 root 1 21 0 18M 8024K select 1 0:00 0.00% sshd 730 daichi 1 20 0 12M 3184K wait 0 0:00 0.00% sh 810 root 1 22 0 18M 8024K select 1 0:00 0.00% sshd 1251 root 1 21 0 18M 8024K select 1 0:00 0.00% sshd #
# /usr/obj/usr/src/amd64.amd64/usr.bin/top/top -a last pid: 2407; load averages: 0.20, 0.20, 0.20 up 0+01:46:40 19:05:31 36 processes: 1 running, 35 sleeping CPU: 0.1% user, 0.0% nice, 0.2% system, 0.1% interrupt, 99.7% idle Mem: 21M Active, 6036K Inact, 191M Wired, 138M Buf, 1734M Free Swap: 1024M Total, 1024M Free PID USERNAME THR PRI NICE SIZE RES STATE C TIME WCPU COMMAND 729 daichi 1 20 0 18M 8048K select 0 0:02 0.00% sshd: da 361 root 1 20 0 10M 1516K select 0 0:01 0.00% /sbin/de 1254 daichi 1 20 0 18M 8040K select 0 0:00 0.00% sshd: da 432 root 1 20 0 11M 2724K select 1 0:00 0.00% /usr/sbi 754 root 1 20 0 13M 4336K ttyin 1 0:00 0.00% -su (csh 813 daichi 1 20 0 18M 8040K select 0 0:00 0.00% sshd: da 1369 root 1 20 0 12M 3200K wait 1 0:00 0.00% -sh (sh) 1716 daichi 1 20 0 18M 8164K select 1 0:00 0.00% sshd: da 818 root 1 20 0 13M 4184K ttyin 0 0:00 0.00% -su (csh 1264 root 1 20 0 11M 2444K ttyin 1 0:00 0.00% tip dumb 1265 root 1 20 0 11M 2432K ttyin 0 0:00 0.00% tip dumb 1717 daichi 1 20 0 12M 3376K ttyin 0 0:00 0.00% -sh (sh) 628 root 1 20 0 11M 2720K nanslp 0 0:00 0.00% /usr/sbi 1259 root 1 20 0 13M 4204K pause 1 0:00 0.00% -su (csh 726 root 1 21 0 18M 8024K select 1 0:00 0.00% sshd: da 730 daichi 1 20 0 12M 3184K wait 0 0:00 0.00% -sh (sh) 810 root 1 22 0 18M 8024K select 1 0:00 0.00% sshd: da 1251 root 1 21 0 18M 8024K select 1 0:00 0.00% sshd: da #
Diff Detail
Diff Detail
- Lint
Lint Skipped - Unit
Tests Skipped
Event Timeline
usr.bin/top/screen.c | ||
---|---|---|
129 | If the dumb terminal screen width is always 79, why not define it as 79 instead of using a -1 ? |