different fish exec workaround

Signed-off-by: Harald Hoyer <harald@hoyer.xyz>
This commit is contained in:
Harald Hoyer 2024-03-25 11:03:30 +01:00
parent d94278f8ac
commit 30754f5211

View file

@ -73,8 +73,15 @@ in
}".source = }".source =
cfg.icon; cfg.icon;
}; };
extraOptions.programs.bash.initExtra = '' extraOptions.programs.bash.initExtra = ''
[[ $WANT_BASH ]] || exec ${pkgs.fish}/bin/fish -l 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=""
SHELL=/run/current-system/sw/bin/fish exec ${pkgs.fish}/bin/fish $LOGIN_OPTION
else
[[ $SHELL == *fish ]] && SHELL=/run/current-system/sw/bin/bash
fi
''; '';
}; };