author | Johannes Sixt <johannes.sixt@telecom.at> | |
Tue, 8 Jan 2008 16:24:53 +0000 (17:24 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 9 Jan 2008 20:23:59 +0000 (12:23 -0800) | ||
commit | 13e4760a1649d24519f95ae2375704738b2b219e | |
tree | ed145b7befbc0139ff539558d8d4f8b7fdc8d6e7 | tree | snapshot |
parent | f85fd3f0d1213a2b714fddc7a834817aceeca932 | commit | diff |
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>
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 | diff | blob | history |