Don't set the padding constant if not in a tty

This will preserve the original width from before my changes
This commit is contained in:
James Conroy
2022-02-09 19:31:31 -06:00
parent 6b4549499d
commit 163182c858

View File

@@ -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