3 ms·
About 98% of common POSIX shell usage is covered by fish, right down to identical syntax. (Not everything is.) Biggest tip for fish switchers: set fish as your
by mattgreenrocks 5y ago
About 98% of common POSIX shell usage is covered by fish, right down to identical syntax. (Not everything is.)
Biggest tip for fish switchers: set fish as your terminal's shell instead of changing your login shell.
- quells 5y ago> Biggest tip for fish switchers: set fish as your terminal's shell instead of changing your login shell. That's an interesting idea - I will try that. This bit me recently when I used Migration Assistant to move from a Mac with Catalina to one with Big Sur; my login shell was still set to the path for fish installed via Homebrew, but none of those packages were copied over. I managed to hack around it by copying bash into that location so that I could reinstall Homebrew and fish to finish repairing things.
- mattgreenrocks 5y agoIMO it's worth it to avoid Relocated Items popping up after every update.
- bobbylarrybobby 5y agoIf you do this, you will probably also want to add `-fish` to Terminal's preference Profiles > Shell > Ask before closing (*only if there are processes...). This will prevent you from getting prompted when closing a Terminal tab with the default shell running.
- aryamaan 5y agowhat's the difference between the two for the non initiatives?
- mattgreenrocks 5y agoAFAIK, login shell can be thought of as the default shell anytime you start a shell. By default your terminal program uses that, but most terminals let you override that to be something else.
- mixmastamyk 5y agoI still fail to see a significant difference. Been using fish as my shell for perhaps 15 years. Perhaps not having to run chsh on a new machine, which I have to run -h on to remember how to use ever few years.
- curryst 5y agoThe main advantage is that if you screw it up or an update borks the shell itself, it's easier to fix if it isn't your login shell. At one point I decided to set Elvish as my login shell, and it turned out to not function as a login shell. As in, won't start at all. Any time I logged in, it would just immediately exit, ending my session. Work doesn't allow us to have root access (annoying), so I ended up having to boot into single user mode to set my shell back. I've done a similar thing with bash and "set -e". Being new increases the chances of doing something like that that breaks the shell. It's annoying to fix for those of us with experience, and extremely difficult to fix for those without experience. It gets even worse when you consider that some distros like Ubuntu don't set a root password, so you can't log into the root account without sudo, which requires your user to have a functional login shell. I wouldn't want a new user to paint themselves into a corner where the only way to get their desktop working again is to remember how to boot into single user mode or boot from removable media and mount their hard drive. Doubly so if their Linux desktop is their only PC; it's going to be really annoying if the only way to write removable media to boot from is the machine that's currently broken.
- mixmastamyk 5y agoHmm, fish is approaching twenty years old and supported login the whole time. But, bugs still happen I suppose. I always kept OS CDs and later flash drives around for glitches however. Have one an old one in the tin right now.
- pkulak 5y agoI just start fish from .bashrc: https://github.com/pkulak/dotfiles/blob/master/.bashrc https://github.com/pkulak/dotfiles/blob/master/.bashrc
- RealStickman_ 5y agoI did that, but this makes it far more difficult to use bash if you need to.
- Fnoord 5y agoTo use Bash in such circumstances you just exit Fish via ^d or type exit. The bad thing about is you execute a Bash shell which uses resources. But with today's RAM even on a smartphone this wouldn't matter. The convenience and safety (to have a working default shell) is worth it. You can use Fish on any system where Nix runs on, btw. For example, I use it on Synology's DSM.
- pkulak 5y agoI just type "bash".