2

I am trying to execute a perl script which using "Net::SSH::Expect" module.

the problem that am facing is that , when i execute the script through Cygwin, it works like a charm .. but the same script when executed over windows CMD , it fails giving the below error ->

SSHAuthenticationError Login timed out. The input stream currently has the contents bellow: Pseudo-terminal will not be allocated because stdin is not a terminal.
at /usr/local/share/perl5/site_perl/5.26/Expect.pm line 904.

could you please suggest what have i missed?

3
  • EMSIA? Expect FAQ: "Expect itself doesn't have real system dependencies, but the underlying IO::Tty needs pseudoterminals. IO::Stty uses POSIX.pm and Fcntl.pm." Then follows a note to check IO::Tty Commented Feb 7, 2019 at 11:38
  • 2
    IO::Tty: "Windows is now supported, but ONLY under the Cygwin environment". I guess this sums up the answer to your question. Commented Feb 7, 2019 at 11:39
  • 1
    Instead of CMD, you can also try by installing the latest PowerShell Core (PWSH > 6.2). AFAIK PWSH in Win10 environment should now be able to use Pty's. But I must admit, I have not tested this. Commented Feb 11, 2019 at 7:42

1 Answer 1

2

... Pseudo-terminal will not be allocated because stdin is not a terminal. ... Expect.pm

I guess the answer to this error message can be found from the documentation:

Expect FAQ

Expect itself doesn't have real system dependencies, but the underlying IO::Tty needs pseudoterminals. ...

See IO::Tty for a list of verified systems.

and IO::Tty

Windows is now supported, but ONLY under the Cygwin environment, ...

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you stefan for the references, i will refer them.. Actually i am trying to run on eclipse as well setting the preference to cgywin (windows -> preference -> perl -> interpreter type: cygwin). which actually worked in past .. recently i had to re-install the whole setup .. and thus, came across and stuck with this error

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.