-
Notifications
You must be signed in to change notification settings - Fork 212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tput error inside Docker #134
Comments
Can you try with the latest version from HEAD, and report back whether this error still appears? |
@kward Sure I'll try to test this out and get back to you |
Hi @kward ! It's because I am going to craft a patch for this, can you also have a look ? |
Edit: tput exists but it says |
See: https://opensource.apple.com/source/ncurses/ncurses-7/ncurses/progs/tput.c.auto.html I did some debug echo "colors 1: $(${SHUNIT_CMD_TPUT} colors)"
echo "colors 2: $(${SHUNIT_CMD_TPUT} colors 2>/dev/null)"
if command [ $? -eq 0 ]; then
echo "c: $?"
else
echo "cc: 16"
fi
${SHUNIT_CMD_TPUT} colors 2>/dev/null
echo "c: $?"
${SHUNIT_CMD_TPUT} colors
echo "c: $?"
The fix: From: William Desportes <[email protected]>
Date: Mon, 28 Nov 2022 15:42:19 +0100
Subject: Fix error with tput when $TERM is not set
Origin: vendor
Forwarded: https://github.com/kward/shunit2/issues/134
---
shunit2 | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/shunit2 b/shunit2
index 6239683..b9b4603 100755
--- a/shunit2
+++ b/shunit2
@@ -1027,6 +1027,12 @@ _shunit_configureColor() {
# colors returns the number of supported colors for the TERM.
_shunit_colors() {
+ # Avoid: tput: No value for $TERM and no -T specified
+ if command [ -z "${TERM:-}" ]; then
+ echo 16
+ return
+ fi
+
_shunit_tput_=`${SHUNIT_CMD_TPUT} colors 2>/dev/null`
if command [ $? -eq 0 ]; then
echo "${_shunit_tput_}"
|
Hi, I'm seeing this error pop up inside Docker images using shunit2 for unit tests:
It seems like this issue has popped up for CI tests previously, as reported in #86 and #88.
This post also seems to be relevant.
I'm trying to set
ARG TERM=xterm-256color
inside my Dockerfile to see if this fixes the issue and will report back.Any advice or ideas on how to handle this issue? Thanks!
The text was updated successfully, but these errors were encountered: