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

Prevent shell_keep_pipe from stopping on nonzero exit status code #9817

Merged
merged 1 commit into from
Mar 19, 2024

Conversation

sirius94
Copy link
Contributor

@sirius94 sirius94 commented Mar 5, 2024

The shell_impl and shell_impl_async functions no longer return success because it was always true. If the command didn't succeed both functions would return an Err.

This was also the reason, why shell_keep_pipe didn't work. It relied upon the value of success and aborted in case of an Err. It now removes any selection for which shell_impl returns Err.

If the command always fails, the selections are preserved and an error message is displayed in the status bar.

(shell_keep_pipe can be tested using the $ keybinding and grep for example)

The `shell_impl` and `shell_impl_async` functions no longer return
`success` because it was always `true`. If the command didn't succeed
both functions would return an `Err`.

This was also the reason, why `shell_keep_pipe` didn't work. It relied
upon the value of `success` and aborted in case of an `Err`.
It now removes any selection for which `shell_impl` returns `Err`.

If the command always fails, the selections are preserved and an error
message is displayed in the status bar.
@the-mikedavis the-mikedavis added A-command Area: Commands S-waiting-on-review Status: Awaiting review from a maintainer. labels Mar 5, 2024
Copy link
Member

@the-mikedavis the-mikedavis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch about success being unused / always true. Thanks!

@the-mikedavis the-mikedavis merged commit 5b8bfc5 into helix-editor:master Mar 19, 2024
6 checks passed
Desdaemon pushed a commit to Desdaemon/helix that referenced this pull request Mar 26, 2024
…elix-editor#9817)

The `shell_impl` and `shell_impl_async` functions no longer return
`success` because it was always `true`. If the command didn't succeed
both functions would return an `Err`.

This was also the reason, why `shell_keep_pipe` didn't work. It relied
upon the value of `success` and aborted in case of an `Err`.
It now removes any selection for which `shell_impl` returns `Err`.

If the command always fails, the selections are preserved and an error
message is displayed in the status bar.
postsolar pushed a commit to postsolar/helix that referenced this pull request Apr 4, 2024
…elix-editor#9817)

The `shell_impl` and `shell_impl_async` functions no longer return
`success` because it was always `true`. If the command didn't succeed
both functions would return an `Err`.

This was also the reason, why `shell_keep_pipe` didn't work. It relied
upon the value of `success` and aborted in case of an `Err`.
It now removes any selection for which `shell_impl` returns `Err`.

If the command always fails, the selections are preserved and an error
message is displayed in the status bar.
postsolar pushed a commit to postsolar/helix that referenced this pull request Apr 4, 2024
…elix-editor#9817)

The `shell_impl` and `shell_impl_async` functions no longer return
`success` because it was always `true`. If the command didn't succeed
both functions would return an `Err`.

This was also the reason, why `shell_keep_pipe` didn't work. It relied
upon the value of `success` and aborted in case of an `Err`.
It now removes any selection for which `shell_impl` returns `Err`.

If the command always fails, the selections are preserved and an error
message is displayed in the status bar.
postsolar pushed a commit to postsolar/helix that referenced this pull request Apr 4, 2024
…elix-editor#9817)

The `shell_impl` and `shell_impl_async` functions no longer return
`success` because it was always `true`. If the command didn't succeed
both functions would return an `Err`.

This was also the reason, why `shell_keep_pipe` didn't work. It relied
upon the value of `success` and aborted in case of an `Err`.
It now removes any selection for which `shell_impl` returns `Err`.

If the command always fails, the selections are preserved and an error
message is displayed in the status bar.
postsolar pushed a commit to postsolar/helix that referenced this pull request Apr 20, 2024
…elix-editor#9817)

The `shell_impl` and `shell_impl_async` functions no longer return
`success` because it was always `true`. If the command didn't succeed
both functions would return an `Err`.

This was also the reason, why `shell_keep_pipe` didn't work. It relied
upon the value of `success` and aborted in case of an `Err`.
It now removes any selection for which `shell_impl` returns `Err`.

If the command always fails, the selections are preserved and an error
message is displayed in the status bar.
mtoohey31 pushed a commit to mtoohey31/helix that referenced this pull request Jun 2, 2024
…elix-editor#9817)

The `shell_impl` and `shell_impl_async` functions no longer return
`success` because it was always `true`. If the command didn't succeed
both functions would return an `Err`.

This was also the reason, why `shell_keep_pipe` didn't work. It relied
upon the value of `success` and aborted in case of an `Err`.
It now removes any selection for which `shell_impl` returns `Err`.

If the command always fails, the selections are preserved and an error
message is displayed in the status bar.
Vulpesx pushed a commit to Vulpesx/helix that referenced this pull request Jun 7, 2024
…elix-editor#9817)

The `shell_impl` and `shell_impl_async` functions no longer return
`success` because it was always `true`. If the command didn't succeed
both functions would return an `Err`.

This was also the reason, why `shell_keep_pipe` didn't work. It relied
upon the value of `success` and aborted in case of an `Err`.
It now removes any selection for which `shell_impl` returns `Err`.

If the command always fails, the selections are preserved and an error
message is displayed in the status bar.
smortime pushed a commit to smortime/helix that referenced this pull request Jul 10, 2024
…elix-editor#9817)

The `shell_impl` and `shell_impl_async` functions no longer return
`success` because it was always `true`. If the command didn't succeed
both functions would return an `Err`.

This was also the reason, why `shell_keep_pipe` didn't work. It relied
upon the value of `success` and aborted in case of an `Err`.
It now removes any selection for which `shell_impl` returns `Err`.

If the command always fails, the selections are preserved and an error
message is displayed in the status bar.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-command Area: Commands S-waiting-on-review Status: Awaiting review from a maintainer.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants