Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Forwarding User Interaction and Feedback in CLI app #196

Open
jenky opened this issue Jan 19, 2024 · 1 comment
Open

Forwarding User Interaction and Feedback in CLI app #196

jenky opened this issue Jan 19, 2024 · 1 comment
Labels

Comments

@jenky
Copy link

jenky commented Jan 19, 2024

Hi there! It's not an issue but rather a question.

I'm working on a CLI app that runs several tasks, and a few of them require user interaction (using Symfony IO or Laravel Prompt) during execution. How can I forward the input from the child process to the main stdout and receive feedback in the child processes? Thanks

@trowski
Copy link
Member

trowski commented Jan 28, 2024

Hi @jenky!

ProcessContext has getStdin() and getStdout() methods to return writable and readable streams, respectively, which may be used to read from STDOUT and write to STDIN of the child from within the parent process. In the parent, you can write the data read from the child STDOUT to STDOUT of the parent and take data received on STDIN of the parent and write it to STDIN of the child.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants