mirror of
https://github.com/nix-community/home-manager.git
synced 2025-11-22 02:09:39 +01:00
mcfly: fix mcfly-fzf in non-interactive shells (#6669)
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
fc189507bc
commit
d725df5ad8
1 changed files with 14 additions and 3 deletions
|
|
@ -7,22 +7,33 @@ let
|
||||||
|
|
||||||
tomlFormat = pkgs.formats.toml { };
|
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 = ''
|
bashIntegration = ''
|
||||||
eval "$(${getExe pkgs.mcfly} init bash)"
|
eval "$(${getExe pkgs.mcfly} init bash)"
|
||||||
'' + optionalString cfg.fzf.enable ''
|
'' + optionalString cfg.fzf.enable ''
|
||||||
eval "$(${getExe pkgs.mcfly-fzf} init bash)"
|
if [[ $- =~ i ]]; then
|
||||||
|
eval "$(${getExe pkgs.mcfly-fzf} init bash)"
|
||||||
|
fi
|
||||||
'';
|
'';
|
||||||
|
|
||||||
fishIntegration = ''
|
fishIntegration = ''
|
||||||
${getExe pkgs.mcfly} init fish | source
|
${getExe pkgs.mcfly} init fish | source
|
||||||
'' + optionalString cfg.fzf.enable ''
|
'' + optionalString cfg.fzf.enable ''
|
||||||
${getExe pkgs.mcfly-fzf} init fish | source
|
if status is-interactive
|
||||||
|
eval "$(${getExe pkgs.mcfly-fzf} init zsh)"
|
||||||
|
end
|
||||||
'';
|
'';
|
||||||
|
|
||||||
zshIntegration = ''
|
zshIntegration = ''
|
||||||
eval "$(${getExe pkgs.mcfly} init zsh)"
|
eval "$(${getExe pkgs.mcfly} init zsh)"
|
||||||
'' + optionalString cfg.fzf.enable ''
|
'' + optionalString cfg.fzf.enable ''
|
||||||
eval "$(${getExe pkgs.mcfly-fzf} init zsh)"
|
if [[ -o interactive ]]; then
|
||||||
|
${getExe pkgs.mcfly-fzf} init fish | source
|
||||||
|
fi
|
||||||
'';
|
'';
|
||||||
|
|
||||||
in {
|
in {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue