mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-05 23:51:29 +02:00
Better build system output when stdout is not a tty
When piping the output of `setup.py` to another program, that program cannot usually deal with escape sequences well. To fix this, output the compilation progress on new lines instead of overwriting the current line.
This commit is contained in:
4
setup.py
4
setup.py
@@ -485,8 +485,10 @@ def parallel_run(items: List[Command]) -> None:
|
||||
num += 1
|
||||
if verbose:
|
||||
print(' '.join(compile_cmd.cmd))
|
||||
else:
|
||||
elif sys.stdout.isatty():
|
||||
print('\r\x1b[K[{}/{}] {}'.format(num, total, compile_cmd.desc), end='')
|
||||
else:
|
||||
print('[{}/{}] {}'.format(num, total, compile_cmd.desc), flush=True)
|
||||
printed = True
|
||||
w = subprocess.Popen(compile_cmd.cmd, stdout=subprocess.DEVNULL, stderr=subprocess.STDOUT)
|
||||
workers[w.pid] = compile_cmd, w
|
||||
|
||||
Reference in New Issue
Block a user