diff --git a/modules/core.nix b/modules/core.nix index c04fc50..0cd1cc5 100644 --- a/modules/core.nix +++ b/modules/core.nix @@ -88,6 +88,17 @@ ]; }; + # REASONING: fish is not a POSIX compliant shell so if something happens we need to use bash as the login shell to prevent an irrecoverable shell + programs.bash = { + interactiveShellInit = '' + if [[ $(${pkgs.procps}/bin/ps --no-header --pid=$PPID --format=comm) != "fish" && -z ''${BASH_EXECUTION_STRING} ]] + then + shopt -q login_shell && LOGIN_OPTION='--login || LOGIN_OPTION="" + exec ${pkgs.fish}/bin/fish $LOGIN_OPTION + fi + ''; + }; + programs.fish = { enable = true; }; diff --git a/modules/programs.nix b/modules/programs.nix index 99409a9..47f6ccd 100644 --- a/modules/programs.nix +++ b/modules/programs.nix @@ -139,6 +139,7 @@ # Fish shell stuff [ fishPlugins.tide + procps ] ); }