fish home | Main documentation page | Design document | About fish | External commands | How fish differs from other shells | Builtin commands | License

Why fish?

What is different about fish?

This page is a summary of differences between fish and other shells.

Tab completion features

fish, like many other shells, performs tab completion, i.e. the shell tries to guess what the user is typing and complete the users sentences whenever the user presses the tab key. If the shell finds more than one possible completion, a list of all completions is displayed when the users double taps on tab. fish extends tab completion functionality in several ways:

Some examples of the completions performed by fish

X-Windows Copy and paste

fish supports using the X-Windows clipboard for storing copy and paste information. This feature is automatically enabled if the DISPLAY environment variable is set. For more information on how to use copy and paste in fish, read this section. This means you can easily share commands and strings between different shell sessions and applications.

Simple launching of default applications

The open command uses the mimetype database (Also used by both Gnome or KDE) to launch the default application for a file. Just type open *.html and all the HTML files in your current directory will be opened in your default browser. No longer will you have to convert your filenames to URLS, remember clunky Open Office command names, worry about absolute paths or any the other common pitfalls when opening files from the commandline.

Help

fish is heavily commented. Both the source code and the program in general features a great deal of easily accessible documentation. The help command is used to display HTML-based help files. Just type help and a subject, and the help system will try to fill your needs. To view the page you are reading right now, you could simply type help difference. help also works great together with tab completion. Write help and double tap on tab, a list of all help sections will be displayed, with a description of the content of each section.

Also, all builtin commands have a help option. Passing '-h' or '--help' to any builtin will give you the same help as the help command, but formated for output on screen.

Syntax highlighting

fish performs syntax highlighting of commands as they're entered. Pretty colors may look nice (or awful, depending on your taste), but the real advantage is error flagging. The syntax highlighting function does extensive error cheching and will flag many common errors such as misspelling a command or option, or reading from a non-existent file.

fish also highlights matching quotes and parenthesis as the cursor moves over them. This is very useful when typing long, complex commands.

Terminal handling

fish knows it's terminal. fish uses the terminfo database to get more information on the current terminal. Some of the terminal handling features of fish are:

fish uses wide character strings internally, including double width characters, so it should be ready for all your Unicode needs.

Smart history

fish features an intelligent history that automatically removes any duplicate items. Searching is performed by entering a search string and using the up/down arrow keys to go to the next/previous match. On exit, fish performs a merge between the history on file and the history in memory history, thus making sure that multiple copies of fish running concurrently will not erase each others history information.

Simplicity

fish has a simple syntax. There is only one form of alias/function/whatever, accessed through the function builtin. The are very few builtins, fish relies on normal commands like echo, kill, printf and time instead of reimplementing them as builtins.

Token separation is performed before variable expansion. This means that even if a variable contains spaces, it will never be separated into multiple arguments. If you want to tokenize a string, you can use the tokenize command.

Command substitution is specified using parenthesis, as in set name (whoami).

There is no math mode, use bc.

The POSIX way of setting variables is lame. Whitespace sensitive languages are awful. "foo=bar" and "foo = bar" should not mean different things. fish uses a builtin, set to set and remove environment variables. While this may seem a bit obscure, this makes for a very consistent language. In fish, everything, including the loops, assignments and switch/case statements is a command.

In fish, all block types end with the end command.


Generated on Thu Jan 19 14:47:33 2006 for fish by  doxygen 1.4.6