or download this
If there is a TTY, we have to determine who it belongs to before we ca
+n proceed. If this is a slave editor or graphical debugger (denoted b
+y the first command-line switch being '-emacs'), we shift this off an
+d set $rl to 0 (XXX ostensibly to do straight reads).
...
AmigaOS - use CONSOLE:.
VMS - use sys$command.
Unix - use /dev/tty.