If you're looking for OS interaction POSIX is (usually, most of the time :) your friend . . .
$ perl -MPOSIX=ttyname -le 'print "I am on tty ", ttyname(STDIN);' I am on tty /dev/pts/34 $ tty /dev/pts/34
The cake is a lie.
The cake is a lie.
The cake is a lie.
In reply to Re: Detecting the current terminal
by Fletch
in thread Detecting the current terminal
by iphony
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |