mirror of
https://github.com/reactos/ninja.git
synced 2024-11-30 23:20:40 +00:00
Query terminal width from STDOUT_FILENO
Rather than 0 (stdin). So it will work even if ninja's stdin isn't connected to the terminal for whatever reason.
This commit is contained in:
parent
ca041d88f4
commit
f56a832844
@ -82,7 +82,7 @@ void LinePrinter::Print(string to_print, LineType type) {
|
||||
// Limit output to width of the terminal if provided so we don't cause
|
||||
// line-wrapping.
|
||||
winsize size;
|
||||
if ((ioctl(0, TIOCGWINSZ, &size) == 0) && size.ws_col) {
|
||||
if ((ioctl(STDOUT_FILENO, TIOCGWINSZ, &size) == 0) && size.ws_col) {
|
||||
to_print = ElideMiddle(to_print, size.ws_col);
|
||||
}
|
||||
printf("%s", to_print.c_str());
|
||||
|
Loading…
Reference in New Issue
Block a user