Recs.
Updated
fish is a smart and user-friendly command line shell for OS X, Linux, and the rest of the family.
Specs
Pros
Pro Already set up for you
While other shells require a lot of set up to act the way you want them to and to have some useful features, fish works perfectly out of the box. It has all the most widely used features baked in and are there out of the box without having the need to install plugins or tweak any configuration files.
Pro High portability
Because it needs very little configuration to work properly, you can use Fish everywhere. If you are working on a system you don't usually work, installing Fish from the repository is easy and will give you the same experience as the installation on your own machine without having to drag a dotfile around.
Pro Less ambiguent lists
Here is a sample. Notice that there are 2 files with spaces in names. ls produces a valid list, and for loop correctly iterated through its values.
➤ for a in (ls); ls -l $a; end
-rw-rw-r-- 1 sashka sashka 0 Apr 19 03:16 alma mater.txt
-rw-rw-r-- 1 sashka sashka 0 Apr 19 03:16 whatever i want.txt
sh scripts tend to be fragile when there are lists containing values with spaces.
Also:
➤ echo $PATH
/usr/bin /bin /usr/sbin /sbin /usr/local/bin
➤ echo $PATH[1]
/usr/bin
➤ echo $PATH[-1]
/usr/local/bin
Cons
Con Incompatible with POSIX
This means that any script or command you copy with &&
in it instead of ; and
(among other things), will not work.
Con Doesn't support history expansion ("!!")
Fish has no support for !!
, but you can use Oh My Fish shell framework and install bang-bang
plugin to have this shortcut in Fish shell. The downside of using bang-bang is that it takes over ones default key bindings, for those that don't use them it should not be an issue but for those that do it is an annoyance to be considered.
For sudo !!
, this can also be achieved by making this custom function:
function sudo
if test "$argv" = !!
eval command sudo $history[1]
else
command sudo $argv
end
end
Con No support for sudo !!
Fish has no support for sudo !!
, but you can use Oh My Fish shell framework and install bang-bang
plugin to have this shortcut in Fish shell.
This can also be achieved by making this custom function:
function sudo
if test "$argv" = !!
eval command sudo $history[1]
else
command sudo $argv
end
end
Recommendations
Comments
Flagged Pros + Cons
Out of Date Pros + Cons
Con No support for '&&'., however using ';' in its place works perfectly fine
update: now supports && in latest version, so not really a CON anymore.