{"thread":{"id":"15845","subject":"[PATCH] test-lib: fix color reset in say_color()","startedAt":"2008-10-09T22:07:10Z","lastAt":"2008-10-11T02:00:48Z","messageCount":3,"participants":["Miklos Vajna","Jakub Narebski","Jeff King"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"92715","messageId":"1223590030-7464-1-git-send-email-vmiklos@frugalware.org","threadId":"15845","inReplyTo":null,"subject":"[PATCH] test-lib: fix color reset in say_color()","fromName":"Miklos Vajna","fromEmail":"vmiklos@frugalware.org","sentAt":"2008-10-09T22:07:10Z","receivedAt":"2008-10-09T22:07:10Z","isPatch":true,"sender":{"key":"vmiklos@frugalware.org","avatar":"https://gravatar.com/avatar/401c1cbbb3a5d13e650c691a2c71d6fd0b80df1a01bc74d9f1972675dd58f2bd?d=mp&s=160"},"body":"When executing a single test with colors enabled, the cursor was not set\nback to the previous one, and you had to hit an extra enter to get it\nback.\n\nWork around this problem by calling 'tput sgr0' before printing the\nfinal newline.\n\nSigned-off-by: Miklos Vajna <vmiklos@frugalware.org>\n---\n\nActually I'm not 100% sure about how many users are affected. I have a\nblack background in konsole with white letters, and after the test I get\na green cursor, and once I hit enter, I get the white one back.\n\n t/test-lib.sh |    3 ++-\n 1 files changed, 2 insertions(+), 1 deletions(-)\n\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex e2b106c..fb89741 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -112,8 +112,9 @@ if test -n \"$color\"; then\n \t\t\t*) test -n \"$quiet\" && return;;\n \t\tesac\n \t\tshift\n-\t\techo \"* $*\"\n+\t\tprintf \"* $*\"\n \t\ttput sgr0\n+\t\techo\n \t\t)\n \t}\n else\n-- \n1.6.0.2\n"},{"id":"92738","messageId":"m33aj4lrvs.fsf@localhost.localdomain","threadId":"15845","inReplyTo":"1223590030-7464-1-git-send-email-vmiklos@frugalware.org","subject":"Re: [PATCH] test-lib: fix color reset in say_color()","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2008-10-10T09:30:06Z","receivedAt":"2008-10-10T09:30:06Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Miklos Vajna <vmiklos@frugalware.org> writes:\n\n> When executing a single test with colors enabled, the cursor was not set\n> back to the previous one, and you had to hit an extra enter to get it\n> back.\n> \n> Work around this problem by calling 'tput sgr0' before printing the\n> final newline.\n> \n> Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>\n> ---\n> \n> Actually I'm not 100% sure about how many users are affected. I have a\n> black background in konsole with white letters, and after the test I get\n> a green cursor, and once I hit enter, I get the white one back.\n\nI also had this very minor irritation that cursor retained color\nof last line till enter (or IIRC any key which moved cursor). I use\nordinary xterm from X.Org 6.8.2(213).\n\n-- \nJakub Narebski\nPoland\nShadeHawk on #git\n"},{"id":"92781","messageId":"20081011020048.GA29328@coredump.intra.peff.net","threadId":"15845","inReplyTo":"1223590030-7464-1-git-send-email-vmiklos@frugalware.org","subject":"Re: [PATCH] test-lib: fix color reset in say_color()","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2008-10-11T02:00:48Z","receivedAt":"2008-10-11T02:00:48Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, Oct 10, 2008 at 12:07:10AM +0200, Miklos Vajna wrote:\n\n> Actually I'm not 100% sure about how many users are affected. I have a\n> black background in konsole with white letters, and after the test I get\n> a green cursor, and once I hit enter, I get the white one back.\n\nI think my comment is way late, as this has already been applied, but I\nthink this is definitely the right thing to do. We are very careful to\nuse the same pattern (color reset before newline) in the C code.\n\n-Peff\n"}]}