Fish: Difference between revisions
Clay pidgin (talk | contribs) →Setting fish as default shell: Added a method for Gnome Console |
|||
| (6 intermediate revisions by 4 users not shown) | |||
| Line 136: | Line 136: | ||
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. This limitation is noted on the [https://wiki.gentoo.org/wiki/Fish#Caveats Gentoo] wiki. There they present an alternative, keeping bash as the system shell but having it exec fish when run interactively. | 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. This limitation is noted on the [https://wiki.gentoo.org/wiki/Fish#Caveats Gentoo] wiki. There they present an alternative, keeping bash as the system shell but having it exec fish when run interactively. | ||
{{Expansion}} | |||
Here is one solution, which launches fish unless the parent process is already fish: | Here is one solution, which launches fish unless the parent process is already fish: | ||
| Line 152: | Line 154: | ||
</nowiki> | </nowiki> | ||
}} | }} | ||
Note that if you use the copy button to the right of the above code block, there will be a unicode space before the <code>!=</code> on line 3 of the snippet that you will need to change to a non-unicode space before executing this in your shell. | |||
'''Setting fish as default for Gnome Console''' | '''Setting fish as default for Gnome Console''' | ||
| Line 160: | Line 164: | ||
dconf = { | dconf = { | ||
enable = true; | enable = true; | ||
settings."org/gnome/ | settings."org/gnome/Console" = { | ||
shell = [ " | shell = [ "fish" ]; | ||
}; | }; | ||
}; | }; | ||
| Line 172: | Line 176: | ||
Some users suffer from slow build due to fish enabling `documentation.man.generateCaches`. You may force false. | Some users suffer from slow build due to fish enabling `documentation.man.generateCaches`. You may force false. | ||
documentation.man.generateCaches = false'';'' | documentation.man.generateCaches = false'';'' | ||
For home-manager users, man cache need to be disabled in programs | |||
programs.man.generateCaches = false'';'' | |||
==== Running fish interactively with zsh as system shell on darwin ==== | ==== Running fish interactively with zsh as system shell on darwin ==== | ||
| Line 198: | Line 206: | ||
) | ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{Note|This won't work with the new {{ic|nix shell}} command, as it doesn't set {{ic|IN_NIX_SHELL}} variable. You can instead check if {{ic|$SHLVL}} is {{ic|> 1}}, or check if {{ic|$PATH}} contains paths from {{ic|/nix/store}} (which get added at the beginning of the {{ic|$PATH}} when you enter nix shell). See https://github.com/NixOS/nix/issues/6677 for more context and workarounds.}} | |||
and <code>$nix_shell_info</code> to the echo in that function, e.g.: | and <code>$nix_shell_info</code> to the echo in that function, e.g.: | ||