Reasons I still love the fish shell
jvns.ca
jvns.ca
For instance, writing my own prompt was what forever won me over from zsh. Basically, you edit a file named `~/.config/fish/functions/fish_prompt.fish`. That's where autoload functions live. If you type `foo` at the command line and it doesn't already exist, fish will look for a file named `foo.fish` in that directory, load it, and run the `foo` function defined there.
So in your editor, follow that pattern to write a function named `fish_prompt`. Put the commands in there that write your prompt to stdout. Make it as simple or complex as you want.
There. Done. That's all you have to do. Compare these:
Official fish docs: https://fishshell.com/docs/current/prompt.html
Official zsh docs: https://zsh.sourceforge.io/Doc/Release/Prompt-Expansion.htm
Anyway, that was emblematic of my whole experience with fish. It took a lot of un-learning special magic to settle in. It just feels so much more cohesive and consistent than any other shell I've tried. And because of that, I'm way quicker to add little scripts or completions to it that make it even more pleasant for me. I'd say the activation energy for that is far lower than with other shells I've used.
For context, I maintained the FreeBSD "bash-completion" port from 2003 to 2008 or so. It's not that I love fish because I don't know the alternatives. I love it because I do.
The only material thing in my fish config is adding `echo -n (date "+%H:%M:%S ")` to the fish_prompt, which I've come to love having over the years. Consistently really nice to have a sense of when a command started and finished. And `cowsay (fortune -s)` in the fish_greeting ;-).
function fish_right_prompt --description 'Write out the right prompt'
set_color 666666
date +'%Y-%m-%d %H:%M:%S'
set_color normal
endWhat is this? Sorry in advance if it’s some basic Linux thing. I do my development on macOS with iterm2.
[1] https://unix.stackexchange.com/questions/137842/what-is-the-...
rms also hated it, to the extent that he intentionally used Ctrl-S for the most basic search function of Emacs so that people would have to turn off the ^S/^Q crap throughout the path from the program to their terminal, or they wouldn't be able to use emacs. (Or at least so I've heard; I tried searching for confirmation but failed to find it.)
In fish shell, `ctrl+s` used to 'search in completion candidates list'
- ls <tab><ctrl+s> - for search path/file names
- ls -<tab><ctrl+s>` - for search in options
Especially second one, it's quite handy most times than search through long man page.You can also accept the suggestion with ctrl+f (or just a part of the suggestion with alt+f).
I was playing with CachyOS recently, and opened a terminal and it absolutely frightened me. There was wayyy too much going on as I typed.
So I did what old fuds do and changed the default shell back to bash.
I was impressed with its completion/suggestion speed, but it seemed overwhelming. Is that something that gets better with time?
Do they need to change much? I strongly think that they do not.
Now, with fzf in combination with other tools, I often ask myself: Why isn't this the default in most shells? When I now use bash, it seems very archaic.
Yes, there are a lot of improvements one can do with shells. I should start making a wishlist.
I set up a whole dotfiles tracking system and periodically keep making backups of the config. Fish has been sole system that has travelled with me to different machines, different companies, running on Macs, running on Linux, running on personal laptops, iMacs, and so so many different versions/instances of workstations on the server in docker, in aws etc etc.
I worked at Amazon in 2017 and we had a whole "developer environment" system built off of Apollo and my Fish config fit right in with the company-defaults for various build systems, log systems, metrics yada yada. I wrote myself a ton of nice aliases, new functions, new scripts.
I moved to Apple in 2019 and brought my Fish config over (sans any Amazon-specific things of course) and all my customizations have ported over nicely. They play well with all the Apple-y unique configs this company now gives its engineers.
Fish has been snappy & delightful.
I guess one could argue zsh could work just as well and has the benefit of being compatible with native bash syntax. But I found zsh and its ilk (oh my zsh) too slow tbh. They're nothing --and I mean zilch, nada-- compared to the speed of Fish. Fish w/ Bass (love the puns in the fish community, btw) accomplishes much of the backward compatibility needs with bash or bash-like syntax; while still performing at the snappy speeds of Fish.
Love Fish! Love Julia's notes! Ahh life is just perfect sometimes!
While we're fanboying over Julia, here's a picture of the time I made myself a t-shirt from Julia's zines of Recurse Center's values: https://x.com/b0rk/status/876571293491109889
It's bash-like, but Python based. Works on both Windows and Linux. Has several of the benefits mentioned in this article. It's really nice that I don't need to learn another language for shell scripting - its language is Python, with some extensions to make it less tedious (e.g. easily executing commands without using os.system or subprocess).
Been using it since 2018.
Starting up with fish is very easy. You can install it on any new machine and just get on right way. The defaults are very well thought out.
Ignore the monstrosity that is my PS1 definition, here’s the bulk of my zsh conf, you can say what you want, it’s not much https://github.com/Frizlab/frizlabs-conf/blob/0dfbf7b2df69ff...
"I still haven't used Xonsh"