From 0232fe1b75e6d7864fd82b5c72f6646f87838fc3 Mon Sep 17 00:00:00 2001 From: Mario Rodas Date: Sat, 19 Feb 2022 04:20:00 +0000 Subject: [PATCH] atuin: 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/atuin.nix | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/modules/programs/atuin.nix b/modules/programs/atuin.nix index 0d37854c0..9a38f5421 100644 --- a/modules/programs/atuin.nix +++ b/modules/programs/atuin.nix @@ -89,12 +89,16 @@ in { }; programs.bash.initExtra = mkIf cfg.enableBashIntegration '' - source "${pkgs.bash-preexec}/share/bash/bash-preexec.sh" - eval "$(${cfg.package}/bin/atuin init bash)" + if [[ :$SHELLOPTS: =~ :(vi|emacs): ]]; then + source "${pkgs.bash-preexec}/share/bash/bash-preexec.sh" + eval "$(${cfg.package}/bin/atuin init bash)" + fi ''; programs.zsh.initExtra = mkIf cfg.enableZshIntegration '' - eval "$(${cfg.package}/bin/atuin init zsh)" + if [[ $options[zle] = on ]]; then + eval "$(${cfg.package}/bin/atuin init zsh)" + fi ''; programs.fish.interactiveShellInit = mkIf cfg.enableFishIntegration ''