in reply to Re: Failing to get current TTY's rows & columns...
in thread Failing to get current TTY's rows & columns...
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?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Failing to get current TTY's rows & columns...
by Anonymous Monk on Apr 14, 2011 at 08:13 UTC | |
by perl-diddler (Chaplain) on Apr 15, 2011 at 22:08 UTC | |
by Anonymous Monk on Apr 15, 2011 at 22:29 UTC | |
by perl-diddler (Chaplain) on Apr 16, 2011 at 04:58 UTC | |
by tchrist (Pilgrim) on Apr 17, 2011 at 05:13 UTC |