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

Add interactiveShell to embed a full shell process #3

Open
Vindaar opened this issue Aug 3, 2019 · 1 comment
Open

Add interactiveShell to embed a full shell process #3

Vindaar opened this issue Aug 3, 2019 · 1 comment

Comments

@Vindaar
Copy link
Owner

Vindaar commented Aug 3, 2019

It would to be nice add something like interactiveShell, which would spawn a long running full shell process with working stdin / stdout / stderr.

For a start this would allow us to turn one into successive calls of commands, which we feed the shell via the input stream, instead of relying on concatenating them via &&.

On the other hand, while never the original intent of this module, having a super simple interactiveShell() call to launch a full system shell sounds like a fun idea.

Short prototyping via osproc.startProcess wasn't very successful though. Calling any command will just cause the process to stop once the command ran (which makes sense). On the other hand, explicitly launching a shell as a process, e.g. startProcess("zsh", options = {...}) seems to make it impossible to access the input and output streams. The streams we have access to are probably the ones from the session that launches zsh, instead of the streams of the launched shell. That also makes sense.

However, how to work around this and achieve what I want, I don't know. I will have to do some research on that at some point. :)

@Vindaar
Copy link
Owner Author

Vindaar commented Dec 16, 2019

When I tried this for the first time, I simply didn't use the accessed input and output streams correctly. I have a working proof of concept for this lying around. Just need to fix it up and find a way to properly include it into the project.

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

No branches or pull requests

1 participant