From fb804b9d7a7e0d908c8dd07570078045ee1873e3 Mon Sep 17 00:00:00 2001 From: RedLeaderOne Date: Fri, 10 May 2024 13:23:40 -0400 Subject: [PATCH] fix: explicitly set terminal tput COLUMNS width [NMO-546] --- src/function_library/prompt_utilities.bash | 14 ++++++++------ .../Dockerfile.bats-core-code-isolation.ubuntu | 3 ++- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/function_library/prompt_utilities.bash b/src/function_library/prompt_utilities.bash index dda34d7..15e2a13 100644 --- a/src/function_library/prompt_utilities.bash +++ b/src/function_library/prompt_utilities.bash @@ -137,16 +137,12 @@ function n2st::draw_horizontal_line_across_the_terminal_window() { # Ref https://bash.cyberciti.biz/guide/$TERM_variable TPUT_FLAG="-T $TERM" - - # (CRITICAL) ToDo: on task end >> delete next bloc ↓↓ - printenv - echo -e "Original TERM=${TERM}" - if [[ -z ${TERM} ]]; then TPUT_FLAG='-T xterm-256color' elif [[ ${TERM} == dumb ]]; then # "dumb" is the one set on TeamCity Agent - TPUT_FLAG='-T xterm-256color' +# TPUT_FLAG='-T xterm-256color' + unset TPUT_FLAG fi # (NICE TO HAVE) ToDo: @@ -161,6 +157,12 @@ function n2st::draw_horizontal_line_across_the_terminal_window() { terminal_width="${COLUMNS:-$(tput ${TPUT_FLAG} cols)}" pad=$(printf -- "${SYMBOL}%.0s" $(seq $terminal_width)) printf -- "${pad}\n" + +# # (CRITICAL) ToDo: on task end >> delete next bloc ↓↓ +# echo "terminal_width=${terminal_width}" +# echo "seq $terminal_width = $(seq $terminal_width)" +# echo "$SHELL" +# ps -p $$ } # ================================================================================================= diff --git a/tests/bats_testing_tools/Dockerfile.bats-core-code-isolation.ubuntu b/tests/bats_testing_tools/Dockerfile.bats-core-code-isolation.ubuntu index 28047ed..fa44a84 100644 --- a/tests/bats_testing_tools/Dockerfile.bats-core-code-isolation.ubuntu +++ b/tests/bats_testing_tools/Dockerfile.bats-core-code-isolation.ubuntu @@ -22,7 +22,8 @@ SHELL ["/bin/bash", "-e", "-c"] ARG DEBIAN_FRONTEND=noninteractive ENV TERM=${TERM:-"xterm-256color"} - +#RUN tput -T $TERM init +ENV COLUMNS=80 # ====Begin======================================================================================== # ....Setup timezone and localization..............................................................