From 47ec9264a1bc0cf1ea372c18568b7039f38f20db Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Mon, 6 Jun 2022 10:06:44 -0400 Subject: [PATCH] Better formatting fox xcatprobe output --- xCAT-probe/xcatprobe | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/xCAT-probe/xcatprobe b/xCAT-probe/xcatprobe index a686a3251..4116164a4 100755 --- a/xCAT-probe/xcatprobe +++ b/xCAT-probe/xcatprobe @@ -100,7 +100,10 @@ sub format_cmd_output { $msg =~ s/\t/ /g; my $flaglen = 6; my $desiredwidth = 120; - my $screenwidth = (`tput cols` + 0); + my $screenwidth = 80; + if ($ENV{'TERM'}) { + $screenwidth = (`tput cols` + 0); + } my $maxlen = ($screenwidth > $desiredwidth ? $desiredwidth : $screenwidth); my @finalmsg = (); @@ -194,7 +197,10 @@ sub listvalidsubcmd { $maxlen += 4; my $desiredwidth = 120; - my $screenwidth = (`tput cols` + 0); + my $screenwidth = 80; + if ($ENV{'TERM'}) { + $screenwidth = (`tput cols` + 0); + } my $finallen = ($screenwidth > $desiredwidth ? $desiredwidth : $screenwidth); print "Supported sub commands are:\n";