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

revisit after Oct 2027: drop support for ancient fish versions in interactiveness checks #3475

Conversation

calestyo
Copy link
Contributor

This improves commit 5cb5bbd by just returning
from the script in case it’s sourced from a non-interactive shell, rather then
using an if-block to not execute any further code (which is error prone, in
case code gets accidentally added outside the if, and also less readable).

This removes support for fish versions < 3.4.0, which should now no longer be
used.

Just like with the other shells, exit fish to, if called from a non-interactive
shell.

We use an `if`-block and don’t just return immediately for now, as older
versions of fish (namely < 3.4.0) did not support to use `return` in `.`-scripts
(this was only added with fish commit 3359e5d2e9bcbf19d1652636c8e448a6889302ae).

Just using `exit` instead of a `return` wouldn’t be a proper solution either, as
it would exit the whole shell, when `shell/key-bindings.fish` was executed or
sourced from a non-interactive shell.
While this should of course never happen, the idea of the whole check is to
handle the situation gracefully, which `exit` can thus not do.

Signed-off-by: Christoph Anton Mitterer <mail@christoph.anton.mitterer.name>
shell/key-bindings.fish Outdated Show resolved Hide resolved
@calestyo
Copy link
Contributor Author

Closing this a as proper solution found above and implemented via #3467.

@calestyo calestyo closed this Oct 12, 2023
@calestyo calestyo deleted the drop-support-for-ancient-fish-versions-in-interactiveness-checks branch October 12, 2023 13:17
calestyo and others added 2 commits October 11, 2027 20:41
This improves commit 5cb5bbd by just returning
from the script in case it’s sourced from a non-interactive shell, rather then
using an `if`-block to not execute any further code (which is error prone, in
case code gets accidentally added outside the `if`, and also less readable).

This removes support for fish versions < 3.4.0, which should now no longer be
used.

Signed-off-by: Christoph Anton Mitterer <mail@christoph.anton.mitterer.name>
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.

2 participants