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

Avoid setting stdin handle when not necessary #3248

Merged
merged 4 commits into from
Aug 5, 2022

Conversation

dariooddenino
Copy link
Contributor

Hi!

Another small PR which avoids adding the stdin handler in shell_impl when not necessary.
This allows to run commands that don't expect any stdin whtout getting a ENOTTY error.

While this works, I have no experience with terminals (and rust), so it might be the completely wrong approach.

Avoid setting the stdin handle in `shell_impl` when the input argument
is None.

This permits to run commands with no stdin with :sh
@AceofSpades5757
Copy link
Contributor

I think this can cause problems with some programs. I'll usually let high-level functions handle anything too fancy and go with a heuristic approach to get simple scripts (like build scripts) to work.

@AceofSpades5757
Copy link
Contributor

That looks infinitely cleaner.

@archseer archseer merged commit 3121353 into helix-editor:master Aug 5, 2022
@dariooddenino dariooddenino deleted the optional-stdin branch August 5, 2022 07:15
thomasskk pushed a commit to thomasskk/helix that referenced this pull request Sep 9, 2022
* Avoid setting stdin handle when not necessary

Avoid setting the stdin handle in `shell_impl` when the input argument
is None.

This permits to run commands with no stdin with :sh

* refactoring to avoid code duplication

* making clippy happy

* Process variable name fix
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

Successfully merging this pull request may close these issues.

4 participants