From 163182c858e35ca52c8f1106da7f43e6aee631a5 Mon Sep 17 00:00:00 2001 From: James Conroy Date: Wed, 9 Feb 2022 19:31:31 -0600 Subject: [PATCH] Don't set the padding constant if not in a tty This will preserve the original width from before my changes --- salt/common/tools/sbin/so-status | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/salt/common/tools/sbin/so-status b/salt/common/tools/sbin/so-status index 4e4331321..fe353e126 100755 --- a/salt/common/tools/sbin/so-status +++ b/salt/common/tools/sbin/so-status @@ -170,19 +170,19 @@ parse_status() { # {% raw %} print_line() { - is_tty local service_name="${1}" local service_state="" ; service_state="$( parse_status "${1}" "${2}" )" # XXX: What will we do if tput isn't avalable? local line="" + local PADDING_CONSTANT="" local columns=35 # value used if not printing to a tty - local PADDING_CONSTANT=16 # two tabs wide if (( __tty == 1 )); then local NC; NC="$(tput sgr0)" # no color local red; red="$(tput setaf 1 bold)" local green; green="$(tput setaf 2 bold)" local yellow; yellow="$(tput setaf 3 bold)" + PADDING_CONSTANT=16 # two tabs wide columns=$(tput cols) fi