File tree Expand file tree Collapse file tree 1 file changed +6
-14
lines changed Expand file tree Collapse file tree 1 file changed +6
-14
lines changed Original file line number Diff line number Diff line change @@ -280,39 +280,31 @@ bool Process::FileDescriptorIsDisplayed(int fd) {
280
280
#endif
281
281
}
282
282
283
- static unsigned getColumns (int FileID ) {
283
+ static unsigned getColumns () {
284
284
// If COLUMNS is defined in the environment, wrap to that many columns.
285
285
if (const char *ColumnsStr = std::getenv (" COLUMNS" )) {
286
286
int Columns = std::atoi (ColumnsStr);
287
287
if (Columns > 0 )
288
288
return Columns;
289
289
}
290
290
291
- unsigned Columns = 0 ;
292
-
293
- #if defined(HAVE_SYS_IOCTL_H) && defined(HAVE_TERMIOS_H) \
294
- && !(defined (_XOPEN_SOURCE) || defined (_POSIX_C_SOURCE))
295
- // Try to determine the width of the terminal.
296
- struct winsize ws;
297
- if (ioctl (FileID, TIOCGWINSZ, &ws) == 0 )
298
- Columns = ws.ws_col ;
299
- #endif
300
-
301
- return Columns;
291
+ // We used to call ioctl TIOCGWINSZ to determine the width. It is considered
292
+ // unuseful.
293
+ return 0 ;
302
294
}
303
295
304
296
unsigned Process::StandardOutColumns () {
305
297
if (!StandardOutIsDisplayed ())
306
298
return 0 ;
307
299
308
- return getColumns (1 );
300
+ return getColumns ();
309
301
}
310
302
311
303
unsigned Process::StandardErrColumns () {
312
304
if (!StandardErrIsDisplayed ())
313
305
return 0 ;
314
306
315
- return getColumns (2 );
307
+ return getColumns ();
316
308
}
317
309
318
310
#ifdef HAVE_TERMINFO
You can’t perform that action at this time.
0 commit comments