-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[fish] exit as well when called from non-interactive shell #3467
[fish] exit as well when called from non-interactive shell #3467
Conversation
Nope. ^^ (Thus reverted the commit to the non-deprecated form). Well, I don't know should we keep this until someone finds out what's wrong with the test suite on github? |
f1998eb
to
ff1837c
Compare
# GitHub actions runs this version of ubuntu
docker run -it ubuntu:22.04
# Install packages
apt-get update
apt install -y git curl fish
fish --version
# fish, version 3.3.1
git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf
~/.fzf/install --all
cd ~/.fzf
patch -p1 < <(curl https://patch-diff.githubusercontent.com/raw/junegunn/fzf/pull/3467.diff)
fish
But this still works, which means the file is not loaded in non-interactive environment fish -c whoami
# root Related: NixOS/nix#7152 (comment) So the question is: Are we going to drop support for fish 3.3 or below? I don't see a compelling reason to do so. |
ff1837c
to
5cb5bbd
Compare
Thanks. That helped a lot. It seems it's only since 3359e5d2e9bcbf19d1652636c8e448a6889302ae in fish 3.4.0, that We could now simply use So I think the best way for now is to an
Well, I guess you know my opinion from the ancient-bash-versions topic... but in this case I'd actually agree. Anyway, for now, let's keep it compatible and revisit this via #3475 it in 2027 and see whether <3.4.0 is still somewhere in use. ;-) Test runs through now. Please review&merge this one, thanks :-) |
Just like with the other shells, exit fish to, if called from a non-interactive shell. We cannot use `return`, 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). Unlike in POSIX, fish’s `exit` is however documented to no cause the calling shell to exit when executed in a sourced script (see: https://github.com/fish-shell/fish-shell/blob/0f70b2c0d310d97b5956b5360ad6cbc548baf72d/doc_src/cmds/exit.rst?plain=1#L20 ) Co-authored-by: Junegunn Choi <[email protected]> Signed-off-by: Christoph Anton Mitterer <[email protected]>
5cb5bbd
to
591e209
Compare
Let's see whether the test suite would pass if the old
--is-interactive
is used.