]> git.ipfire.org Git - thirdparty/git.git/commit - sideband.c
recv_sideband: Do not use ANSI escape sequence on dumb terminals.
authorJohannes Sixt <johannes.sixt@telecom.at>
Tue, 8 Jan 2008 16:24:53 +0000 (17:24 +0100)
committerJunio C Hamano <gitster@pobox.com>
Wed, 9 Jan 2008 20:23:59 +0000 (12:23 -0800)
commit13e4760a1649d24519f95ae2375704738b2b219e
treeed145b7befbc0139ff539558d8d4f8b7fdc8d6e7
parentf85fd3f0d1213a2b714fddc7a834817aceeca932
recv_sideband: Do not use ANSI escape sequence on dumb terminals.

The "clear to end of line" sequence is used to nicely output the progress
indicator without leaving garbage on the terminal. However, this works
only on ANSI capable terminals. We use the same check as in color.c to
find out whether the terminal supports this feature and use a workaround
(a few spaces in a row) if it does not.

[jc: as an old fashoned git myself, and given the fact that the
possible prefix and suffix are small number of short constant strings,
I actually prefer a simpler-and-more-stupid approach.  This is with
Nico's clean-up.]

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
sideband.c