in reply to Given filehandle is not a tty in clone_winsize_from

The problem is that when a program is run under CGI, its STDIN is a pipe to the HTTP server process (where POST data can be read from), which is not a terminal. Looks like an XY Problem. What program do you run under Expect and how does it misbehave?
  • Comment on Re: Given filehandle is not a tty in clone_winsize_from

Replies are listed 'Best First'.
Re^2: Given filehandle is not a tty in clone_winsize_from
by chackypandy (Initiate) on Aug 25, 2013 at 01:36 UTC
    Ah, thank you aitap.

    That made sense -- I have gone ahead and used the following code to solve my problem:

    my $winsize = pack('SSSS', 25, 80, 0, 0); # rows, cols, #pixelsX, #pixelsY ioctl($exp->slave(), &IO::Tty::Constant::TIOCSWINSZ, $winsize);



    As you had suggested, I am no longer referencing a terminal session that is unavailable to me, but instead, am creating one on the fly with the dimensions required. Thanks again for your helpful advice to lead me onto the right track. In the event that you feel there is a better solution please do let me know.