commit: 9c3da406f53faf3098932ce61edede414c6aef2a
Author: Kerin Millar <kfm <AT> plushkava <DOT> net>
AuthorDate: Sun Jun 9 06:06:43 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Jun 12 07:06:42 2024 +0000
URL:
https://gitweb.gentoo.org/proj/gentoo-functions.git/commit/?id=9c3da406
Have _eend() assume 80 columns in the absence of a smart terminal
In cases where the value of genfun_tty is lower than 2, it is implied
that the standard output refers either to a terminal insufficiently
capable of handling ECMA-48 CSI sequences or to a resource that is not a
terminal. Use <space> characters to indent the indicator to the extent
that the last character falls on the 80th column. Previously, the
indicator was indented by only one <space>.
Signed-off-by: Kerin Millar <kfm <AT> plushkava.net>
functions.sh | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/functions.sh b/functions.sh
index 409d424..fcba801 100644
--- a/functions.sh
+++ b/functions.sh
@@ -818,9 +818,12 @@ _eend()
col=$(( genfun_cols > 6 ? genfun_cols - 6 : 1 ))
printf '\0337\033[1A\033[%dG %s\0338' "$(( col + genfun_offset
))" "${msg}"
else
- # The standard output does not refer to a sufficiently capable
- # terminal. Print only the indicator.
- printf ' %s\n' "${msg}"
+ # The standard output refers either to an insufficiently capable
+ # terminal or to something other than a terminal. Print the
+ # indicator, using <space> characters to indent to the extent
+ # that the last character falls on the 80th column. This hinges
+ # on the fair assumption that a newline was already printed.
+ printf '%80s\n' "${msg}"
fi
return "${retval}"