Zbyszek Szmek <zbys...@in.waw.pl> added the comment: > Using strace, I see that stty calls ioctl(TIOCGWINSZ) on stdin (fd=0) > if it failed on stdout (fd=1), whereas Python only tries stdout. It was done this way by design. Maybe checking stdin can be also useful, but it is a rather big change in semantics. I think it should be a separate bug.
It is pretty common for programs to behave differently when run through pipe, even if stdin is on a tty. stty is rather the exception than the rule. E.g. almost all programs disable color when piped explicitly through less. 'dpkg | cat' ignores terminal width. So does git and ls. stty is special, because the only purpose of that program is to query terminal size, but it cannot be taken as a model for the behaviour of a general purpose program. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue13609> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com