Jump to content

Talk:Fish: Difference between revisions

From Official NixOS Wiki
Pigeon (talk | contribs)
 
Pigeon (talk | contribs)
 
Line 3: Line 3:
This script seems to contain many unneeded parts, such as {{ic|$BASH_EXECUTION_STRING}} and {{ic|login_shell}} checks.
This script seems to contain many unneeded parts, such as {{ic|$BASH_EXECUTION_STRING}} and {{ic|login_shell}} checks.


It also misses at least one needed safeguard: check if{{ic|$SHLVL}} is greater than 1 or 2. Without it, nested <code>nix-shell</code> will likely break.
It also misses at least one needed safeguard: check if{{ic|$SHLVL}} is greater than 1 or 2. Without it, nested <code>nix-shell</code> will not work correctly (since parent != fish check will not apply).


Seems like this script was initially adapted from ArchWiki Fish page. Right now i am working to clean up the corresponding section on ArchWiki.
Seems like this script was initially adapted from ArchWiki Fish page. Right now i am working to clean up the corresponding section on ArchWiki.

Latest revision as of 22:57, 24 January 2026

Suggested bashrc in Fish#Setting fish as default shell needs revision

This script seems to contain many unneeded parts, such as $BASH_EXECUTION_STRING and login_shell checks.

It also misses at least one needed safeguard: check if$SHLVL is greater than 1 or 2. Without it, nested nix-shell will not work correctly (since parent != fish check will not apply).

Seems like this script was initially adapted from ArchWiki Fish page. Right now i am working to clean up the corresponding section on ArchWiki.

Please, see https://wiki.archlinux.org/title/Fish#Modify_.bashrc_to_drop_into_fish and the respective Talk page there. There you'll find rationale for everything i've mentioned in this NixOS Wiki Talk page. Also you may check latest ArchWiki edit history for Fish page (I am also @Pigeon there).

Too many users copy-paste provided snippets from wiki without understanding how it works (i've done that myself). So i propose that make this script more accurate :-) Pigeon (talk) 18:40, 24 January 2026 (UTC)Reply