diff options
author | Christoph Anton Mitterer <mail@christoph.anton.mitterer.name> | 2023-10-12 18:06:55 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-13 01:06:55 +0900 |
commit | 7e89458a3b58c047c10494a5cb53d921fb08b4f3 (patch) | |
tree | 6996595e50c1814dbe276146ffff5945952fc24c /shell/key-bindings.fish | |
parent | f212bafe46233a207d4308ad368884c210cedc46 (diff) |
[fish] exit as well when called from non-interactive shell (#3467)
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
)
Signed-off-by: Christoph Anton Mitterer <mail@christoph.anton.mitterer.name>
Co-authored-by: Junegunn Choi <junegunn.c@gmail.com>
Diffstat (limited to 'shell/key-bindings.fish')
-rw-r--r-- | shell/key-bindings.fish | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/shell/key-bindings.fish b/shell/key-bindings.fish index abaefead..69f76970 100644 --- a/shell/key-bindings.fish +++ b/shell/key-bindings.fish @@ -11,6 +11,9 @@ # - $FZF_ALT_C_COMMAND # - $FZF_ALT_C_OPTS +status is-interactive; or exit 0 + + # Key bindings # ------------ function fzf_key_bindings |