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