On Sun, 15 Feb 2015 17:50:19 +0100 k...@shike2.com wrote: > You can trust the value of COLUMNS. I think this is the correct way > programs must detect the size of the terminal.
The stress is _portably_. Quoting ioctl(2) manpage: CONFORMING TO No single standard. Arguments, returns, and semantics of ioctl() vary according to the device driver in question (the call is used as a catch-all for operations that don't cleanly fit the UNIX stream I/O model). See ioctl_list(2) for a list of many of the known ioctl() calls. The ioctl() function call appeared in Version 7 AT&T UNIX. The ioctl() can be assumed to be present on all systems, but in case TIOCGWINSZ doesn't exist, we fall back to the fixed value. This is the best of both worlds. Cheers FRIGN -- FRIGN <d...@frign.de>