[issue35060] subprocess output seems to depend on size of terminal screen

Edward Pratt report at bugs.python.org
Wed Oct 24 14:46:00 EDT 2018


Edward Pratt <epratt8181 at gmail.com> added the comment:

I don’t think that is true. I tried grepping for what I need in a very small terminal and still got the correct result.

> On Oct 24, 2018, at 1:40 PM, Eryk Sun <report at bugs.python.org> wrote:
> 
> 
> Eryk Sun <eryksun at gmail.com> added the comment:
> 
> This is due to the ps command itself. You'd have the same problem when piping to grep or redirecting output to a file. I don't know how it determines terminal size. I tried overriding stdin, stdout and stderr to pipes and calling setsid() in the forked child process to detach from the controlling terminal, but it still detected the terminal size. Anyway, the "ww" option of ps overrides this behavior.
> 
> ----------
> nosy: +eryksun
> resolution:  -> third party
> stage:  -> resolved
> status: open -> closed
> 
> _______________________________________
> Python tracker <report at bugs.python.org>
> <https://bugs.python.org/issue35060>
> _______________________________________

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35060>
_______________________________________


More information about the Python-bugs-list mailing list