Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
a committed Jun 7, 2024
1 parent 18143ff commit 93422fe
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion callias.xsh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ from xonsh.built_ins import XSH


def _print_to_tty(message):
"""Print message directly to TTY."""
"""
Print message directly to TTY.
If you will try to put this function into the python file and run in bash `python file.py > /tmp/output`
you will have "Inappropriate ioctl for device" so this means that redirecting stdout disable TTY.
"""
try:
tty_name = os.ttyname(sys.stdout.fileno())
with open(tty_name, 'w') as tty:
Expand Down

0 comments on commit 93422fe

Please sign in to comment.