Skip to content

Commit

Permalink
test-lib: fix color reset in say_color()
Browse files Browse the repository at this point in the history
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 <vmiklos@frugalware.org>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
  • Loading branch information
Miklos Vajna authored and Shawn O. Pearce committed Oct 10, 2008
1 parent 838cd34 commit b8eecaf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion t/test-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,9 @@ if test -n "$color"; then
*) test -n "$quiet" && return;;
esac
shift
echo "* $*"
printf "* $*"
tput sgr0
echo
)
}
else
Expand Down

0 comments on commit b8eecaf

Please sign in to comment.