You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I recently switched from the older pty module of which this project was forked from and noticed some differences in terms of how writing to stdout and stdin are handled.
Previously I was using processPty.stdin.write to write data to the console. The cli app (processPty) would read from stdin, process it and then write to stdout. Because the app wrote to stdout the processPty.on('data') event would be triggered.
After switching to node-pty I had to refactor the code and use processPty.write instead. I am hoping that this change runs the exact same code as processPty.stdin.write used to.
However, my observations shows that processPty.write might be sending to stdin and stdout. Additionally, my cli app then writes to stdout as well. So I get double outputs to stdout.
Furthermore, this seems to only occur on the first processPty.write as subsequent writes do not exhibit this double stdout write behavior. Almost as if the initial echo to stdout happens before my cli app has completed initialization/loading (takes about 1500 ms to initialize).
You can view this intended and actual behavior in my apps below:
Environment details
Issue description
I recently switched from the older pty module of which this project was forked from and noticed some differences in terms of how writing to stdout and stdin are handled.
Previously I was using
processPty.stdin.write
to write data to the console. The cli app (processPty) would read from stdin, process it and then write to stdout. Because the app wrote to stdout the processPty.on('data') event would be triggered.After switching to node-pty I had to refactor the code and use
processPty.write
instead. I am hoping that this change runs the exact same code asprocessPty.stdin.write
used to.However, my observations shows that
processPty.write
might be sending to stdin and stdout. Additionally, my cli app then writes to stdout as well. So I get double outputs to stdout.Furthermore, this seems to only occur on the first
processPty.write
as subsequent writes do not exhibit this double stdout write behavior. Almost as if the initial echo to stdout happens before my cli app has completed initialization/loading (takes about 1500 ms to initialize).You can view this intended and actual behavior in my apps below:
This problem looks to be the same as #180 and #78
The text was updated successfully, but these errors were encountered: