Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Xterm and node-pty input problem #453

Closed
erhalv opened this issue Jan 15, 2021 · 5 comments
Closed

Xterm and node-pty input problem #453

erhalv opened this issue Jan 15, 2021 · 5 comments

Comments

@erhalv
Copy link

erhalv commented Jan 15, 2021

Environment details

  • OS: Windows
  • OS version: 10
  • node-pty version: 0.9.0

Issue description

I'm not able to send data to the process that only listens for input (does not send data).
Spawning a python file with this code creates the issue:
input("")
With a python file like this it works:
input("Hello")

I'm spawning the python file like this:
const ptyProcess = pty.spawn(path.join(process.cwd(), "./python/python.exe"),["./test.py"]
The same issue occur when spawning a similar program written in C#.

I'm using the electron example provided in this repository (if you want to replicate this issue).

@Tyriar
Copy link
Member

Tyriar commented Jan 15, 2021

Not sure I'm understanding the problem? Maybe a screenshot would help?

@erhalv
Copy link
Author

erhalv commented Jan 15, 2021

The issue seems to be that I'm not able to write to the pty process if it hasn't sent any data.
This is the changes i made to the electron example:
image

ptyProcess.write works when test.py contains:

input("test")

or

print("test")
input()

but does not work if test.py contains

input("")

@jerch
Copy link
Collaborator

jerch commented Jan 15, 2021

Cannot repro this under linux. Is this a windows only issue by any chance?

@Tyriar
Copy link
Member

Tyriar commented Jan 15, 2021

@jerch it's Windows, I see python.exe

@bryphe
Copy link

bryphe commented Feb 16, 2021

It's possible this is the same issue @Eugeny encountered in #457 and fixed in #460 , if using node version 14+

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

4 participants