The Fish Shell

A Fish drawn in Ascii Art

There are things you drag around with you for ages, because they just work. In the last ten years, I have moved between three countries, but I have kept using the same shell, with the same configuration that kept getting more and more elaborate. Sun microcomputers has died years ago, but my bashrc is still theoretically capable of configuring itself on SunOS.

A few days ago, Angel showed my a new shell: fish, aptly titled Finally, a command line shell for the 90s, the was rebooted Ridiculous Fish who already wrote a very good hex-editor for Mac OS X, HexFiend. Basically, fish is a shell that does the right thing out of the box and uses features that appeared in computer since the eighties: colour, unicode, thread. Fish is also very good a completion, it parses man pages to build its completion lists and seems to have custom files for many other Unix tools. This convinced me to try it as a replacement to bash. I’m pretty happy with fish and I really recommend you try it out.

wiesmann@wagamama~/Downloads> google_chrome_app  google_chrome_app  (Google Chrome)  google_earth_app  (Google Earth) google_drive_app    (Google Drive)

One nice feature I had on bash was a script that build a list of aliases out of all the Mac OS X applications, launching them with the open command. The script was something I had gotten off Mac OS X hints and transformed a bit. The script was not very smart, as it looked for Applications in a static set of directories. I wanted to see if I could rewrite the same feature for fish using mdfind to find all the Applications. The result is a small Python script which generates a list of fish functions, including a short description built using mdls.

To use the script, just download it from GitHub, then run

./ > ~/.config/fish/app_functions

And finally add the following lines to your file:

if test -f ~/.config/fish/app_functions
  . ~/.config/fish/app_functions

All your Mac OS X applications will be available as commands, if arguments are passed to them, they will be opened by said application (assuming the application can handle said file), in tab-completion, the name of the application (with spaces and casing) is displayed. I will try to add further information.

6 thoughts on “The Fish Shell”

  1. C’est un shell vraiment sympa. Je l’utilise depuis un peu plus d’une année sur ma bécane à la maison. Malheureusement j’ai pas le droit de l’utiliser au boulot :-(

    Pour info, il y a un “” qui s’est collé à la fin du lien “download it from here”.

  2. Je l’utilisais sous Gentoo, il y a 4 ou 5 ans… Mais c’est un bon rappel, je vais m’y remettre. (si je parviens à accéder au site)

  3. C’est vrai qu’il est super bien, mais il y a bien un truc qui me manque de bash, c’est le CTRL-R pour rappeler une ancienne commande en tapant une partie de celle-ci. Une idée sur comment avoir ca avec fish ?

  4. Bon, après avoir cherché un peu, je vais me répondre a moi même:
    Il faut écrire un bout de la commande qu’on veut rappeler et utiliser ALT+Up ou ALT+Down (les touches fléchées donc).
    Je peux donc maintenant rester sous fish :-)

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: