This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author grantjenks
Recipients Arfrever, BreamoreBoy, denilsonsa, grantjenks, vstinner, zbysz
Date 2018-08-21.17:19:30
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1534871970.26.0.56676864532.issue14841@psf.upfronthosting.co.za>
In-reply-to
Content
I asked on the ncurses maintainers email list about their logic and was pointed to tty_settings.c which checks:

1. stderr
2. stdout
3. stdin
4. open('/dev/tty', 'r+')

I don't know a cross-platform way to check #4 but I think #1-3 are a reasonable change to shutil.get_terminal_size().

The current logic checks only stdout. I'd like to amend that to try stderr, stdout, and stdin after checking the COLUMNS and LINES env vars. So the new logic would be:

1. Check COLUMNS and LINES env vars (for overrides)
2. Check os.get_terminal_size(stderr)
3. Check os.get_terminal_size(stdout)
4. Check os.get_terminal_size(stdin)
History
Date User Action Args
2018-08-21 17:19:30grantjenkssetrecipients: + grantjenks, vstinner, Arfrever, zbysz, denilsonsa, BreamoreBoy
2018-08-21 17:19:30grantjenkssetmessageid: <1534871970.26.0.56676864532.issue14841@psf.upfronthosting.co.za>
2018-08-21 17:19:30grantjenkslinkissue14841 messages
2018-08-21 17:19:30grantjenkscreate