Merge pull request #1473 from zdave/query-term-stdout

Query terminal width from STDOUT_FILENO