> Don't you already need this logic, getenv(3) + isatty(3), to decide if > you use a pager or not? Although I don't understand why getenv(3) is > needed, isn't a TIOCGWINSZ ioctl(2) enough?.
Because there is a defacto standard that some SVR2 environment (before the ioctl) be honoured by many programs. Few comments: Scripts can tweak them to create output for a specific layout. They allow adjustment on non-tty circumstance. The priority of getenv vs tty layout vs default isn't precisely specified anywhere, and is a mess I wish someone would study and try to cleanup. During pledge development, this stuff stuff in the way, it was quite interesting - I spent the entire Exeter hackathon on it.