On 04/01/2023 02:26, Chris Angelico wrote:
Reading/writing the FD is the same as using stdout (technically you'd
write to fd 1 and read from fd 0), but yes, can use /dev/tty to reach
for the console directly.

I think the logic is more like checking that stdin is a tty then using
the tty it to read and write the tty. This works with stdout redirected.
Also stdin is likely only open with read access.

For example the way to prevent ssh-add from prompting in the terminal is this:

$ ssh-add ~/.ssh/id_rsa </dev/null

It will then use the SSH_ASKPASS program.

Barry



--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to