Skip to content

Commit b8eecaf

Browse files
Miklos Vajnaspearce
authored andcommitted
test-lib: fix color reset in say_color()
When executing a single test with colors enabled, the cursor was not set back to the previous one, and you had to hit an extra enter to get it back. Work around this problem by calling 'tput sgr0' before printing the final newline. Signed-off-by: Miklos Vajna <[email protected]> Signed-off-by: Shawn O. Pearce <[email protected]>
1 parent 838cd34 commit b8eecaf

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

t/test-lib.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,9 @@ if test -n "$color"; then
112112
*) test -n "$quiet" && return;;
113113
esac
114114
shift
115-
echo "* $*"
115+
printf "* $*"
116116
tput sgr0
117+
echo
117118
)
118119
}
119120
else

0 commit comments

Comments
 (0)