From 543484d298abaab9c6ec5cfc1f8a772791e086ec Mon Sep 17 00:00:00 2001 From: Mario Rodas Date: Sat, 11 Dec 2021 04:20:00 +0000 Subject: [PATCH] navi: don't install widget on limited terminals Otherwise we get the following warning for terminals with limited capabilities: bash: bind: warning: line editing not enabled --- modules/programs/navi.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/programs/navi.nix b/modules/programs/navi.nix index d4519d274..f8d480328 100644 --- a/modules/programs/navi.nix +++ b/modules/programs/navi.nix @@ -64,11 +64,15 @@ in { home.packages = [ cfg.package ]; programs.bash.initExtra = mkIf cfg.enableBashIntegration '' - eval "$(${cfg.package}/bin/navi widget bash)" + if [[ :$SHELLOPTS: =~ :(vi|emacs): ]]; then + eval "$(${cfg.package}/bin/navi widget bash)" + fi ''; programs.zsh.initExtra = mkIf cfg.enableZshIntegration '' - eval "$(${cfg.package}/bin/navi widget zsh)" + if [[ $options[zle] = on ]]; then + eval "$(${cfg.package}/bin/navi widget zsh)" + fi ''; programs.fish.shellInit = mkIf cfg.enableFishIntegration ''