Fish: Difference between revisions
m update a link to use https; refine highlighted text for the gentoo wiki url |
→Setting fish as default shell: Update suggested .bashrc to use simpler, more correct script to drop into FIsh. Discussion talk page: Talk:Fish#Suggested_bashrc_in_Fish#Setting_fish_as_default_shell_needs_revision. This script it adapted from ArchWiki (where I help to maintain it). I've also replaced mention of gentoo wiki with the Arch solution, but we didn't use the version from gentoo wiki anyway. |
||
| Line 135: | Line 135: | ||
=== Setting fish as default shell === | === Setting fish as default shell === | ||
Using fish as the the login shell can cause compatibility issues. For example, certain recovery environments such as systemd's emergency mode to be completely broken when fish was set as the login shell. | Using fish as the the login shell can cause compatibility issues. For example, certain recovery environments such as systemd's emergency mode to be completely broken when fish was set as the login shell. ArchWiki presents an [https://wiki.archlinux.org/title/Fish#Modify_.bashrc_to_drop_into_fish alternative solution], keeping bash as the system shell but having it exec fish when run interactively. | ||
{{Expansion}} | {{Expansion}} | ||
| Line 145: | Line 145: | ||
programs.bash = { | programs.bash = { | ||
interactiveShellInit = '' | interactiveShellInit = '' | ||
if | # "check if parent process is not fish" && "make nested shells work properly" | ||
if grep -qv fish /proc/$PPID/comm && [[ $SHLVL == [12] ]]; then | |||
# set $SHELL for better integration with programs like nix shell, tmux, etc. | |||
SHELL=${pkgs.fish}/bin/fish exec fish | |||
fi | fi | ||
''; | ''; | ||
| Line 155: | Line 155: | ||
}} | }} | ||
For a more detailed explanation, please see the [https://wiki.archlinux.org/title/Fish#Modify_.bashrc_to_drop_into_fish aforementioned ArchWiki page]. | |||
'''Setting fish as default for Gnome Console''' | '''Setting fish as default for Gnome Console''' | ||