rnsh/tty_test.py
Aaron Heise ebdcb50265 Support for pipes. #3
Connects pipes on the listener child process the same way they are connected on the initiator--any combination of stdin, stdout, and stderr could be connected to a pipe. Any one of those not connected to a pipe will be connected to a pty.
2023-02-16 00:18:34 -06:00

7 lines
187 B
Python

import os
import sys
for stream in [sys.stdin, sys.stdout, sys.stderr]:
print(f"{stream.name:8s} " + ("tty" if os.isatty(stream.fileno()) else "not tty"))
print(f"args: {sys.argv}")