Skip to content
This repository has been archived by the owner on Sep 21, 2024. It is now read-only.

Allow stdin like with Bash in Python mode #17

Closed
philipturner opened this issue Jun 17, 2022 · 1 comment
Closed

Allow stdin like with Bash in Python mode #17

philipturner opened this issue Jun 17, 2022 · 1 comment
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@philipturner
Copy link
Owner

philipturner commented Jun 17, 2022

Swift-Colab uses the Python pexpect library to interact with running processes. This lets it extract colorized, interactive output - a feature not present in google/swift-jupyter. However, this means it will freeze when the process requests input.

Screen Shot 2022-06-17 at 6 02 14 PM

In the image above, the third %system command requests permission to overwrite a file.

There is currently no mechanism to pass input into a running process. The Python Jupyter kernel passes input in, so it is theoretically possible. But this feature will take a non-negligible amount of time to implement. I am deferring its addition to a future release.

@philipturner philipturner added enhancement New feature or request help wanted Extra attention is needed labels Jun 17, 2022
@philipturner philipturner changed the title Allow stdin like with Python Bash Allow stdin like with Bash in Python mode Jun 18, 2022
@philipturner philipturner added the good first issue Good for newcomers label Jul 13, 2022
@philipturner
Copy link
Owner Author

Patched and being implemented in Swift-Colab v2.3. I switched from pexpect to a reimplementation of the terminal in googlecolab/colabtools. Colorized output appears when building a Swift package that generates compiler warnings, so the new implementation is a go.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant