in reply to Re^3: Failing to get current TTY's rows & columns...
in thread Failing to get current TTY's rows & columns...
I think part of the answer is to do error checking correctly like the faq entrySee my answer to previous poster -- that's a red herring as well as the unpack format.
What you are missing is:
The faq item doesn't use STDOUT. It doesn't show how one would use STDOUT to determine the terminal's size. It opens '/dev/tty' -- ANOTHER file handle -- it doesn't show how to determine the size of the terminal attached to STDOUT."I.e. Shouldn't I be able to use some mapping function on STDOUT to get a file descriptor that's suitable for ioctl?ioctl says you don't need to, the faq item doesn't, and neither does Term::Size::Any
Of note -- if STDOUT was redirected to a file, then trying to determine its size woudn't return valid values (presumably the ioctl would return an error).
So how would you determine the rows/columns of whatever STDOUT is pointing to (without opening another character device like "/dev/tty")?
Even if you aren't on linux, presumably there's a way to do it on your platform, no? I.e. if you have a 'tty' window, how would you determine the size of the window addressed by 'STDOUT'?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Failing to get current TTY's rows & columns...
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 |