2006-11-23 02:53:33 +08:00
/** \mainpage Fish user documentation
2013-10-05 15:37:44 +08:00
\htmlonly <div class="fish_left_bar"> \endhtmlonly
2006-11-23 02:53:33 +08:00
@toc@
2013-10-05 15:37:44 +08:00
\htmlonly </div> \endhtmlonly
\htmlonly
<div class="fish_right_bar">
\endhtmlonly
2006-11-23 02:53:33 +08:00
2006-10-31 23:36:14 +08:00
\section introduction Introduction
2005-12-04 21:22:59 +08:00
This is the documentation for \c fish, the friendly interactive
2005-12-14 02:32:57 +08:00
shell. \c fish is a user friendly commandline shell intended
2005-12-04 21:22:59 +08:00
mostly for interactive use. A shell is a program used to execute other
programs. For the latest information on \c fish, please visit the <a
2012-12-27 18:17:14 +08:00
href="http://fishshell.com/"><code>fish</code> homepage</a>.
2005-09-20 21:31:55 +08:00
\section syntax Syntax overview
2005-12-04 21:22:59 +08:00
Shells like fish are used by giving them commands. Every \c fish
2005-12-04 10:33:53 +08:00
command follows the same simple syntax.
2005-09-20 21:31:55 +08:00
2005-12-04 10:33:53 +08:00
A command is executed by writing the name of the command followed by
any arguments.
2005-09-20 21:31:55 +08:00
Example:
2006-02-01 21:40:29 +08:00
<code>echo hello world</code>
2005-09-20 21:31:55 +08:00
calls the \c echo command. \c echo is a command which will write its
arguments to the screen. In the example above, the output will be
'hello world'. Everything in fish is done with commands. There are
2006-01-11 21:29:44 +08:00
commands for performing a set of commands multiple times, commands for
2005-09-20 21:31:55 +08:00
assigning variables, commands for treating a group of commands as a
single command, etc.. And every single command follows the same simple
syntax.
2006-12-09 09:19:11 +08:00
If you want to find out more about the echo command used above, read
2005-09-20 21:31:55 +08:00
the manual page for the echo command by writing:
2006-02-01 21:40:29 +08:00
<code>man echo</code>
2005-09-20 21:31:55 +08:00
2006-04-05 21:29:28 +08:00
\c man is a command for displaying a manual page on a given topic. The
man command takes the name of the manual page to display as an
argument. There are manual pages for almost every command on most
2005-09-20 21:31:55 +08:00
computers. There are also manual pages for many other things, such as
system libraries and important files.
2006-01-11 21:29:44 +08:00
Every program on your computer can be used as a command in \c fish. If
2005-09-20 21:31:55 +08:00
the program file is located in one of the directories in the <a
href="#variables-special">PATH</a>, it is sufficient to type the name
of the program to use it. Otherwise the whole filename, including the
2013-04-30 18:09:34 +08:00
directory (like \c /home/me/code/checkers/checkers or <code>../checkers</code>)
2005-09-20 21:31:55 +08:00
has to be used.
Here is a list of some useful commands:
- \c cd, change the current directory
2006-05-29 21:46:07 +08:00
- \c ls, list files and directories
- \c man, display a manual page on the screen
- \c mv, move (rename) files
2005-09-20 21:31:55 +08:00
- \c cp, copy files
- \c open, open files with the default application associated with each filetype
2010-09-18 10:18:26 +08:00
- \c less, list the contents of files
2005-09-20 21:31:55 +08:00
Commands and parameters are separated by the space character
( ). Every command ends with either a newline (i.e. by pressing
the return key) or a semicolon (;). More than one command can be
written on the same line by separating them with semicolons.
2006-04-05 21:29:28 +08:00
A switch is a very common special type of argument. Switches almost
always start with one or more hyphens (-) and alter the way a command
operates. For example, the \c ls command usually lists all the files
and directories in the current working directory, but by using the \c
2007-01-19 01:33:37 +08:00
-l switch, the behavior of ls is changed to not only display the
2006-04-05 21:29:28 +08:00
filename, but also the size, permissions, owner and modification time
of each file. Switches differ between commands and are documented in
2006-05-29 21:46:07 +08:00
the manual page for each command. Some switches are common to most
command though, for example '--help' will usually display a help text,
'-i' will often turn on interactive prompting before taking action,
while '-f' will turn it off.
2005-09-20 21:31:55 +08:00
\subsection quotes Quotes
2012-07-23 20:46:45 +08:00
Sometimes features such as <a href="#expand">parameter expansion</a>
2005-09-20 21:31:55 +08:00
and <a href="#escapes">character escapes</a> get in the way. When that
happens, the user can write a parameter within quotes, either '
2005-12-04 20:40:43 +08:00
(single quote) or " (double quote). There is one important difference
between single quoted and double quoted strings: When using double
2005-12-07 23:57:17 +08:00
quoted string, <a href='#expand-variable'>variable expansion</a> still
2006-02-13 00:13:31 +08:00
takes place. Other than that, a quoted parameter will not be parameter
expanded, may contain spaces, and escape sequences are ignored. The
only backslash escape accepted within single quotes is \\', which
2006-03-06 09:50:12 +08:00
escapes a single quote and \\\\, which escapes the backslash
symbol. The only backslash escapes accepted within double quotes are
\\", which escapes a double quote, \\$, which escapes a dollar
2012-11-22 17:09:07 +08:00
character, \\ followed by a newline, which deletes the backslash
and the newline, and lastly \\\\, which escapes the backslash symbol.
2013-04-23 21:40:48 +08:00
Single quotes have no special meaning within double quotes and vice versa.
2005-09-20 21:31:55 +08:00
Example:
2006-02-01 21:40:29 +08:00
<code>rm "cumbersome filename.txt"</code>
2005-09-20 21:31:55 +08:00
2006-01-11 21:29:44 +08:00
Will remove the file 'cumbersome filename.txt', while
2006-02-01 21:40:29 +08:00
<code>rm cumbersome filename.txt</code>
2006-01-11 21:29:44 +08:00
2006-02-13 00:13:31 +08:00
would remove the two files 'cumbersome' and 'filename.txt'.
2005-09-20 21:31:55 +08:00
\subsection escapes Escaping characters
Some characters can not be written directly on the command line. For
these characters, so called escape sequences are provided. These are:
2013-04-30 18:09:34 +08:00
- <code>'\\a'</code> escapes the alert character
- <code>'\\b'</code> escapes the backspace character
- <code>'\\e'</code> escapes the escape character
- <code>'\\f'</code> escapes the form feed character
- <code>'\\n'</code> escapes a newline character
- <code>'\\r'</code> escapes the carriage return character
- <code>'\\t'</code> escapes the tab character
- <code>'\\v'</code> escapes the vertical tab character
- <code>'\\ '</code> escapes the space character
- <code>'\\$'</code> escapes the dollar character
- <code>'\\\\'</code> escapes the backslash character
- <code>'\\*'</code> escapes the star character
- <code>'\\?'</code> escapes the question mark character
- <code>'\\~'</code> escapes the tilde character
- <code>'\\%%'</code> escapes the percent character
- <code>'\\#'</code> escapes the hash character
- <code>'\\('</code> escapes the left parenthesis character
- <code>'\\)'</code> escapes the right parenthesis character
- <code>'\\{'</code> escapes the left curly bracket character
- <code>'\\}'</code> escapes the right curly bracket character
- <code>'\\['</code> escapes the left bracket character
- <code>'\\]'</code> escapes the right bracket character
- <code>'\\\<'</code> escapes the less than character
- <code>'\\\>'</code> escapes the more than character
- <code>'\\^'</code> escapes the circumflex character
- <code>'\\&'</code> escapes the ampersand character
- <code>'\\;'</code> escapes the semicolon character
- <code>'\\"'</code> escapes the quote character
- <code>'\\''</code> escapes the apostrophe character
2007-01-17 00:48:34 +08:00
- <code>'\\x<i>xx</i>'</code>, where <code><i>xx</i></code> is a hexadecimal number, escapes the ascii character with the specified value. For example, \\x9 is the tab character.
2006-02-01 21:40:29 +08:00
- <code>'\\X<i>xx</i>'</code>, where <code><i>xx</i></code> is a hexadecimal number, escapes a byte of data with the specified value. If you are using a mutibyte encoding, this can be used to enter invalid strings. Only use this if you know what you are doing.
2007-01-17 00:48:34 +08:00
- <code>'\\<i>ooo</i>'</code>, where <code><i>ooo</i></code> is an octal number, escapes the ascii character with the specified value. For example, \\011 is the tab character.
2008-01-14 04:01:51 +08:00
- <code>'\\u<i>xxxx</i>'</code>, where <code><i>xxxx</i></code> is a hexadecimal number, escapes the 16-bit Unicode character with the specified value. For example, \\u9 is the tab character.
- <code>'\\U<i>xxxxxxxx</i>'</code>, where <code><i>xxxxxxxx</i></code> is a hexadecimal number, escapes the 32-bit Unicode character with the specified value. For example, \\U9 is the tab character.
2007-01-17 00:48:34 +08:00
- <code>'\\c<i>x</i>'</code>, where <code><i>x</i></code> is a letter of the alphabet, escapes the control sequence generated by pressing the control key and the specified letter. For example, \\ci is the tab character
2005-09-20 21:31:55 +08:00
2013-04-30 18:15:37 +08:00
\subsection redirects Input/Output (IO) redirection
2005-09-20 21:31:55 +08:00
2013-05-05 02:53:50 +08:00
Most programs use three input/output (IO) streams, each represented by
2005-09-20 21:31:55 +08:00
a number called a file descriptor (FD). These are:
2010-09-18 10:18:26 +08:00
- Standard input, FD 0, for reading, defaults to reading from the keyboard.
2005-09-20 21:31:55 +08:00
- Standard output, FD 1, for writing, defaults to writing to the screen.
2005-10-15 18:12:45 +08:00
- Standard error, FD 2, for writing errors and warnings, defaults to writing to the screen.
2005-09-20 21:31:55 +08:00
2006-02-01 21:40:29 +08:00
The reason for providing for two output file descriptors is to allow
separation of errors and warnings from regular program output.
2005-09-20 21:31:55 +08:00
2006-05-19 22:04:25 +08:00
Any file descriptor can be directed to a different output than its
2005-12-14 02:32:57 +08:00
default through a simple mechanism called a redirection.
2005-09-20 21:31:55 +08:00
2006-02-01 21:40:29 +08:00
An example of a file redirection is <code> echo hello \>output.txt</code>,
2013-05-10 20:29:38 +08:00
which directs the output of the echo command to the file output.txt.
2005-09-20 21:31:55 +08:00
2010-09-18 10:18:26 +08:00
- To redirect standard input, write <code>\<SOURCE_FILE</code>
- To redirect standard output, write <code>\>DESTINATION</code>
- To redirect standard error, write <code>^DESTINATION</code>
2006-02-01 21:40:29 +08:00
- To redirect standard output to a file which will be appended, write <code>\>\>DESTINATION_FILE</code>
2010-09-18 10:18:26 +08:00
- To redirect standard error to a file which will be appended, write <code>^^DESTINATION_FILE</code>
2005-09-20 21:31:55 +08:00
2010-09-18 10:18:26 +08:00
<code>DESTINATION</code> can be one of the following:
2005-09-20 21:31:55 +08:00
- A filename. The output will be written to the specified file.
2006-01-11 21:29:44 +08:00
- An ampersand (\&) followed by the number of another file descriptor. The file descriptor will be a duplicate of the specified file descriptor.
2006-02-01 05:45:51 +08:00
- An ampersand followed by a minus sign (\&-). The file descriptor will be closed.
2005-09-20 21:31:55 +08:00
Example:
To redirect both standard output and standard error to the file
2006-02-01 21:40:29 +08:00
all_output.txt, you can write <code>echo Hello \>all_output.txt
^\&1</code>.
2005-09-20 21:31:55 +08:00
Any FD can be redirected in an arbitrary way by prefixing the
redirection with the number of the FD.
2006-02-01 21:40:29 +08:00
- To redirect input of FD number N, write <code>N\<DESTINATION</code>
2010-09-18 10:18:26 +08:00
- To redirect output of FD number N, write <code>N\>DESTINATION</code>
2006-02-01 21:40:29 +08:00
- To redirect output of FD number N to a file which will be appended, write <code>N\>\>DESTINATION_FILE</code>
2005-09-20 21:31:55 +08:00
2006-02-01 21:40:29 +08:00
Example: <code>echo Hello 2\>-</code> and <code>echo Hello ^-</code> are
2005-09-20 21:31:55 +08:00
equivalent.
\subsection piping Piping
The user can string together multiple commands into a so called
pipeline. This means that the standard output of one command will be read
in as standard input into the next command. This is done by separating
2005-10-07 22:08:57 +08:00
the commands by the pipe character (|). For example
2005-09-20 21:31:55 +08:00
2006-02-01 21:40:29 +08:00
<code>cat foo.txt | head</code>
2005-09-20 21:31:55 +08:00
will call the 'cat' program with the parameter 'foo.txt', which will
print the contents of the file 'foo.txt'. The contents of foo.txt will
then be filtered through the program 'head', which will pass on the
first ten lines of the file to the screen. For more information on how
to combine commands through pipes, read the manual pages of the
commands you want to use using the 'man' command. If you want to find
2006-02-01 21:40:29 +08:00
out more about the 'cat' program, type <code>man cat</code>.
2005-09-20 21:31:55 +08:00
2005-10-07 22:08:57 +08:00
Pipes usually connect file descriptor 1 (standard output) of the first
process to file descriptor 0 (standard input) of the second
process. It is possible use a different output file descriptor by
2005-10-15 18:12:45 +08:00
prepending the desired FD number and then output redirect symbol to
the pipe. For example:
2005-10-07 22:08:57 +08:00
2006-02-01 21:40:29 +08:00
<code>make fish 2>|less</code>
2005-10-07 22:08:57 +08:00
will attempt to build the fish program, and any errors will be shown
using the less pager.
2005-09-20 21:31:55 +08:00
\subsection syntax-background Background jobs
When you start a job in \c fish, \c fish itself will pause, and give
control of the terminal to the program just started. Sometimes, you
want to continue using the commandline, and have the job run in the
2013-04-23 21:40:48 +08:00
background. To create a background job, append an \& (ampersand) to
2006-04-05 21:29:28 +08:00
your command. This will tell fish to run the job in the
background. Background jobs are very useful when running programs that
have a graphical user interface.
Example:
<code>emacs \&</code>
2010-09-18 10:18:26 +08:00
will start the emacs text editor in the background.
2005-09-20 21:31:55 +08:00
\subsection syntax-job-control Job control
2013-04-23 21:40:48 +08:00
Most programs allow you to suspend the program's execution and return
control to \c fish by pressing ^Z (press and hold the Control key and
2005-09-20 21:31:55 +08:00
press 'z'). Once back at the \c fish commandline, you can start other
2013-04-29 03:18:17 +08:00
programs and do anything you want. If you then want you can go back to
the suspended command by using the <a href="commands.html#fg">fg</a>
2013-04-30 18:15:37 +08:00
(foreground) command.
2005-09-20 21:31:55 +08:00
2006-04-05 21:29:28 +08:00
If you instead want to put a suspended job into the background, use
2006-10-31 23:36:14 +08:00
the <a href="commands.html#bg">bg</a> command.
2005-09-20 21:31:55 +08:00
To get a listing of all currently started jobs, use the <a
2006-10-31 23:36:14 +08:00
href="commands.html#jobs">jobs</a> command.
2005-09-20 21:31:55 +08:00
2013-04-30 18:19:23 +08:00
\subsection syntax-function Functions
2006-02-17 18:13:39 +08:00
2013-04-30 18:19:23 +08:00
Functions are programs written in the fish syntax. They group together one
or more commands and their arguments using a single name. It can also be
used to start a specific command with additional arguments.
2006-02-17 18:13:39 +08:00
2013-04-30 18:19:23 +08:00
For example, the following is a function definition that calls the command
\c ls with the argument '-l' to print a detailed listing
2006-02-17 18:13:39 +08:00
of the contents of the current directory:
<pre>
function ll
ls -l $argv
end
</pre>
2013-04-30 18:09:34 +08:00
The first line tells fish that a function by the name of \c ll is to be
2006-02-17 18:13:39 +08:00
defined. To use it, simply write <code>ll</code> on the
commandline. The second line tells fish that the command <code>ls -l
$argv</code> should be called when ll is invoked. $argv is an array
variable, which always contains all arguments sent to the function. In
the example above, these are simply passed on to the ls command. For
more information on functions, see the documentation for the <a
2006-10-31 23:36:14 +08:00
href='commands.html#function'>function</a> builtin.
2006-02-17 18:13:39 +08:00
2013-04-30 18:19:23 +08:00
\subsubsection syntax-function-wrappers Defining aliases
2006-11-11 18:52:08 +08:00
2013-04-18 16:52:04 +08:00
One of the most common uses for functions is to slightly alter the
2007-01-19 01:33:37 +08:00
behavior of an already existing command. For example, one might want
2006-11-11 18:52:08 +08:00
to redefine the \c ls command to display colors. The switch for
2013-04-30 18:19:23 +08:00
turning on colors on GNU systems is \c '--color=auto'. An alias, or
wrapper, around \c ls might look like this:
2006-11-11 18:52:08 +08:00
<pre>function ls
2013-01-02 05:56:08 +08:00
command ls --color=auto $argv
2006-11-11 18:52:08 +08:00
end
</pre>
2013-04-30 18:19:23 +08:00
There are a few important things that need to be noted about aliases:
- Always take care to add the \c $argv variable to the list of parameters to the wrapped command. This makes sure that if the user specifies any additional parameters to the function, they are passed on to the underlying command.
- If the alias has the same name as the aliased command, it is necessary to prefix the call to the program with \c command in order to tell fish that the function should not call itself, but rather a command with the same name. Failing to do so will cause infinite recursion bugs.
2006-11-11 18:52:08 +08:00
2013-04-30 18:19:23 +08:00
To easily create a function of this form, you can use the
<a href="commands.html#alias">alias</a> command.
2006-11-11 18:52:08 +08:00
\subsubsection syntax-function-autoloading Autoloading functions
2006-07-30 01:31:23 +08:00
2006-02-17 18:13:39 +08:00
Functions can be defined on the commandline or in a configuration
2006-07-30 01:31:23 +08:00
file, but they can also be automatically loaded. This method of
defining functions has several advantages. An autoloaded function
2013-04-30 18:15:37 +08:00
becomes available automatically to all running shells. If the function
2006-07-30 01:31:23 +08:00
definition is changed, all running shells will automatically reload
2013-04-30 18:15:37 +08:00
the altered version. Startup time and memory usage is improved, etc.
2006-07-30 01:31:23 +08:00
Fish automatically searches through any directories in the array
2013-04-30 18:09:34 +08:00
variable \c $fish_function_path, and any functions defined are
2006-07-30 01:31:23 +08:00
automatically loaded when needed. A function definition file must have
a filename consisting of the name of the function plus the suffix
'.fish'.
2006-02-17 18:13:39 +08:00
2013-04-30 18:09:34 +08:00
The default value for \c $fish_function_path is <code>~/.config/fish/functions
/etc/fish/functions /usr/share/fish/functions</code>. The exact path
2008-01-14 04:01:51 +08:00
to the last two of these may be slightly different depending on what
2006-07-30 01:31:23 +08:00
install path prefix was chosen at configuration time. The rationale
behind having three different directories is that the first one is for
user specific functions, the second one is for system-wide additional
functions and the last one is for default fish functions. The path
list is searched in order, meaning that by default, the system
administrator can override default fish functions, and the user can
override functions defined by the system administrator.
It is very important that function definition files only contain the
2013-04-30 18:15:37 +08:00
definition for the specified function and nothing else. Otherwise, it
2006-07-30 01:31:23 +08:00
is possible that autoloading a function files requires that the
2013-04-30 18:15:37 +08:00
function already be loaded, which creates a circular dependency.
2005-09-20 21:31:55 +08:00
2013-04-30 18:19:23 +08:00
\subsection syntax-conditional Conditional execution of code and flow control
2006-11-11 18:52:08 +08:00
There are four fish builtins that let you execute commands only if a
2010-09-18 10:18:26 +08:00
specific criterion is met. These builtins are
<a href="commands.html#if">if</a>,
<a href="commands.html#switch">switch</a>,
<a href="commands.html#and">and</a> and
2006-11-11 18:52:08 +08:00
<a href="commands.html#or">or</a>.
The \c switch command is used to execute one of possibly many blocks
of commands depending on the value of a string. See the documentation
for <a href="commands.html#switch">switch</a> for more information.
The other conditionals use the <a href='#variables-status'>exit
status</a> of a command to decide if a command or a block of commands
2010-09-18 10:18:26 +08:00
should be executed. See the documentation for
2006-11-11 18:52:08 +08:00
<a href="commands.html#if">if</a>, <a href="commands.html#and">and</a>
and <a href="commands.html#or">or</a> for more information.
2005-09-20 21:31:55 +08:00
\subsection syntax-words Some common words
This is a short explanation of some of the commonly used words in fish.
- argument, a parameter given to a command
2006-04-05 21:29:28 +08:00
- builtin, a command that is implemented in the shell. Builtins are commands that are so closely tied to the shell that it is impossible to implement them as external commands.
- command, a program that the shell can run.
2006-11-11 18:52:08 +08:00
- function, a block of commands that can be called as if they where a single command. By using functions, it is possible to string together multiple smaller commands into one more advanced command.
2005-09-20 21:31:55 +08:00
- job, a running pipeline or command
- pipeline, a set of commands stringed together so that the output of one command is the input of the next command
- redirection, a operation that changes one of the input/output streams associated with a job
2007-01-19 01:33:37 +08:00
- switch, a special flag sent as an argument to a command that will alter the behavior of the command. A switch almost always begins with one or two hyphens.
2005-09-20 21:31:55 +08:00
\section help Help
\c fish has an extensive help system. Use the <a
2013-04-30 18:09:34 +08:00
href="commands.html#help">help</a> command to obtain help on
2006-02-01 21:40:29 +08:00
a specific subject or command. For instance, writing <code>help
syntax</code> displays the <a href="#syntax">syntax section</a> of this
2005-09-20 21:31:55 +08:00
documentation.
2013-05-05 02:43:15 +08:00
fish also has man pages for its commands. For example, <code>man set</code>
will show the documentation for \c set as a man page.
2006-02-01 21:40:29 +08:00
Help on a specific builtin can also be obtained with the <code>-h</code>
2005-09-20 21:31:55 +08:00
parameter. For instance, to obtain help on the \c fg builtin, either
2006-02-01 21:40:29 +08:00
type <code>fg -h</code> or <code>help fg</code>.
2005-09-20 21:31:55 +08:00
2013-10-01 02:45:29 +08:00
\section autosuggestions Autosuggestions
fish suggests commands as you type, based on command history, completions,
and valid file paths. As you type commands, you will see a completion offered after the
cursor, in a muted gray color (which can be changed with the
<code>fish_color_autosuggestion</code> variable).
To accept the autosuggestion (replacing the command line contents),
2014-02-02 21:34:40 +08:00
press right arrow or Control-F. To accept the first suggested word, press
2014-02-10 17:28:47 +08:00
Alt-Right or Alt-F. If the autosuggestion is not what you want, just ignore it:
it won't execute unless you accept it.
2013-10-01 02:45:29 +08:00
Autosuggestions are a powerful way to quickly summon frequently entered commands, by
typing the first few characters. They are also an efficient technique for navigating
through directory hierarchies.
2005-09-20 21:31:55 +08:00
\section completion Tab completion
Tab completion is one of the most time saving features of any modern
shell. By tapping the tab key, the user asks \c fish to guess the rest
2006-01-11 21:29:44 +08:00
of the command or parameter that the user is currently typing. If \c
fish can only find one possible completion, \c fish will write it
out. If there is more than one completion, \c fish will write out the
2006-11-11 18:52:08 +08:00
longest prefix that all completions have in common. If the completions
differ on the first character, a list of all possible completions is
printed. The list features descriptions of the completions and if the
list doesn't fit the screen, it is scrollable by using the arrow keys,
the page up/page down keys, the tab key or the space bar. Pressing any
other key will exit the list and insert the pressed key into the
command line.
2005-09-20 21:31:55 +08:00
These are the general purpose tab completions that \c fish provides:
2013-04-30 18:15:37 +08:00
- Completion of commands (builtins, functions and regular programs).
2014-04-19 08:16:37 +08:00
- Completion of shell variable names.
2005-09-20 21:31:55 +08:00
- Completion of usernames for tilde expansion.
2006-10-29 00:32:29 +08:00
- Completion of filenames, even on strings with wildcards such as '*', '**' and '?'.
2013-05-10 20:29:38 +08:00
- Completion of job ID, job name and process names for <a href="#expand-process">process expansion</a>.
2005-09-20 21:31:55 +08:00
\c fish provides a large number of program specific completions. Most
of these completions are simple options like the \c -l option for \c
ls, but some are more advanced. The latter include:
2013-04-30 18:09:34 +08:00
- The programs \c man and \c whatis show all installed
2006-01-11 21:29:44 +08:00
manual pages as completions.
2013-04-30 18:09:34 +08:00
- The \c make program uses all targets in the Makefile in
2006-01-11 21:29:44 +08:00
the current directory as completions.
2013-04-30 18:09:34 +08:00
- The \c mount command uses all mount points specified in fstab as completions.
- The \c ssh command uses all hosts that are stored
in the known_hosts file as completions. (See the ssh documentation for more information)
- The \c su command uses all users on the system as completions.
2006-01-11 21:29:44 +08:00
- The \c apt-get, \c rpm and \c yum commands use all installed packages as completions.
2005-09-20 21:31:55 +08:00
2005-12-04 10:33:53 +08:00
\subsection completion-own Writing your own completions
2006-11-11 18:52:08 +08:00
Specifying your own completions is not difficult. To specify a
2006-01-11 21:29:44 +08:00
completion, use the \c complete command. \c complete takes
2005-12-04 10:27:40 +08:00
as a parameter the name of the command to specify a completion
for. For example, to add a completion for the program \c myprog, one
2006-02-01 21:40:29 +08:00
would start the completion command with <code>complete -c myprog
...</code>. To provide a list of possible completions for myprog, use
2005-12-04 10:27:40 +08:00
the \c -a switch. If \c myprog accepts the arguments start and stop,
2006-02-01 21:40:29 +08:00
this can be specified as <code>complete -c myprog -a 'start
stop'</code>. The argument to the \c -a switch is always a single
2005-12-04 10:27:40 +08:00
string. At completion time, it will be tokenized on spaces and tabs,
2005-12-07 23:57:17 +08:00
and variable expansion, command substitution and other forms of
2010-09-18 10:18:26 +08:00
parameter expansion will take place.
2005-12-04 10:27:40 +08:00
Fish has a special syntax to support specifying switches accepted by a
command. The switches \c -s, \c -l and \c -o are used to specify a
short switch (single character, such as -l), a gnu style long switch (such as
--color) and an old-style long switch (like -shuffle),
respectively. If the command 'myprog' has an option '-o' which can
also be written as '--output', and which can take an additional value
of either 'yes' or 'no', this can be specified by writing:
2006-02-01 21:40:29 +08:00
<code>complete -c myprog -s o -l output -a "yes no"</code>
2005-12-04 10:27:40 +08:00
There are also special switches for specifying that a switch requires
an argument, to disable filename completion, to create completions
that are only available in some combinations, etc.. For a complete
description of the various switches accepted by the \c complete
command, see the documentation for the <a
2006-10-31 23:36:14 +08:00
href="commands.html#complete">complete</a> builtin, or write 'complete
2005-12-04 10:27:40 +08:00
--help' inside the \c fish shell.
For examples of how to write your own complex completions, study the
2013-04-30 18:09:34 +08:00
completions in \c /usr/share/fish/completions. (The exact path depends on
2006-02-17 18:13:39 +08:00
your chosen installation prefix and may be slightly different)
2006-12-06 08:08:10 +08:00
\subsection completion-func Useful functions for writing completions
Fish ships with several functions that are very useful when writing
command specific completions. Most of these functions name begins with
the string '__fish_'. Such functions are internal to fish and their
name and interface may change in future fish versions. Still, some of
them may be very useful when writing completions. A few of these
functions are described here. Be aware that they may be removed or
changed in future versions of fish.
2007-01-19 01:33:37 +08:00
Functions beginning with the string '__fish_print_' print a
2006-12-06 08:08:10 +08:00
newline-separated list of strings. For example,
2007-01-19 01:33:37 +08:00
__fish_print_filesystems prints a list of all known file systems. Functions
2006-12-06 08:08:10 +08:00
beginning with '__fish_complete_' print out a newline separated list of
completions with descriptions. The description is separated from the
completion by a tab character.
2007-01-19 01:33:37 +08:00
<pre>__fish_complete_directories STRING DESCRIPTION</pre>
2006-12-06 08:08:10 +08:00
performs path completion on STRING, allowing only directories, and giving them the description DESCRIPTION.
<pre>__fish_complete_groups</pre>
prints a list of all user groups with the groups members as description.
<pre>__fish_complete_pids</pre>
2008-01-14 04:01:51 +08:00
prints a list of all processes IDs with the command name as description.
2006-12-06 08:08:10 +08:00
2007-02-09 01:03:39 +08:00
<pre>__fish_complete_suffix SUFFIX</pre>
2006-12-06 08:08:10 +08:00
2008-01-14 04:01:51 +08:00
performs file completion allowing only files ending in SUFFIX. The mimetype database is used to find a suitable description.
2006-12-06 08:08:10 +08:00
<pre>__fish_complete_users</pre>
prints a list of all users with their full name as description.
<pre>__fish_print_filesystems</pre>
2007-01-19 01:33:37 +08:00
prints a list of all known file systems. Currently, this is a static
list, and not dependent on what file systems the host operating system
2006-12-06 08:08:10 +08:00
actually understands.
<pre>__fish_print_hostnames</pre>
prints a list of all known hostnames. This functions searches the
fstab for nfs servers, ssh for known hosts and checks the /etc/hosts file.
<pre>__fish_print_interfaces</pre>
prints a list of all known network interfaces.
<pre>__fish_print_packages</pre>
prints a list of all installed packages. This function currently handles
2008-01-14 04:01:51 +08:00
Debian, rpm and Gentoo packages.
2006-12-06 08:08:10 +08:00
2006-02-17 18:13:39 +08:00
\subsection completion-path Where to put completions
Completions can be defined on the commandline or in a configuration
file, but they can also be automatically loaded. Fish automatically
searches through any directories in the array variable
2013-04-30 18:09:34 +08:00
\c $fish_complete_path, and any completions defined are automatically
2006-02-17 18:13:39 +08:00
loaded when needed. A completion file must have a filename consisting
of the name of the command to complete and the suffix '.fish'.
2013-04-30 18:09:34 +08:00
The default value for \c $fish_complete_path is <code>~/.config/fish/completions
/etc/fish/completions /usr/share/fish/completions</code>. The exact
2008-01-14 04:01:51 +08:00
path to the last two of these may be slightly different depending on
2006-02-17 18:13:39 +08:00
what install path prefix was chosen at configuration time. If a
suitable file is found in one of these directories, it will be
automatically loaded and the search will be stopped. The rationale
behind having three different directories is that the first one is for
user specific completions, the second one is for system-wide
completions and the last one is for default fish completions.
If you have written new completions for a common
2013-04-30 18:15:37 +08:00
Unix command, please consider sharing your work by submitting it via
the instructions in <a href="#more-help">Further help and development</a>.
2005-09-20 21:31:55 +08:00
2006-02-17 18:13:39 +08:00
2005-09-20 21:31:55 +08:00
\section expand Parameter expansion (Globbing)
When an argument for a program is given on the commandline, it
2005-12-07 23:57:17 +08:00
undergoes the process of parameter expansion before it is sent on to
2013-04-30 18:15:37 +08:00
the command. Parameter expansion is a powerful mechanism that
allows you to expand the parameter in various ways, including
2006-12-06 08:08:10 +08:00
performing wildcard matching on files, inserting the value of
2014-04-19 08:16:37 +08:00
a shell variable into the parameter or even using the output of
2006-12-06 08:08:10 +08:00
another command as a parameter list.
2005-09-20 21:31:55 +08:00
2010-09-18 10:18:26 +08:00
\subsection expand-wildcard Wildcards
2005-09-20 21:31:55 +08:00
If a star (*) or a question mark (?) is present in the parameter, \c
2005-12-14 02:32:57 +08:00
fish attempts to match the given parameter to any files in such a
2006-10-29 00:32:29 +08:00
way that:
2006-11-11 18:52:08 +08:00
- '?' can match any single character except '/'.
2006-10-29 00:32:29 +08:00
- '*' can match any string of characters not containing '/'. This includes matching an empty string.
- '**' matches any string of characters. This includes matching an empty string. The string may include the '/' character but does not need to.
2006-12-06 08:08:10 +08:00
Wildcard matches are sorted case insensitively. When sorting matches
2006-12-09 09:19:11 +08:00
containing numbers, consecutive digits are considered to be one
element, so that the strings '1' '5' and '12' would be sorted in the
order given.
2006-12-06 08:08:10 +08:00
2006-11-11 18:52:08 +08:00
File names beginning with a dot are not considered when wildcarding
unless a dot is specifically given as the first character of the file
name.
2006-10-29 00:32:29 +08:00
Examples:
2005-09-20 21:31:55 +08:00
<code>a*</code> matches any files beginning with an 'a' in the current directory.
<code>???</code> matches any file in the current directory whose name is exactly three characters long.
2006-10-29 00:32:29 +08:00
<code>**</code> matches any files and directories in the current directory and all of its subdirectories.
2013-04-30 18:15:37 +08:00
Note that if no matches are found for a specific wildcard, it will expand into
2005-12-04 00:43:56 +08:00
zero arguments, i.e. to nothing. If none of the wildcarded arguments
sent to a command result in any matches, the command will not be
executed. If this happens when using the shell interactively, a
warning will also be printed.
2005-09-20 21:31:55 +08:00
\subsection expand-command-substitution Command substitution
2013-04-30 18:15:37 +08:00
The output of a series of commands can be used as the parameters to another
command. If a parameter contains a set of parenthesis, the text enclosed by the
2006-12-06 08:08:10 +08:00
parenthesis will be interpreted as a list of commands. On expansion,
2005-09-20 21:31:55 +08:00
this list is executed, and substituted by the output. If the output is
more than one line long, each line will be expanded to a new
parameter.
2013-02-01 07:57:08 +08:00
The exit status of the last run command substitution is available in the <a
href='#variables-status'>status</a> variable.
2006-10-19 19:40:24 +08:00
2012-07-23 20:46:45 +08:00
Only part of the output can be used, see <a href='#expand-index-range'>index
range expansion</a> for details.
2013-04-30 18:15:37 +08:00
Examples:
2005-09-20 21:31:55 +08:00
2005-12-04 10:33:53 +08:00
The command <code>echo (basename image.jpg .jpg).png</code> will
output 'image.png'.
2005-09-20 21:31:55 +08:00
2006-02-01 21:40:29 +08:00
The command <code>for i in *.jpg; convert $i (basename $i .jpg).png;
2013-04-30 18:15:37 +08:00
end</code> will convert all JPEG files in the current directory to the
PNG format using the \c convert program.
2005-09-20 21:31:55 +08:00
\subsection expand-brace Brace expansion
2006-01-11 21:29:44 +08:00
A comma separated list of characters enclosed in curly braces will be
2005-09-20 21:31:55 +08:00
expanded so each element of the list becomes a new parameter.
Example:
2006-02-01 21:40:29 +08:00
<code>echo input.{c,h,txt}</code> outputs 'input.c input.h input.txt'
2005-09-20 21:31:55 +08:00
2006-02-01 21:40:29 +08:00
The command <code>mv *.{c,h} src/</code> moves all files with the suffix
2005-09-20 21:31:55 +08:00
'.c' or '.h' to the subdirectory src.
\subsection expand-variable Variable expansion
2014-04-19 08:16:37 +08:00
A dollar sign followed by a string of characters is expanded into the
value of the shell variable with the same name. For an
introduction to the concept of shell variables, read the
<a href="#variables">Shell variables</a> section.
2005-09-20 21:31:55 +08:00
2013-04-30 18:19:23 +08:00
Undefined and empty variables expand to nothing.
2005-09-20 21:31:55 +08:00
2013-04-30 18:19:23 +08:00
To separate a variable name from text it should immediately be followed by,
encase the variable within braces.
2005-09-20 21:31:55 +08:00
2013-04-30 18:19:23 +08:00
Examples:
<code>echo $HOME</code> prints the home directory of the current
2010-09-18 10:18:26 +08:00
user.
2005-12-07 21:03:30 +08:00
2013-04-30 18:19:23 +08:00
<code>echo $nonexistentvariable</code> prints no output.
<code>echo The plural of $WORD is {$WORD}s</code> prints "The plural of
cat is cats" when \c $WORD is set to cat. Note that without the braces, fish
will try to expand a variable called <code>$WORDs</code>, which may not exist.
The latter syntax works by exploiting <a href="#expand-brace">brace
expansion</a>; care should be taken with array variables and undefined
variables, as these behave very differently to POSIX shells.
2005-12-07 21:03:30 +08:00
2005-12-07 23:57:17 +08:00
Variable expansion is the only type of expansion performed on double
2005-12-04 20:40:43 +08:00
quoted strings. There is, however, an important difference in how
variables are expanded when quoted and when unquoted. An unquoted
2005-12-07 23:57:17 +08:00
variable expansion will result in a variable number of arguments. For
2005-12-04 20:40:43 +08:00
example, if the variable $foo has zero elements or is undefined, the
argument $foo will expand to zero elements. If the variable $foo is an
array of five elements, the argument $foo will expand to five
2005-12-07 23:57:17 +08:00
elements. When quoted, like "$foo", a variable expansion will always
2005-12-04 20:40:43 +08:00
result in exactly one argument. Undefined variables will expand to the
empty string, and array variables will be concatenated using the space
2013-04-30 18:19:23 +08:00
character. The dangers noted in the third example above can therefore be
avoided by wrapping the variable in double quotes
(<code>echo {"$WORD"}s</code>).
2005-12-04 20:40:43 +08:00
2006-03-02 19:51:08 +08:00
There is one further notable feature of fish variable
expansion. Consider the following code snippet:
<pre>
set foo a b c
set a 10; set b 20; set c 30
for i in (seq (count $$foo))
echo $$foo[$i]
end
# Output is:
# 10
# 20
# 30
</pre>
The above code demonstrates how to use multiple '$' symbols to expand
2006-12-06 08:08:10 +08:00
the value of a variable as a variable name. One can think of
2013-04-30 18:09:34 +08:00
the $ symbol as a variable dereference operator. When using this
2006-03-02 19:51:08 +08:00
feature together with array brackets, the brackets will always match
2013-04-30 18:09:34 +08:00
the innermost $ dereference. Thus, <code>$$foo[5]</code> will always mean the fifth
element of the \c foo variable should be dereferenced, not the fifth
element of the doubly dereferenced variable \c foo. The latter can
instead be expressed as <code>$$foo[1][5]</code>.
2005-12-07 21:03:30 +08:00
2012-07-23 20:46:45 +08:00
\subsection expand-index-range Index range expansion
2014-04-19 08:16:37 +08:00
Both command substitution and shell variable expansion support accessing only
2012-07-23 20:46:45 +08:00
specific items by providing a set of indices in square brackets. It's
2013-04-30 18:09:34 +08:00
often needed to access a sequence of elements. To do this, use the range
operator '..' for this. A range <code>'a..b'</code>, where range limits 'a'
and 'b' are integer numbers, is expanded into a sequence of indices
2012-07-23 20:46:45 +08:00
'a a+1 a+2 ... b' or 'a a-1 a-2 ... b' depending on which of 'a' or 'b'
is higher. The negative range limits are calculated from the end of the array
or command substitution.
Some examples:
<pre>
# Limit the command substitution output
echo (seq 10)[2..5] # will use elements from 2 to 5
# Output is:
# 2 3 4 5
# Use overlapping ranges:
echo (seq 10)[2..5 1..3] # will take elements from 2 to 5 and then elements from 1 to 3
# Output is:
# 2 3 4 5 1 2 3
# Reverse output
echo (seq 10)[-1..1] # will use elements from the last output line to the first one in reverse direction
# Output is:
# 10 9 8 7 6 5 4 3 2 1
</pre>
The same works when setting or expanding variables:
<pre>
# Reverse path variable
set PATH $PATH[-1..1]
# or
set PATH[-1..1] $PATH
# Use only n last items of the PATH
set n -3
echo $PATH[$n..-1]
</pre>
2013-04-30 18:15:37 +08:00
Note that variables can be used as indices for expansion of variables, but not
command substitution.
2012-07-23 20:46:45 +08:00
2005-09-20 21:31:55 +08:00
\subsection expand-home Home directory expansion
The ~ (tilde) character at the beginning of a parameter, followed by a
username, is expanded into the home directory of the specified user. A
lone ~, or a ~ followed by a slash, is expanded into the home
directory of the process owner.
\subsection expand-process Process expansion
The \% (percent) character at the beginning of a parameter followed by
2013-04-30 18:15:37 +08:00
a string is expanded into a process ID (PID). The following expansions are
2005-09-20 21:31:55 +08:00
performed:
2013-04-30 18:15:37 +08:00
- If the string is the entire word \c self, the shell's PID is the result.
- Otherwise, if the string is the ID of a job, the result is the process
group ID of the job.
2010-09-18 10:18:26 +08:00
- Otherwise, if any child processes match the specified string, their
2013-04-30 18:15:37 +08:00
PIDs are the result of the expansion.
2010-09-18 10:18:26 +08:00
- Otherwise, if any processes owned by the user match the specified
2013-04-30 18:15:37 +08:00
string, their PIDs are the result of the expansion.
- If none of these matches apply, an error is produced.
2005-09-20 21:31:55 +08:00
This form of expansion is useful for commands like kill and fg, which
2013-04-30 18:15:37 +08:00
take process IDs as arguments.
2005-09-20 21:31:55 +08:00
Example:
2006-02-01 21:40:29 +08:00
<code>fg \%ema</code> will search for a process whose command line begins
2005-09-20 21:31:55 +08:00
with the letters 'ema', such as emacs, and if found, put it in the
foreground.
2006-02-01 21:40:29 +08:00
<code>kill -s SIGINT \%3</code> will send the SIGINT signal to the job
2013-04-30 18:15:37 +08:00
with job ID 3.
2005-09-20 21:31:55 +08:00
\subsection combine Combining different expansions
All of the above expansions can be combined. If several expansions
result in more than one parameter, all possible combinations are
created.
2006-12-06 08:08:10 +08:00
When combining multiple parameter expansions, expansions are performed in the following order:
- Command substitutions
- Variable expansions
- Bracket expansion
- Pid expansion
- Wildcard expansion
Expansions are performed from right to left, nested bracket expansions
are performed from the inside and out.
2005-09-20 21:31:55 +08:00
Example:
If the current directory contains the files 'foo' and 'bar', the command
2006-02-01 21:40:29 +08:00
<code>echo a(ls){1,2,3} </code>
2005-09-20 21:31:55 +08:00
will output 'abar1 abar2 abar3 afoo1 afoo2 afoo3'.
2014-04-19 08:16:37 +08:00
\section variables Shell variables
2005-09-20 21:31:55 +08:00
2014-04-19 08:16:37 +08:00
Shell variables are named pieces of data, which can be created, deleted
and their values changed and used by the user. Variables may optionally be "exported", so
that a copy of the variable is available to any subprocesses the shell creates. An
exported variable is referred to as an "environment variable".
2005-09-20 21:31:55 +08:00
2006-10-31 23:36:14 +08:00
To set a variable value, use the <a href="commands.html#set"> \c set
2005-09-20 21:31:55 +08:00
command</a>.
2010-09-18 10:18:26 +08:00
Example:
2005-09-20 21:31:55 +08:00
2007-03-25 03:16:46 +08:00
To set the variable \c smurf_color to the value \c blue, use the command
<code>set smurf_color blue</code>.
2005-09-20 21:31:55 +08:00
After a variable has been set, you can use the value of a variable in
2013-08-07 11:26:57 +08:00
the shell through <a href="#expand-variable">variable expansion</a>.
2005-09-20 21:31:55 +08:00
Example:
2008-01-14 04:01:51 +08:00
To use the value of the variable \c smurf, write $ (dollar symbol)
2006-02-01 21:40:29 +08:00
followed by the name of the variable, like <code>echo Smurfs are
2007-03-25 03:16:46 +08:00
usually $smurf_color</code>, which would print the result 'Smurfs are
usually blue'.
2005-09-20 21:31:55 +08:00
\subsection variables-scope Variable scope
2013-04-30 18:15:37 +08:00
There are three kinds of variables in fish: universal, global and
2005-09-20 21:31:55 +08:00
local variables. Universal variables are shared between all fish
sessions a user is running on one computer. Global variables are
2005-12-04 21:22:59 +08:00
specific to the current fish session, but are not associated with any
2005-12-14 02:32:57 +08:00
specific block scope, and will never be erased unless the user
2006-02-01 21:40:29 +08:00
explicitly requests it using <code>set -e</code>. Local variables are
2005-12-04 21:22:59 +08:00
specific to the current fish session, and associated with a specific
block of commands, and is automatically erased when a specific block
goes out of scope. A block of commands is a series of commands that
2013-04-30 18:09:34 +08:00
begins with one of the commands \c for, \c while , \c if, \c
function, \c begin or \c switch, and ends with the command \c
end. The user can specify that a variable should have either global
2005-12-04 21:22:59 +08:00
or local scope using the \c -g/--global or \c -l/--local switches.
2005-09-20 21:31:55 +08:00
Variables can be explicitly set to be universal with the \c -U or \c
--universal switch, global with the \c -g or \c --global switch, or
local with the \c -l or \c --local switch. The scoping rules when
creating or updating a variable are:
2006-06-04 07:15:17 +08:00
-# If a variable is explicitly set to either universal, global or local, that setting will be honored. If a variable of the same name exists in a different scope, that variable will not be changed.
-# If a variable is not explicitly set to be either universal, global or local, but has been previously defined, the variable scope is not changed.
2012-12-29 23:39:41 +08:00
-# If a variable is not explicitly set to be either universal, global or local and has never before been defined, the variable will be local to the currently executing function. Note that this is different from using the \c -l or \c --local flag. If one of those flags is used, the variable will be local to the most inner currently executing block, while without these the variable will be local to the function. If no function is executing, the variable will be global.
2005-09-20 21:31:55 +08:00
2005-12-04 21:22:59 +08:00
There may be many variables with the same name, but different scopes.
2005-09-20 21:31:55 +08:00
When using a variable, the variable scope will be searched from the
inside out, i.e. a local variable will be used rather than a global
variable with the same name, a global variable will be used rather
than a universal variable with the same name.
2005-12-04 21:22:59 +08:00
Example:
The following code will not output anything:
2005-09-20 21:31:55 +08:00
<pre>
2005-12-07 21:03:30 +08:00
begin
2005-09-20 21:31:55 +08:00
# This is a nice local scope where all variables will die
2005-12-04 10:27:40 +08:00
set -l pirate 'There be treasure in them thar hills'
2005-09-20 21:31:55 +08:00
end
2005-12-07 21:03:30 +08:00
# This will not output anything, since the pirate was local
2005-09-20 21:31:55 +08:00
echo $pirate
</pre>
\subsection variables-universal More on universal variables
Universal variables are variables that are shared between all the
2006-05-19 22:04:25 +08:00
users fish sessions on the computer. Fish stores many of its
2005-09-20 21:31:55 +08:00
configuration options as universal variables. This means that in order
to change fish settings, all you have to do is change the variable
value once, and it will be automatically updated for all sessions, and
preserved across computer reboots and login/logout.
To see universal variables in action, start two fish sessions side by
2006-02-01 21:40:29 +08:00
side, and issue the following command in one of them <code>set
fish_color_cwd blue</code>. Since \c fish_color_cwd is a universal
2005-09-20 21:31:55 +08:00
variable, the color of the current working directory listing in the
prompt will instantly change to blue on both terminals.
\subsection variables-functions Variable scope for functions
2013-04-30 18:15:37 +08:00
When calling a function, all current local variables temporarily
2005-12-14 02:32:57 +08:00
disappear. This shadowing of the local scope is needed since the
2005-09-20 21:31:55 +08:00
variable namespace would become cluttered, making it very easy to
2005-12-14 02:32:57 +08:00
accidentally overwrite variables from another function.
2005-09-20 21:31:55 +08:00
For example, the following code will output 'Avast, mateys':
<pre>
function shiver
set phrase 'Shiver me timbers'
end
function avast
set phrase 'Avast, mateys'
# Calling the shiver function here can not change any variables
# in the local scope
shiver
echo $phrase
end
avast
</pre>
\subsection variables-export Exporting variables
Variables in fish can be exported. This means the variable will be
inherited by any commands started by fish. It is convention that
exported variables are in uppercase and unexported variables are in
lowercase.
2005-10-23 18:22:32 +08:00
Variables can be explicitly set to be exported with the \c -x or \c
2005-09-20 21:31:55 +08:00
--export switch, or not exported with the \c -u or \c --unexport
switch. The exporting rules when creating or updating a variable are
identical to the scoping rules for variables:
2006-06-04 07:15:17 +08:00
-# If a variable is explicitly set to either be exported or not exported, that setting will be honored.
-# If a variable is not explicitly set to be exported or not exported, but has been previously defined, the previous exporting rule for the variable is kept.
2008-01-09 05:36:00 +08:00
-# If a variable is not explicitly set to be either exported or not exported and has never before been defined, the variable will not be exported.
2005-09-20 21:31:55 +08:00
\subsection variables-arrays Arrays
\c fish can store a list of multiple strings inside of a variable. To
access one element of an array, use the index of the element inside of
square brackets, like this:
<pre>
echo $PATH[3]
</pre>
2006-02-11 08:15:46 +08:00
Note that array indices start at 1 in fish, not 0, as is more common
2013-04-30 18:09:34 +08:00
in other languages. This is because many common Unix tools like \c seq
2010-09-18 10:18:26 +08:00
are more suited to such use.
2006-02-11 08:15:46 +08:00
2005-09-20 21:31:55 +08:00
If you do not use any brackets, all the elements of the array will be
written as separate items. This means you can easily iterate over an
array using this syntax:
<pre>
for i in $PATH; echo $i is in the path; end
</pre>
To create a variable \c smurf, containing the items \c blue and \c
small, simply write:
<pre>
set smurf blue small
</pre>
It is also possible to set or erase individual elements of an array:
<pre>
\#Set smurf to be an array with the elements 'blue' and 'small'
set smurf blue small
\#Change the second element of smurf to 'evil'
set smurf[2] evil
\#Erase the first element
set -e smurf[1]
\#Output 'evil'
echo $smurf
</pre>
2006-06-04 17:42:03 +08:00
If you specify a negative index when expanding or assigning to an
array variable, the index will be calculated from the end of the
array. For example, the index -1 means the last index of an array.
2012-07-23 20:46:45 +08:00
A range of indices can be specified, see <a href='#expand-index-range'>index
range expansion</a> for details.
2013-04-30 18:19:23 +08:00
All arrays are one-dimensional and cannot contain other arrays, although
it is possible to fake nested arrays using the dereferencing rules of
<a href="#expand-variable">variable expansion</a>.
2005-09-20 21:31:55 +08:00
\subsection variables-special Special variables
The user can change the settings of \c fish by changing the values of
2006-01-09 22:44:18 +08:00
certain environment variables.
2005-09-20 21:31:55 +08:00
2013-04-30 18:15:37 +08:00
- \c BROWSER, the user's preferred web browser. If this variable is set, fish will use the specified browser instead of the system default browser to display the fish documentation.
- \c CDPATH, an array of directories in which to search for the new directory for the \c cd builtin. By default, the fish configuration defines \c CDPATH to be a universal variable with the values \c . and \c ~.
2006-05-28 18:54:37 +08:00
- A large number of variable starting with the prefixes \c fish_color and \c fish_pager_color. See <a href='#variables-color'>Variables for changing highlighting colors</a> for more information.
2013-04-30 18:15:37 +08:00
- \c fish_greeting, the greeting message printed on startup.
2006-05-28 18:54:37 +08:00
- \c LANG, \c LC_ALL, \c LC_COLLATE, \c LC_CTYPE, \c LC_MESSAGES, \c LC_MONETARY, \c LC_NUMERIC and \c LC_TIME set the language option for the shell and subprograms. See the section <a href='#variables-locale'>Locale variables</a> for more information.
2013-06-22 23:22:05 +08:00
- \c fish_user_paths, an array of directories that are prepended to PATH. This can be a universal variable.
2013-04-30 18:15:37 +08:00
- \c PATH, an array of directories in which to search for commands
- \c umask, the current file creation mask. The preferred way to change the umask variable is through the <a href="commands.html#umask">umask function</a>. An attempt to set umask to an invalid value will always fail.
2005-09-20 21:31:55 +08:00
\c fish also sends additional information to the user through the
2013-04-30 18:15:37 +08:00
values of certain environment variables. The user cannot change the
2010-09-18 10:18:26 +08:00
values of most of these variables.
2005-09-20 21:31:55 +08:00
2013-04-30 18:15:37 +08:00
- \c _, the name of the currently running command.
- \c argv, an array of arguments to the shell or function. \c argv is only defined when inside a function call, or if fish was invoked with a list of arguments, like 'fish myscript.fish foo bar'. This variable can be changed by the user.
2013-05-05 02:47:07 +08:00
- \c history, an array containing the last commands that were entered.
2013-04-30 18:15:37 +08:00
- \c HOME, the user's home directory. This variable can only be changed by the root user.
- \c PWD, the current working directory.
- \c status, the <a href="#variables-status">exit status</a> of the last foreground job to exit. If the job was terminated through a signal, the exit status will be 128 plus the signal number.
- \c USER, the current username. This variable can only be changed by the root user.
2005-09-20 21:31:55 +08:00
2008-01-09 03:41:27 +08:00
The names of these variables are mostly derived from the csh family of
shells and differ from the ones used by Bourne style shells such as
2013-04-30 18:19:23 +08:00
bash.
2008-01-09 03:41:27 +08:00
2005-10-23 18:22:32 +08:00
Variables whose name are in uppercase are exported to the commands
2013-04-30 18:15:37 +08:00
started by fish, while those in lowercase are not exported. This rule is not
2006-05-03 00:29:50 +08:00
enforced by fish, but it is good coding practice to use casing to
distinguish between exported and unexported variables. \c fish also
uses several variables internally. Such variables are prefixed with
2013-04-30 18:09:34 +08:00
the string \c __FISH or \c __fish. These should never be used by the
2007-10-06 18:55:27 +08:00
user. Changing their value may break fish.
2005-09-20 21:31:55 +08:00
2006-10-09 09:21:02 +08:00
\subsection variables-status The status variable
Whenever a process exits, an exit status is returned to the program
2006-11-02 21:47:25 +08:00
that started it (usually the shell). This exit status is an integer
number, which tells the calling application how the execution of the
command went. In general, a zero exit status means that the command
executed without problem, but a non-zero exit status means there was
some form of problem.
2006-10-09 09:21:02 +08:00
Fish stores the exit status of the last process in the last job to
exit in the \c status variable.
2013-04-30 18:09:34 +08:00
If \c fish encounters a problem while executing a command, the status
2006-10-09 09:21:02 +08:00
variable may also be set to a specific value:
2013-04-30 18:15:37 +08:00
- 1 is the generally the exit status from fish builtin commands if they were supplied with invalid arguments
2008-01-09 03:31:45 +08:00
- 124 means that the command was not executed because none of the wildcards in the command produced any matches
- 125 means that while an executable with the specified name was located, the operating system could not actually execute the command
- 126 means that while a file with the specified name was located, it was not executable
2006-11-02 21:47:25 +08:00
- 127 means that no function, builtin or command with the given name could be located
2006-10-09 09:21:02 +08:00
2009-02-22 00:46:56 +08:00
If a process exits through a signal, the exit status will be 128 plus the number of the signal.
2006-05-28 18:54:37 +08:00
\subsection variables-color Variables for changing highlighting colors
The colors used by fish for syntax highlighting can be configured by
changing the values of a various variables. The value of these
variables can be one of the colors accepted by the <a
2006-06-17 21:07:08 +08:00
href='commands.html#set_color'>set_color</a> command. The \c --bold
2006-05-28 18:54:37 +08:00
or \c -b switches accepted by \c set_color are also accepted.
2008-01-14 04:01:51 +08:00
The following variables are available to change the highlighting colors
2006-05-28 18:54:37 +08:00
in fish:
- \c fish_color_normal, the default color
- \c fish_color_command, the color for commands
- \c fish_color_quote, the color for quoted blocks of text
- \c fish_color_redirection, the color for IO redirections
- \c fish_color_end, the color for process separators like ';' and '&'
- \c fish_color_error, the color used to highlight potential errors
- \c fish_color_param, the color for regular command parameters
- \c fish_color_comment, the color used for code comments
- \c fish_color_match, the color used to highlight matching parenthesis
- \c fish_color_search_match, the color used to highlight history search matches
- \c fish_color_operator, the color for parameter expansion operators like '*' and '~'
- \c fish_color_escape, the color used to highlight character escapes like '\\n' and '\\x70'
- \c fish_color_cwd, the color used for the current working directory in the default prompt
Additionally, the following variables are available to change the
highlighting in the completion pager:
- \c fish_pager_color_prefix, the color of the prefix string, i.e. the string that is to be completed
- \c fish_pager_color_completion, the color of the completion itself
- \c fish_pager_color_description, the color of the completion description
- \c fish_pager_color_progress, the color of the progress bar at the bottom left corner
2012-06-27 11:17:00 +08:00
- \c fish_pager_color_secondary, the background color of the every second completion
2006-05-28 18:54:37 +08:00
Example:
To make errors highlighted and red, use:
2006-06-17 21:07:08 +08:00
<code>set fish_color_error red --bold</code>
2006-05-28 18:54:37 +08:00
2006-01-09 07:00:49 +08:00
\subsection variables-locale Locale variables
The most common way to set the locale to use a command like 'set -x
2007-01-19 01:33:37 +08:00
LANG en_GB.utf8', which sets the current locale to be the English
2006-01-09 22:48:13 +08:00
language, as used in Great Britain, using the UTF-8 character set. For
2006-01-09 07:00:49 +08:00
a list of available locales, use 'locale -a'.
2006-01-11 01:49:07 +08:00
\c LANG, \c LC_ALL, \c LC_COLLATE, \c LC_CTYPE, \c LC_MESSAGES, \c
2006-01-09 07:00:49 +08:00
LC_MONETARY, \c LC_NUMERIC and LC_TIME set the language option for the
shell and subprograms. These variables work as follows: \c LC_ALL
forces all the aspects of the locale to the specified value. If LC_ALL
is set, all other locale variables will be ignored. The other LC_
2006-01-09 22:48:13 +08:00
variables set the specified aspect of the locale information. LANG
2006-01-09 07:00:49 +08:00
is a fallback value, it will be used if none of the LC_ variables are
specified.
2013-04-30 18:19:23 +08:00
\section builtin-overview Builtin commands
2005-09-20 21:31:55 +08:00
Many other shells have a large library of builtin commands. Most of
these commands are also available as standalone commands, but have
2013-04-30 18:19:23 +08:00
been implemented in the shell anyway. To avoid
2005-09-20 21:31:55 +08:00
code duplication, and to avoid the confusion of subtly differing
2013-04-30 18:19:23 +08:00
versions of the same command, \c fish generally only implements builtins for
2005-09-20 21:31:55 +08:00
actions which cannot be performed by a regular command.
2006-11-02 21:47:25 +08:00
For a list of all builtins, functions and commands shipped with fish,
see the <a href="#toc-commands">table of contents</a>. The
documentation is also available by using the <code>--help</code>
switch of the command.
2005-09-20 21:31:55 +08:00
2013-04-30 18:15:37 +08:00
\section editor Command line editor
2005-09-20 21:31:55 +08:00
The \c fish editor features copy and paste, a searchable history and
2005-09-26 10:01:57 +08:00
many editor functions that can be bound to special keyboard
2013-04-30 18:19:23 +08:00
shortcuts.
2005-09-26 10:01:57 +08:00
Here are some of the commands available in the editor:
2013-08-07 11:18:31 +08:00
- Tab <a href="#completion">completes</a> the current token.
- Home or Ctrl-A moves the cursor to the beginning of the line.
- End or Ctrl-E moves to the end of line. If the cursor is already at the end of the line, and an autosuggestion is available, End or Ctrl-E accepts the autosuggestion.
- Left (or Ctrl-B) and Right (or Ctrl-F) move the cursor left or right by one character. If the cursor is already at the end of the line, and an autosuggestion is available, the Right key and the Ctrl-F combination accept the suggestion.
2014-02-10 17:28:47 +08:00
- Alt-Left and Alt-Right move the cursor one word left or right, or moves forward/backward in the directory history if the command line is empty. If the cursor is already at the end of the line, and an autosuggestion is available, Alt-Right (or Alt-F) accepts the first word in the suggestion.
2013-04-30 18:15:37 +08:00
- Up and Down search the command history for the previous/next command containing the string that was specified on the commandline before the search was started. If the commandline was empty when the search started, all commands match. See the <a href='#history'>history </a>section for more information on history searching.
- Alt-Up and Alt-Down search the command history for the previous/next token containing the token under the cursor before the search was started. If the commandline was not on a token when the search started, all tokens match. See the <a href='#history'>history </a>section for more information on history searching.
2013-08-07 11:18:31 +08:00
- Delete and Backspace removes one character forwards or backwards respectively.
- Ctrl-C deletes the entire line.
- Ctrl-D delete one character to the right of the cursor. If the command line is empty, Ctrl-D will exit fish.
- Ctrl-K moves contents from the cursor to the end of line to the <a href="#killring">killring</a>.
- Ctrl-U moves contents from the beginning of line to the cursor to the <a href="#killring">killring</a>.
- Ctrl-L clears and repaints the screen.
- Ctrl-W moves the previous word to the <a href="#killring">killring</a>.
- Alt-D moves the next word to the <a href="#killring">killring</a>.
- Alt-W prints a short description of the command under the cursor.
- Alt-L lists the contents of the current directory, unless the cursor is over a directory argument, in which case the contents of that directory will be listed.
2013-04-30 18:15:37 +08:00
- Alt-P adds the string <code>'| less;'</code> to the end of the job under the cursor. The result is that the output of the command will be paged.
2013-09-13 11:58:31 +08:00
- Alt-C capitalizes the current word.
2013-09-13 13:43:36 +08:00
- Alt-U makes the current word uppercase.
2013-11-09 20:12:53 +08:00
- F1 shows the manual page for the current command, if one exists.
2005-09-20 21:31:55 +08:00
2010-09-18 10:18:26 +08:00
You can change these key bindings using the
<a href="commands.html#bind">bind</a> builtin command.
2005-09-20 21:31:55 +08:00
2010-09-18 10:18:26 +08:00
\subsection killring Copy and paste (Kill Ring)
2005-09-20 21:31:55 +08:00
\c fish uses an Emacs style kill ring for copy and paste
functionality. Use Ctrl-K to cut from the current cursor position to
the end of the line. The string that is cut (a.k.a. killed) is
inserted into a linked list of kills, called the kill ring. To paste
the latest value from the kill ring use Ctrl-Y. After pasting, use
Meta-Y to rotate to the previous kill.
2013-04-30 18:15:37 +08:00
If the environment variable DISPLAY is set and the \c xsel program is installed, \c fish will try to
connect to the X Windows server specified by this variable, and use
2010-09-18 10:18:26 +08:00
the clipboard on the X server for copying and pasting.
2005-09-20 21:31:55 +08:00
\subsection history Searchable history
After a command has been entered, it is inserted at the end of a
history list. Any duplicate history items are automatically
removed. By pressing the up and down keys, the user can search
forwards and backwards in the history. If the current command line is
2005-12-04 20:40:43 +08:00
not empty when starting a history search, only the commands containing
the string entered into the command line are shown.
2005-09-20 21:31:55 +08:00
2013-04-30 18:15:37 +08:00
By pressing Alt-Up and Alt-Down, a history search is also performed,
2005-12-09 12:04:43 +08:00
but instead of searching for a complete commandline, each commandline
2013-04-30 18:19:23 +08:00
is broken into separate elements just like it would be before
execution, and the history is searched for an element matching that under
the cursor.
2005-12-09 12:04:43 +08:00
History searches can be aborted by pressing the escape key.
2013-03-09 08:15:09 +08:00
Prefixing the commandline with a space will prevent the entire line
from being stored in the history.
2013-05-10 20:29:38 +08:00
The history is stored in the file <code>~/.config/fish/fish_history</code>.
2005-09-20 21:31:55 +08:00
2013-04-30 18:19:23 +08:00
Examples:
2005-09-20 21:31:55 +08:00
2013-04-30 18:09:34 +08:00
To search for previous entries containing the word \c 'make', type \c 'make'
2005-09-20 21:31:55 +08:00
in the console and press the up key.
2013-04-30 18:19:23 +08:00
If the commandline reads '<code>cd m</code>', place the cursor over the \c m
character and press Alt-Up to search for previously typed words containing 'm'.
2006-10-29 00:32:29 +08:00
\subsection multiline Multiline editing
The fish commandline editor can be used to work on commands that are
several lines long. There are three ways to make a command span more
than a single line:
2013-04-30 18:15:37 +08:00
- Pressing the Enter key while a block of commands is unclosed, such as when one or more block commands such as \c 'for', \c 'begin' or \c 'if' do not have a corresponding \c 'end' command.
- Pressing Alt-Enter instead of pressing the Enter key.
- By inserting a backslash (\\) character before pressing the Enter key, escaping the newline.
2006-10-29 00:32:29 +08:00
The fish commandline editor works exactly the same in single line mode
and in multiline mode. To move between lines use the left and right
arrow keys and other such keyboard shortcuts.
2005-09-20 21:31:55 +08:00
\section job-control Running multiple programs
2005-12-04 20:40:43 +08:00
Normally when \c fish starts a program, this program will be put in
the foreground, meaning it will take control of the terminal and \c
fish will be stopped until the program finishes. Sometimes this is not
desirable. For example, you may wish to start an application with a
graphical user interface from the terminal, and then be able to
continue using the shell. In such cases, there are several ways in
2007-01-19 01:33:37 +08:00
which the user can change <code>fish</code>'s behavior.
2005-09-20 21:31:55 +08:00
2010-09-18 10:18:26 +08:00
-# By ending a command with the \& (ampersand) symbol, the user tells \c fish to put the specified command into the background. A background process will be run simultaneous with \c fish. \c fish will retain control of the terminal, so the program will not be able to read from the keyboard.
2013-05-10 20:29:38 +08:00
-# By pressing ^Z, the user stops a currently running foreground program and returns control to \c fish. Some programs do not support this feature, or remap it to another key. GNU Emacs uses ^X z to stop running.
2006-10-31 23:36:14 +08:00
-# By using the <a href="commands.html#fg">fg</a> and <a href="commands.html#bg">bg</a> builtin commands, the user can send any currently running job into the foreground or background.
2005-09-20 21:31:55 +08:00
2013-05-10 23:06:29 +08:00
Note that functions cannot be started in the background. Functions that
are stopped and then restarted in the background using the \c bg command
will not execute correctly.
2005-09-20 21:31:55 +08:00
\section initialization Initialization files
2006-10-19 19:50:23 +08:00
On startup, \c fish evaluates the files /usr/share/fish/config.fish
(Or /usr/local/fish... if you installed fish in /usr/local),
/etc/fish/config.fish (Or ~/etc/fish/... if you installed fish in your
home directory) and ~/.config/fish/config.fish (Or any other directory
specified by the \$XDG_CONFIG_HOME variable), in that order. The first
file should not be directly edited, the second one is meant for
systemwide configuration and the last one is meant for user
configuration. If you want to run a command only on starting an
interactive shell, use the exit status of the command 'status
--is-interactive' to determine if the shell is interactive. If you
want to run a command only when using a login shell, use 'status
--is-login' instead.
2005-12-04 20:40:43 +08:00
2006-02-01 21:40:29 +08:00
Examples:
2005-12-04 20:40:43 +08:00
If you want to add the directory ~/linux/bin to your PATH variable
2006-10-19 19:50:23 +08:00
when using a login shell, add the following to your ~/.config/fish/config.fish file:
2005-12-04 20:40:43 +08:00
<pre>if status --is-login
set PATH $PATH ~/linux/bin
end</pre>
2005-09-20 21:31:55 +08:00
2005-12-04 20:40:43 +08:00
If you want to run a set of commands when \c fish exits, use an <a
href='#event'>event handler</a> that is triggered by the exit of the
shell:
2005-12-04 03:46:18 +08:00
2006-02-01 21:40:29 +08:00
<pre>function on_exit --on-process \%self
2005-12-04 03:46:18 +08:00
echo fish is now exiting
end</pre>
2005-09-20 21:31:55 +08:00
<a href="#variables-universal">Universal variables</a> are stored in
2013-01-08 18:43:14 +08:00
the file .config/fish/fishd.MACHINE_ID, where MACHINE_ID is typically your
2013-04-30 18:15:37 +08:00
MAC address. Do not edit this file directly, as your edits may be overwritten.
Edit them through fish scripts or by using fish interactively instead.
2005-09-20 21:31:55 +08:00
\section other Other features
\subsection color Syntax highlighting
2005-09-23 22:33:16 +08:00
\c fish interprets the command line as it is typed and uses syntax
2005-09-20 21:31:55 +08:00
highlighting to provide feedback to the user. The most important
feedback is the detection of potential errors. By default, errors are
marked red.
Detected errors include:
- Non existing commands.
2005-12-04 20:40:43 +08:00
- Reading from or appending to a non existing file.
2005-09-20 21:31:55 +08:00
- Incorrect use of output redirects
- Mismatched parenthesis
2005-09-21 05:42:20 +08:00
When the cursor is over a parenthesis or a quote, \c fish also
2006-05-19 22:04:25 +08:00
highlights its matching quote or parenthesis.
2005-09-21 05:42:20 +08:00
2005-09-20 21:31:55 +08:00
To customize the syntax highlighting, you can set the environment
variables \c fish_color_normal, \c fish_color_command, \c
fish_color_substitution, \c fish_color_redirection, \c fish_color_end,
\c fish_color_error, \c fish_color_param, \c fish_color_comment, \c
fish_color_match, \c fish_color_search_match, \c fish_color_cwd, \c
fish_pager_color_prefix, \c fish_pager_color_completion, \c
2012-06-27 11:17:00 +08:00
fish_pager_color_description, \c fish_pager_color_progress
and \c fish_pager_color_secondary. Usually, the value of these variables will
2006-01-18 03:34:50 +08:00
be one of \c black, \c red, \c green, \c brown, \c yellow, \c blue, \c
magenta, \c purple, \c cyan, \c white or \c normal, but they can be an
array containing any color options for the set_color command.
Issuing <code>set fish_color_error black --background=red
--bold</code> will make all commandline errors be written in a black,
bold font, with a red background.
2005-09-20 21:31:55 +08:00
\subsection title Programmable title
2006-03-14 08:09:14 +08:00
When using most virtual terminals, it is possible to set the message
displayed in the titlebar of the terminal window. This can be done
automatically in fish by defining the \c fish_title function. The \c
fish_title function is executed before and after a new command is
executed or put into the foreground and the output is used as a
titlebar message. The $_ environment variable will always contain the
name of the job to be put into the foreground (Or 'fish' if control is
2008-02-11 05:00:53 +08:00
returning to the shell) when the \c fish_prompt function is called.
2005-09-20 21:31:55 +08:00
Example:
<p>
2010-09-18 10:18:26 +08:00
The default \c fish title is
2005-09-20 21:31:55 +08:00
</p>
<p>
<pre>
function fish_title
echo $_ ' '
pwd
end
</pre>
</p>
2009-02-17 05:04:50 +08:00
\subsection greeting Configurable greeting
If a function named fish_greeting exists after initialization, it will
be run when entering interactive mode. Otherwise,if an environment
variable named fish_greeting exists, it will be printed.
2005-09-20 21:31:55 +08:00
2005-12-04 03:46:18 +08:00
\subsection event Event handlers
When defining a new function in fish, it is possible to make it into an
event handler, i.e. a function that is automatically run when a
specific event takes place. Events that can trigger a handler currently are:
2006-08-14 20:05:40 +08:00
- When a signal is delivered
- When a process or job exits
- When the value of a variable is updated
2007-08-20 00:42:30 +08:00
- When the prompt is about to be shown
2008-01-17 06:25:31 +08:00
- When a command lookup fails
2005-12-04 03:46:18 +08:00
Example:
2005-09-20 21:31:55 +08:00
2005-12-04 03:46:18 +08:00
To specify a signal handler for the WINCH signal, write:
2005-09-20 21:31:55 +08:00
2005-12-04 03:46:18 +08:00
<pre>function --on-signal WINCH my_signal_handler
echo Got WINCH signal!
end
</pre>
For more information on how to define new event handlers, see the
2006-10-31 23:36:14 +08:00
documentation for the <a href='commands.html#function'>function</a>
2005-12-04 03:46:18 +08:00
command.
2005-09-20 21:31:55 +08:00
2008-01-14 04:01:51 +08:00
\subsection debugging Debugging fish scripts
2007-09-21 23:16:54 +08:00
2008-01-14 04:01:51 +08:00
Fish includes a built in debugger. The debugger allows you to stop
2007-09-21 23:16:54 +08:00
execution of a script at an arbitrary point and launch a prompt. This
prompt can then be used to check or change the value of any variables
or perform any shellscript command. To resume normal execution of the
script, simply exit the prompt.
To start the debugger, simply call the builtin command
'breakpoint'. The default action of the TRAP signal is to call this
2008-01-14 04:01:51 +08:00
builtin, so a running script can be debugged by sending it the TRAP
signal. Once in the debugger, it is easy to insert new breakpoints by
2007-09-21 23:16:54 +08:00
using the funced function to edit the definition of a function.
2005-09-26 20:33:06 +08:00
\section issues Common issues with fish
If you install fish in your home directory, fish will not work
correctly for any other user than yourself. This is because fish needs
2008-01-14 04:01:51 +08:00
its initialization files to function properly. To solve this
2005-09-26 20:33:06 +08:00
problem, either copy the initialization files to each fish users home
directory, or install them in /etc.
2013-04-30 18:19:23 +08:00
\section more-help Further help and development
If you have a question not answered by this documentation, there are
several avenues for help:
-# The official mailing list at <a href='fish-users@lists.sf.net'>fish-users@lists.sf.net</a>
-# The Internet Relay Chat channel, \c #fish on \c irc.oftc.net
-# The <a href="http://github.com/fish-shell/fish-shell/">project GitHub page</a>
If you have an improvement for fish, you can submit it via the mailing list
or the GitHub page.
2005-09-20 21:31:55 +08:00
2006-03-09 19:59:16 +08:00
*/
2013-10-05 15:37:44 +08:00
\htmlonly </div> \endhtmlonly