Hmmm....I'm disappointed that I need to open another file handle and can't get the rows & columns associated with my already open FH, "STDOUT", directly...
As for using 'Term::ReadKey', I thought of using something along those lines (or a Curses func), but wanted something that was minimal overhead, as this was called every loop, and portability isn't a major consideration, considering the nature of the program this is being used in is showing linux process and mounted-dev I/O.
If I look at /proc/$$/fd/1, I see a softlink to /dev/pts/1 (i.e. a character, tty type device). Indeed, if I use your 2nd prog and substitute in "/dev/pts/1" instead of "/dev/tty", I get the same result (ie. it works).
Shouldn't STDIN, STDOUT map to fd[0], fd1 => /dev/pts/1 on some level?
I.e. Shouldn't I be able to use some mapping function on STDOUT to get a file descriptor that's suitable for ioctl?
In reply to Re^2: Failing to get current TTY's rows & columns...
by perl-diddler
in thread Failing to get current TTY's rows & columns...
by perl-diddler
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |