Same guy, and no, the red herring is you're confusing c function ioctl with perl function ioctl
What you are missing is:
No, I didn't miss it. If you redirect STDIN/STDOUT/STDERR, then you need to give ioctl a handle which is connected to tty, so you open your own to /dev/tty, and it works regardless of the state of STDIN/STDOUT/STDERR
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'?
I would use an abstraction like Term::Size::Any, I wouldn't mess around with ioctl
But in all honesty, unless I'm writing some kind of curses program, I would never need to know the size of the terminal
In reply to Re^5: Failing to get current TTY's rows & columns...
by Anonymous Monk
in thread Failing to get current TTY's rows & columns...
by perl-diddler
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |