mirror of
https://github.com/nix-community/home-manager.git
synced 2025-03-31 04:04:32 +00:00
mcfly: fix mcfly-fzf in non-interactive shells
mcfly-fzf's initialization steps don't properly check for interactive shells. It does check, but only after checking if mcfly has been initialized. Because mcfly does not initiate itself on non-interactive shells, that causes mcfly-fzf to return an exit code, breaking non-interactive shells.
This commit is contained in:
parent
94605dcade
commit
160875183f
1 changed files with 14 additions and 3 deletions
|
@ -7,22 +7,33 @@ let
|
|||
|
||||
tomlFormat = pkgs.formats.toml { };
|
||||
|
||||
# These shell integrations all wrap `mcfly-fzf init` in an interactive shell
|
||||
# check, due to a buggy interactivity check in its initialization.
|
||||
# See: https://github.com/nix-community/home-manager/issues/6663
|
||||
# and https://github.com/bnprks/mcfly-fzf/issues/10
|
||||
|
||||
bashIntegration = ''
|
||||
eval "$(${getExe pkgs.mcfly} init bash)"
|
||||
'' + optionalString cfg.fzf.enable ''
|
||||
eval "$(${getExe pkgs.mcfly-fzf} init bash)"
|
||||
if [[ $- =~ i ]]; then
|
||||
eval "$(${getExe pkgs.mcfly-fzf} init bash)"
|
||||
fi
|
||||
'';
|
||||
|
||||
fishIntegration = ''
|
||||
${getExe pkgs.mcfly} init fish | source
|
||||
'' + optionalString cfg.fzf.enable ''
|
||||
${getExe pkgs.mcfly-fzf} init fish | source
|
||||
if [[ -o interactive ]]; then
|
||||
${getExe pkgs.mcfly-fzf} init fish | source
|
||||
fi
|
||||
'';
|
||||
|
||||
zshIntegration = ''
|
||||
eval "$(${getExe pkgs.mcfly} init zsh)"
|
||||
'' + optionalString cfg.fzf.enable ''
|
||||
eval "$(${getExe pkgs.mcfly-fzf} init zsh)"
|
||||
if status is-interactive
|
||||
eval "$(${getExe pkgs.mcfly-fzf} init zsh)"
|
||||
end
|
||||
'';
|
||||
|
||||
in {
|
||||
|
|
Loading…
Add table
Reference in a new issue