* [PATCH] test-lib: fix color reset in say_color()
@ 2008-10-09 22:07 Miklos Vajna
2008-10-10 9:30 ` Jakub Narebski
2008-10-11 2:00 ` Jeff King
0 siblings, 2 replies; 3+ messages in thread
From: Miklos Vajna @ 2008-10-09 22:07 UTC (permalink / raw)
To: git
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>
---
Actually I'm not 100% sure about how many users are affected. I have a
black background in konsole with white letters, and after the test I get
a green cursor, and once I hit enter, I get the white one back.
t/test-lib.sh | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/t/test-lib.sh b/t/test-lib.sh
index e2b106c..fb89741 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -112,8 +112,9 @@ if test -n "$color"; then
*) test -n "$quiet" && return;;
esac
shift
- echo "* $*"
+ printf "* $*"
tput sgr0
+ echo
)
}
else
--
1.6.0.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] test-lib: fix color reset in say_color()
2008-10-09 22:07 [PATCH] test-lib: fix color reset in say_color() Miklos Vajna
@ 2008-10-10 9:30 ` Jakub Narebski
2008-10-11 2:00 ` Jeff King
1 sibling, 0 replies; 3+ messages in thread
From: Jakub Narebski @ 2008-10-10 9:30 UTC (permalink / raw)
To: Miklos Vajna; +Cc: git
Miklos Vajna <vmiklos@frugalware.org> writes:
> 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>
> ---
>
> Actually I'm not 100% sure about how many users are affected. I have a
> black background in konsole with white letters, and after the test I get
> a green cursor, and once I hit enter, I get the white one back.
I also had this very minor irritation that cursor retained color
of last line till enter (or IIRC any key which moved cursor). I use
ordinary xterm from X.Org 6.8.2(213).
--
Jakub Narebski
Poland
ShadeHawk on #git
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] test-lib: fix color reset in say_color()
2008-10-09 22:07 [PATCH] test-lib: fix color reset in say_color() Miklos Vajna
2008-10-10 9:30 ` Jakub Narebski
@ 2008-10-11 2:00 ` Jeff King
1 sibling, 0 replies; 3+ messages in thread
From: Jeff King @ 2008-10-11 2:00 UTC (permalink / raw)
To: Miklos Vajna; +Cc: git
On Fri, Oct 10, 2008 at 12:07:10AM +0200, Miklos Vajna wrote:
> Actually I'm not 100% sure about how many users are affected. I have a
> black background in konsole with white letters, and after the test I get
> a green cursor, and once I hit enter, I get the white one back.
I think my comment is way late, as this has already been applied, but I
think this is definitely the right thing to do. We are very careful to
use the same pattern (color reset before newline) in the C code.
-Peff
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-10-11 2:02 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-09 22:07 [PATCH] test-lib: fix color reset in say_color() Miklos Vajna
2008-10-10 9:30 ` Jakub Narebski
2008-10-11 2:00 ` Jeff King
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).