MCPcopy Index your code
hub / github.com/git/git / term_clear_line

Function term_clear_line

pager.c:237–254  ·  view source on GitHub ↗

* Clear the entire line, leave cursor in first column. */

Source from the content-addressed store, hash-verified

235 * Clear the entire line, leave cursor in first column.
236 */
237void term_clear_line(void)
238{
239 if (!isatty(2))
240 return;
241 if (is_terminal_dumb())
242 /*
243 * Fall back to print a terminal width worth of space
244 * characters (hoping that the terminal is still as wide
245 * as it was upon the first call to term_columns()).
246 */
247 fprintf(stderr, "\r%*s\r", term_columns(), "");
248 else
249 /*
250 * On non-dumb terminals use an escape sequence to clear
251 * the whole line, no matter how wide the terminal.
252 */
253 fputs("\r\033[K", stderr);
254}
255
256/*
257 * How many columns do we need to show this number in decimal?

Callers 3

pick_one_commitFunction · 0.85
pick_commitsFunction · 0.85
launch_specified_editorFunction · 0.85

Calls 2

is_terminal_dumbFunction · 0.85
term_columnsFunction · 0.85

Tested by

no test coverage detected