Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Install the fish shell UNIX
The fish shell is a modern command-line shell that aims to be more discoverable and less beholden to tradition than other shells like bash and csh. Among its many unique features are on-the-fly syntax highlighting of the command line, as well as tab completion for everything under the sun with descriptions for each possible completion. Unfortunately, this shell does not ship with Mac OS X, so you'll need to do some work to install it.

First, download and install MacPorts. This will provide a Terminal command, port, that you can run to download packages. If you prefer a nice GUI for this, though, I recommend downloading and installing Porticus as well.

If you're using plain old port, type port install fish at the command line. If you're using Porticus (or another MacPorts GUI), search for "fish" in "All Packages" and click the Install toolbar icon.

Because fish requires several large libraries that probably aren't installed yet, and must therefore be downloaded and installed before fish can be used, the installation will take quite a while. Go grab a sandwich and come back in a half hour or so.

Once the install is complete, fish is installed. You can run it from Terminal right now by typing /opt/local/bin/fish, and play around with it for a while to get a feel for it. (Hint: you can change the prompt by redefining the fish_prompt function.)

If you decide you like fish better than bash, you'll probably want to set it as your default shell. The process for doing this is not quite as straightforward as it should be, and might qualify as a hint in its own right. You can change a user's shell by opening the Accounts preference pane and right-clicking on that user's name in the list on the left, then choosing "Advanced Options...". However, if you attempt to set your shell to /opt/local/bin/fish, you will get an error when you launch Terminal claiming that the administrator has set your shell to an illegal value! To get around this, you must also add the line /opt/local/bin/fish to the file /etc/shells, which Mac OS X consults to determine what constitutes a "legal" shell. You will need to enter your password to edit the file.

[kirkmc adds: I haven't tried this.]
    •    
  • Currently 2.50 / 5
  You rated: 3 / 5 (10 votes cast)
 
[20,180 views]  

Install the fish shell | 19 comments | Create New Account
Click here to return to the 'Install the fish shell' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
You'll need to use sudo
Authored by: lowbatteries on Aug 20, '08 08:03:53AM

You'll need to type 'sudo port install fish'.



[ Reply to This | # ]
Install the fish shell
Authored by: gerti on Aug 20, '08 08:37:34AM
fish requires several large libraries that probably aren't installed yet

A shell that depends on ghostscript, libpng and jpeg? Hmm...

[ Reply to This | # ]

Install the fish shell
Authored by: osxpounder on Aug 20, '08 09:31:02AM

Do you have misgivings, or suspicions? Please ... spell it out for us, since some of us, like me, have no idea if that's what you're suggesting, and wouldn't know what to be wary of.



[ Reply to This | # ]
Install the fish shell
Authored by: gerti on Aug 20, '08 09:42:15AM

Ghostscript is fairly large, and I can't quite see what use a shell would have for postscript. Maybe they have included some converter that translates their documentation to a postscript document or some such. I did not look into it much further, as usual DarwinPorts fails building some dependency half an hour into the process...



[ Reply to This | # ]
Install the fish shell
Authored by: estadtherr on Aug 20, '08 03:02:34PM

If you want a shell that does all sorts of built-in command line completion, includes modules for ftp, sockets, and other capabilities, and doesn't require building or installing anything, you should try the Z shell (/bin/zsh, already part of Mac OS).



[ Reply to This | # ]
Install the fish shell
Authored by: dzurn on Aug 21, '08 07:47:33PM

I second that suggestion. Before zsh, I never "got" shell usage at all, but zsh had a super tutorial and it made much more sense than the endless weird backtics and similar oddities in other shells.


---
Madness takes its toll.
Please have exact change.



[ Reply to This | # ]
Install the fish shell
Authored by: cursork on Aug 20, '08 03:43:48PM

Agreed.

I've always been curious about fish, but this time the port install failed on graphviz. Why the hell does it need graphviz?

Annoyingly I do have graphviz, but installed manually (and so probably a different version) because the macports' version has never worked for me. And I can't be bothered to work through the errors in manually compiling fish. It's a shell!

zsh is maybe worth trying - purely for the RPS1 ability. But it just seems to require so much configuring to get it working well. Ah well, back to bash...



[ Reply to This | # ]
Was agreeing to gerti...
Authored by: cursork on Aug 20, '08 03:45:55PM

...but pressed the wrong bit.



[ Reply to This | # ]
Install the fish shell
Authored by: Tim_Cox on Aug 21, '08 03:57:28AM

Sounded interesting so I used Porticus (gui for MacPorts) to install fish as suggested.
Astonishingly it DID require over 400 MB of downloads to satisfy its dependencies. It seems like perhaps someone wasn't too careful about minimizing the dependencies, or as noted elsewhere in the comments, maybe it's the TeX-based documentation which it pulling in ghostscript, tex itself (!), etc. etc.
I also got stuck on graphviz, but then trying again (a few times) suddenly it became downloadable, and in the end after more than an hour, I had fish installed. Lots of fun! But thanks for pointing out a shell I was unaware of!



[ Reply to This | # ]
Install the fish shell
Authored by: ocypode on Aug 21, '08 09:40:35AM
I'm trying to install fish from the command line via MacPorts and I too am stuck at graphviz:

---> Fetching graphviz
---> Attempting to fetch graphviz-2.20.2.tar.gz from http://www.graphviz.org/pub/graphviz/ARCHIVE/
Error: Target org.macports.fetch returned: fetch failed
Error: The following dependencies failed to build: doxygen graphviz texlive texlive_base perl5.8 texi2html texinfo texlive_texmf-minimal texlive_texmf-full
Error: Status 1 encountered during processing.


Turns out that the http://www.graphviz.org/pub/graphviz/ARCHIVE/ does not exist. I did a web search and graphviz-2.20.2.tar.gz can be obtained from: http://www.graphviz.org/pub/graphviz/stable/SOURCES/graphviz-2.20.2.tar.gz

Does anyone know how I can pass this corrected link to MacPorts?

Thanks in advance

[ Reply to This | # ]
Install the fish shell
Authored by: ocypode on Aug 21, '08 02:10:34PM
I figured out how to get macports to install graphviz.

1) cd to the var/macports/distfiles directory
2) Then 'sudo mkdir graphviz' if the graphviz directory is not present (it should be there as it was made when the graphviz install failed previously).
3) cd into the graphviz directory and copy the previously downloaded graphviz-2.20.2.tar.gz tarball or 'sudo wget http://www.graphviz.org/pub/graphviz/stable/SOURCES/graphviz-2.20.2.tar.gz' to download it on the spot.
4) I'm paranoid so I cd out of the macports directories before running 'port install graphviz', but once you run it it will install graphviz.

Here is my terminial output showing the above steps in detail:

[orinoco@ocypode graphviz]$ pwd
/opt/local/var/macports/distfiles/graphviz
[orinoco@ocypode graphviz]$ sudo wget http://www.graphviz.org/pub/graphviz/stable/SOURCES/graphviz-2.20.2.tar.gz
Password:
--13:31:36-- http://www.graphviz.org/pub/graphviz/stable/SOURCES/graphviz-2.20.2.tar.gz
=> `graphviz-2.20.2.tar.gz'
Resolving www.graphviz.org... 192.20.225.20
Connecting to www.graphviz.org|192.20.225.20|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 13,334,096 [application/x-gzip]

100%[=================================================================>] 13,334,096 625.98K/s ETA 00:00

13:31:57 (608.96 KB/s) - `graphviz-2.20.2.tar.gz' saved [13334096/13334096]

[orinoco@ocypode graphviz]$ ls -l
total 26048
-rw-r--r-- 1 root admin 13334096 Jun 25 16:24 graphviz-2.20.2.tar.gz
[orinoco@ocypode cache]$ cd
[orinoco@ocypode ~]$ sudo port install graphviz
---> Fetching graphviz
---> Verifying checksum(s) for graphviz
---> Extracting graphviz
---> Configuring graphviz
---> Building graphviz with target all
---> Staging graphviz into destroot
---> Installing graphviz 2.20.2_0+darwin_9
---> Activating graphviz 2.20.2_0+darwin_9
---> Cleaning graphviz
[orinoco@ocypode ~]$

At this point. I re-ran 'sudo port install fish' and the fish install picked up from where it left off prior to chocking on graphviz. Should be done soon.

Cheers,



[ Reply to This | # ]
Install the fish shell
Authored by: ocypode on Aug 21, '08 02:19:02PM
I figured out how to get macports to install graphviz.

1) cd to the var/macports/distfiles directory
2) Then 'sudo mkdir graphviz' if the graphviz directory is not present (it should be there as it was made when the graphviz install failed previously).
3) cd into the graphviz directory and copy the previously downloaded graphviz-2.20.2.tar.gz tarball or 'sudo wget http://www.graphviz.org/pub/graphviz/stable/SOURCES/graphviz-2.20.2.tar.gz' to download it on the spot.
4) I'm paranoid so I cd out of the macports directories before running 'port install graphviz', but once you run it it will install graphviz.

Here is my terminial output showing the above steps in detail:

[orinoco@ocypode graphviz]$ pwd
/opt/local/var/macports/distfiles/graphviz
[orinoco@ocypode graphviz]$ sudo wget http://www.graphviz.org/pub/graphviz/stable/SOURCES/graphviz-2.20.2.tar.gz
Password:
--13:31:36-- http://www.graphviz.org/pub/graphviz/stable/SOURCES/graphviz-2.20.2.tar.gz
=> `graphviz-2.20.2.tar.gz'
Resolving www.graphviz.org... 192.20.225.20
Connecting to www.graphviz.org|192.20.225.20|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 13,334,096 [application/x-gzip]

100%[=================================================================>] 13,334,096 625.98K/s ETA 00:00

13:31:57 (608.96 KB/s) - `graphviz-2.20.2.tar.gz' saved [13334096/13334096]

[orinoco@ocypode graphviz]$ ls -l
total 26048
-rw-r--r-- 1 root admin 13334096 Jun 25 16:24 graphviz-2.20.2.tar.gz
[orinoco@ocypode cache]$ cd
[orinoco@ocypode ~]$ sudo port install graphviz
---> Fetching graphviz
---> Verifying checksum(s) for graphviz
---> Extracting graphviz
---> Configuring graphviz
---> Building graphviz with target all
---> Staging graphviz into destroot
---> Installing graphviz 2.20.2_0+darwin_9
---> Activating graphviz 2.20.2_0+darwin_9
---> Cleaning graphviz
[orinoco@ocypode ~]$

At this point. I re-ran 'sudo port install fish' and the fish install continued from where it left off prior to choking on graphviz. The fish install should complete soon.

Cheers,



[ Reply to This | # ]
Install the fish shell
Authored by: danielj7 on Aug 21, '08 01:10:10PM
For those who prefer Fink to MacPorts, I just added fish to Fink's unstable tree. fink install fish to get the shelly goodness. Note that I didn't include doxygen as a dependency since that's only needed to regenerate the docs if you make source code changes. That greatly decreases the needed dependencies over the MacPorts version.

[ Reply to This | # ]
Install the fish shell
Authored by: Phoenix1701 on Dec 14, '08 01:01:07AM
Wow! No kidding! The fink package is a LOT smaller, and much less error-prone as well based on my experience just now. To anyone still wanting to install fish, I highly recommend doing it through fink instead of MacPorts. You'll need to enable the "unstable" packages first (see http://www.finkproject.org/faq/usage-fink.php?phpLang=en#unstable for how), but after that a simple 'fink install fish' should suffice.

[ Reply to This | # ]
Install the fish shell
Authored by: Phoenix1701 on Aug 22, '08 12:15:32AM

For all those having trouble with various dependencies, I feel your pain. My first attempt to install fish went flawlessly, at which point I banged out the above hint to let everyone else in on the fun... and then I tried to install it on another machine and it blew up in all sorts of pretty explosions when I got to doxygen (which I already have installed anyway, but MacPorts doesn't know that). I even emailed the maintainer of doxygen because it was failing on TeX, which I don't want or need to generate HTML documentation, and got a reply to the extent of "oh, yeah, I suppose we should get around to that eventually..." now it sounds like I ought to email the maintainer of fish to remove the doxygen dependency altogether. Ugh. Best I can say is maybe this will encourage the fish dev(s) to build a Mac OS X binary...



[ Reply to This | # ]
Install the fish shell
Authored by: mizraith on Aug 22, '08 06:27:26PM

Wow.. i was all excited to try a new shell, but ran into all the same explosive failures. Seeing the above comments about 400MB of downloads for something that I'll probably *forget* about, looks like a vast waste of disk space not worth the effort of installing.

Sure hope the MacPorts guys (I've run into this on many other ports) get on the maintainers of the various ports regarding dependencies. Nothing sucks worse that trying to track down a mis-typed URL that is 3 levels deep on the dependency front.

I still want to try fish, so please post again when the install process (and size) becomes more sane.



[ Reply to This | # ]
Install the fish shell
Authored by: gunnmjk on Aug 23, '08 02:40:01AM
After installing the fish shell, you will definitely want to look at the documentation for it. In order to do so, the default BROWSER needs to be set. Run this line in the terminal to do so.
echo set BROWSER \'open\' >> ~/.config/fish/config.fish
Once this is done, restart the shell and type 'help'

[ Reply to This | # ]
Install the fish shell
Authored by: clemmece on Dec 09, '09 07:29:12PM
echo set BROWSER \'open\' >> ~/.config/fish/config.fish
Can you expound on what \'open\' means in this context? Entering echo $BROWSER at the prompt outputs "open" rather than the path to the default browser. I'm assuming "open" in the quoted line is different than the OS X open command.

[ Reply to This | # ]
Install the fish shell
Authored by: flight553 on Jul 28, '12 04:03:33PM

This worked for me after installing fish with 'brew install fish'

set BROWSER \'open\' >> /usr/local/share/fish/config.fish



[ Reply to This | # ]