🐛 fix bash launching fish
This commit is contained in:
parent
970b9ace99
commit
b895c72205
1 changed files with 6 additions and 1 deletions
|
|
@ -55,7 +55,12 @@
|
|||
|
||||
programs.bash = {
|
||||
interactiveShellInit = ''
|
||||
if [[ -z ''${BASH_EXECUTION_STRING} ]]
|
||||
# the first arguement in the if statement check that the parent process is not a fish shell.
|
||||
# this allows spawning a bash shell inside a fish shell without the inner-most bash shell launching a fish shell
|
||||
# however this also means that nix-shell starts a bash shell unless you use `nix-shell [args] --run fish`
|
||||
# or run `fish` as the first command when entering nix-shell
|
||||
|
||||
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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue