mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-14 14:55:41 +00:00
top(1): fixed the empty output problem in non-interactive mode (-n, -b) regressed in r336028
PR: 229842 Reported by: Ali Abdallah <aliovx@gmail.com> Reviewed by: eadler, cy Approved by: gnn (mentor) Differential Revision: https://reviews.freebsd.org/D16455
This commit is contained in:
parent
62c94a0551
commit
324976739f
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=336753
@ -54,6 +54,8 @@ static struct termios old_settings;
|
||||
static struct termios new_settings;
|
||||
static char is_a_terminal = false;
|
||||
|
||||
#define NON_INTERACTIVE_MODE_VIRTUAL_SCREEN_WIDTH 1024
|
||||
|
||||
void
|
||||
init_termcap(bool interactive)
|
||||
{
|
||||
@ -68,6 +70,7 @@ init_termcap(bool interactive)
|
||||
if (!interactive)
|
||||
{
|
||||
/* pretend we have a dumb terminal */
|
||||
screen_width = NON_INTERACTIVE_MODE_VIRTUAL_SCREEN_WIDTH;
|
||||
smart_terminal = false;
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user