diff --git a/doc_src/alias.txt b/doc_src/alias.txt index 079cabff2..028277a35 100644 --- a/doc_src/alias.txt +++ b/doc_src/alias.txt @@ -13,10 +13,12 @@ alias NAME=DEFINITION `fish` does not keep track of which functions have been defined using `alias`. They must be erased using `functions -e`. - `NAME` is the name of the alias + - `DEFINITION` is the actual command to execute. The string `$argv` will be appended. You cannot create an alias to a function with the same name. + \subsection alias-example Example The following code will create `rmi`, which runs `rm` with additional arguments on every invocation. diff --git a/doc_src/and.txt b/doc_src/and.txt index 9d71d67ce..0b4f681d1 100644 --- a/doc_src/and.txt +++ b/doc_src/and.txt @@ -7,21 +7,16 @@ COMMAND1; and COMMAND2 \subsection and-description Description -`and` is used to execute a command if the current exit -status (as set by the last previous command) is 0. +`and` is used to execute a command if the current exit status (as set by the last previous command) is 0. `and` does not change the current exit status. -The exit status of the last foreground command to exit can always be -accessed using the $status -variable. +The exit status of the last foreground command to exit can always be accessed using the $status variable. + \subsection and-example Example -The following code runs the `make` command to build a program. If the -build succeeds, `make`'s exit status is 0, and the program is installed. If either step fails, -the exit status is 1, and `make clean` is run, which removes the files created by the. -build process. +The following code runs the `make` command to build a program. If the build succeeds, `make`'s exit status is 0, and the program is installed. If either step fails, the exit status is 1, and `make clean` is run, which removes the files created by the build process. \fish make; and make install; or make clean diff --git a/doc_src/begin.txt b/doc_src/begin.txt index 6807fac4e..6d18a6061 100644 --- a/doc_src/begin.txt +++ b/doc_src/begin.txt @@ -9,21 +9,16 @@ begin; [COMMANDS...;] end `begin` is used to create a new block of code. -The block is unconditionally executed. `begin; ...; end` is equivalent -to `if true; ...; end`. +The block is unconditionally executed. `begin; ...; end` is equivalent to `if true; ...; end`. -`begin` is used to group a number of commands into a block. -This allows the introduction of a new variable scope, redirection of the input or -output of a set of commands as a group, or to specify precedence when -using the conditional commands like `and`. +`begin` is used to group a number of commands into a block. This allows the introduction of a new variable scope, redirection of the input or output of a set of commands as a group, or to specify precedence when using the conditional commands like `and`. `begin` does not change the current exit status. + \subsection begin-example Example -The following code sets a number of variables inside of a block -scope. Since the variables are set inside the block and have local -scope, they will be automatically deleted when the block ends. +The following code sets a number of variables inside of a block scope. Since the variables are set inside the block and have local scope, they will be automatically deleted when the block ends. \fish begin @@ -32,8 +27,8 @@ begin end echo $PIRATE -# This will not output anything, since the PIRATE variable went out -# of scope at the end of the block +# This will not output anything, since the PIRATE variable +# went out of scope at the end of the block \endfish In the following code, all output is redirected to the file out.html. diff --git a/doc_src/bg.txt b/doc_src/bg.txt index d05bf54d1..8e9ec2444 100644 --- a/doc_src/bg.txt +++ b/doc_src/bg.txt @@ -7,13 +7,11 @@ bg [PID...] \subsection bg-description Description -`bg` sends jobs to the background, resuming them if they are stopped. A background job is -executed simultaneously with fish, and does not have access to the -keyboard. If no job is specified, the last job to be used is put in the background. If PID is specified, the jobs with the specified process group IDs are put in the background. +`bg` sends jobs to the background, resuming them if they are stopped. A background job is executed simultaneously with fish, and does not have access to the keyboard. If no job is specified, the last job to be used is put in the background. If PID is specified, the jobs with the specified process group IDs are put in the background. The PID of the desired process is usually found by using process expansion. + \subsection bg-example Example `bg %1` will put the job with job ID 1 in the background. - diff --git a/doc_src/bind.txt b/doc_src/bind.txt index 9607c8b0c..59a8dec5d 100644 --- a/doc_src/bind.txt +++ b/doc_src/bind.txt @@ -10,82 +10,83 @@ bind [OPTIONS] SEQUENCE COMMAND `bind` adds a binding for the specified key sequence to the specified command. -SEQUENCE is the character sequence to bind to. These should be written as fish escape sequences. For example, because -pressing the Alt key and another character sends that character prefixed with -an escape character, Alt-based key bindings can be written using the `\e` -escape. For example, @key{Alt,w} can be written as `\ew`. The control -character can be written in much the same way using the `\c` escape, for -example @key{Control,X} (^X) can be written as `\cx`. Note -that Alt-based key bindings are case sensitive and Control-based key bindings -are not. This is a constraint of text-based terminals, not `fish`. +SEQUENCE is the character sequence to bind to. These should be written as fish escape sequences. For example, because pressing the Alt key and another character sends that character prefixed with an escape character, Alt-based key bindings can be written using the `\e` escape. For example, @key{Alt,w} can be written as `\ew`. The control character can be written in much the same way using the `\c` escape, for example @key{Control,X} (^X) can be written as `\cx`. Note that Alt-based key bindings are case sensitive and Control-based key bindings are not. This is a constraint of text-based terminals, not `fish`. -The default key binding can be set by specifying a `SEQUENCE` of the empty -string (that is, ```''``` ). It will be used whenever no other binding -matches. For most key bindings, it makes sense to use the `self-insert` -function (i.e. ```bind '' self-insert```) as the default keybinding. This -will insert any keystrokes not specifically bound to into the editor. Non- -printable characters are ignored by the editor, so this will not result in -control sequences being printable. +The default key binding can be set by specifying a `SEQUENCE` of the empty string (that is, ```''``` ). It will be used whenever no other binding matches. For most key bindings, it makes sense to use the `self-insert` function (i.e. ```bind '' self-insert```) as the default keybinding. This will insert any keystrokes not specifically bound to into the editor. Non- printable characters are ignored by the editor, so this will not result in control sequences being printable. -If the `-k` switch is used, the name of the key (such as 'down', 'up' or 'backspace') -is used instead of a sequence. The names used are the same as the -corresponding curses variables, but without the 'key_' prefix. (See -`terminfo(5)` for more information, or use `bind --key-names` for a list of all -available named keys.) +If the `-k` switch is used, the name of the key (such as 'down', 'up' or 'backspace') is used instead of a sequence. The names used are the same as the corresponding curses variables, but without the 'key_' prefix. (See `terminfo(5)` for more information, or use `bind --key-names` for a list of all available named keys.) -`COMMAND` can be any fish command, but it can also be one of a set of special -input functions. These include functions for moving the cursor, operating on -the kill-ring, performing tab completion, etc. Use `bind --function-names` for -a complete list of these input functions. +`COMMAND` can be any fish command, but it can also be one of a set of special input functions. These include functions for moving the cursor, operating on the kill-ring, performing tab completion, etc. Use `bind --function-names` for a complete list of these input functions. -When `COMMAND` is a shellscript command, it is a good practice to put the actual -code into a function and simply bind to the function -name. This way it becomes significantly easier to test the function while -editing, and the result is usually more readable as well. +When `COMMAND` is a shellscript command, it is a good practice to put the actual code into a function and simply bind to the function name. This way it becomes significantly easier to test the function while editing, and the result is usually more readable as well. -If such a script produces output, the script needs to finish by calling -`commandline -f repaint` in order to tell fish that a repaint is in order. +If such a script produces output, the script needs to finish by calling `commandline -f repaint` in order to tell fish that a repaint is in order. -Key bindings are not saved between sessions by default. To save custom -keybindings, edit the `fish_user_key_bindings` function and insert the -appropriate `bind` statements. +Key bindings are not saved between sessions by default. To save custom keybindings, edit the `fish_user_key_bindings` function and insert the appropriate `bind` statements. The following parameters are available: - `-k` or `--key` Specify a key name, such as 'left' or 'backspace' instead of a character sequence + - `-K` or `--key-names` Display a list of available key names + - `-f` or `--function-names` Display a list of available input functions The following special input functions are available: - `backward-char`, moves one character to the left + - `backward-delete-char`, deletes one character of input to the left of the cursor + - `backward-kill-line`, move everything from the beginning of the line to the cursor to the killring + - `backward-kill-word`, move the word to the left of the cursor to the killring + - `backward-word`, move one word to the left + - `beginning-of-history`, move to the beginning of the history + - `beginning-of-line`, move to the beginning of the line + - `capitalize-word`, make the current word begin with a capital letter + - `complete`, guess the remainder of the current token + - `delete-char`, delete one character to the right of the cursor + - `delete-line`, delete the entire line + - `downcase-word`, make the current word lowercase + - `dump-functions`, print a list of all key-bindings + - `end-of-history`, move to the end of the history + - `end-of-line`, move to the end of the line + - `explain`, print a description of possible problems with the current command + - `forward-char`, move one character to the right + - `forward-word`, move one word to the right + - `history-search-backward`, search the history for the previous match + - `history-search-forward`, search the history for the next match + - `kill-line`, move everything from the cursor to the end of the line to the killring + - `kill-whole-line`, move the line to the killring + - `kill-word`, move the next word to the killring + - `upcase-word`, make the current word uppercase + - `yank`, insert the latest entry of the killring into the buffer + - `yank-pop`, rotate to the previous entry of the killring + \subsection bind-example Examples `bind \cd 'exit'` causes `fish` to exit when @key{Control,D} is pressed. diff --git a/doc_src/block.txt b/doc_src/block.txt index f3f741f12..37b2de0c6 100644 --- a/doc_src/block.txt +++ b/doc_src/block.txt @@ -7,26 +7,23 @@ block [OPTIONS...] \subsection block-description Description -`block` prevents events triggered by `fish` or the -`emit` command from -being delivered and acted upon while the block is in place. +`block` prevents events triggered by `fish` or the `emit` command from being delivered and acted upon while the block is in place. -In functions, `block` can be useful while performing work that -should not be interrupted by the shell. +In functions, `block` can be useful while performing work that should not be interrupted by the shell. -The block can be removed. Any events which triggered while the -block was in place will then be delivered. +The block can be removed. Any events which triggered while the block was in place will then be delivered. -Event blocks should not be confused with code blocks, which are created -with `begin`, `if`, `while` or -`for` +Event blocks should not be confused with code blocks, which are created with `begin`, `if`, `while` or `for` The following parameters are available: - `-l` or `--local` Release the block automatically at the end of the current innermost code block scope + - `-g` or `--global` Never automatically release the lock + - `-e` or `--erase` Release global block + \subsection block-example Example \fish diff --git a/doc_src/break.txt b/doc_src/break.txt index 2056b054a..32672c09f 100644 --- a/doc_src/break.txt +++ b/doc_src/break.txt @@ -5,13 +5,13 @@ LOOP_CONSTRUCT; [COMMANDS...] break; [COMMANDS...] end \endfish - \subsection break-description Description `break` halts a currently running loop, such as a for loop or a while loop. It is usually added inside of a conditional block such as an if statement or a switch statement. There are no parameters for `break`. + \subsection break-example Example The following code searches all .c files for "smurf", and halts at the first occurrence. diff --git a/doc_src/breakpoint.txt b/doc_src/breakpoint.txt index 348c779d9..8645c18dd 100644 --- a/doc_src/breakpoint.txt +++ b/doc_src/breakpoint.txt @@ -7,10 +7,8 @@ breakpoint \subsection breakpoint-description Description -`breakpoint` is used to halt a running script and launch -an interactive debugging prompt. +`breakpoint` is used to halt a running script and launch an interactive debugging prompt. -For more details, see Debugging fish -scripts in the `fish` manual. +For more details, see Debugging fish scripts in the `fish` manual. There are no parameters for `breakpoint`. diff --git a/doc_src/builtin.txt b/doc_src/builtin.txt index 2d915fc34..4c465ef18 100644 --- a/doc_src/builtin.txt +++ b/doc_src/builtin.txt @@ -13,6 +13,10 @@ The following parameters are available: - `-n` or `--names` List the names of all defined builtins + \subsection builtin-example Example -`builtin jobs` executes the jobs builtin, even if a function named jobs exists. +\fish +builtin jobs +# executes the jobs builtin, even if a function named jobs exists +\endfish diff --git a/doc_src/case.txt b/doc_src/case.txt index b05006502..24fde2803 100644 --- a/doc_src/case.txt +++ b/doc_src/case.txt @@ -7,24 +7,14 @@ switch VALUE; [case [WILDCARD...]; [COMMANDS...]; ...] end \subsection case-description Description -`switch` performs one of several blocks of commands, depending on whether -a specified value equals one of several wildcarded values. `case` is used -together with the `switch` statement in order to determine which block should -be executed. +`switch` performs one of several blocks of commands, depending on whether a specified value equals one of several wildcarded values. `case` is used together with the `switch` statement in order to determine which block should be executed. -Each `case` command is given one or more parameters. The first `case` -command with a parameter that matches the string specified in the -switch command will be evaluated. `case` parameters may contain -wildcards. These need to be escaped or quoted in order to avoid -regular wildcard expansion using filenames. +Each `case` command is given one or more parameters. The first `case` command with a parameter that matches the string specified in the switch command will be evaluated. `case` parameters may contain wildcards. These need to be escaped or quoted in order to avoid regular wildcard expansion using filenames. -Note that fish does not fall through on case statements. Only the -first matching case is executed. +Note that fish does not fall through on case statements. Only the first matching case is executed. + +Note that command substitutions in a case statement will be evaluated even if its body is not taken. All substitutions, including command substitutions, must be performed before the value can be compared against the parameter. -Note that command substitutions in a case statement will be -evaluated even if its body is not taken. All substitutions, including -command substitutions, must be performed before the value can be compared -against the parameter. \subsection case-example Example diff --git a/doc_src/cd.txt b/doc_src/cd.txt index 200d97675..bb4dc488c 100644 --- a/doc_src/cd.txt +++ b/doc_src/cd.txt @@ -8,20 +8,19 @@ cd [DIRECTORY] \subsection cd-description Description `cd` changes the current working directory. -If `DIRECTORY` is supplied, it will become the new directory. If no parameter -is given, the contents of the `HOME` environment variable will be used. +If `DIRECTORY` is supplied, it will become the new directory. If no parameter is given, the contents of the `HOME` environment variable will be used. -If `DIRECTORY` is a relative path, the paths found in the -`CDPATH` environment variable array will be tried as prefixes for the specified -path. +If `DIRECTORY` is a relative path, the paths found in the `CDPATH` environment variable array will be tried as prefixes for the specified path. + +Note that the shell will attempt to change directory without requiring `cd` if the name of a directory is provided (starting with `.`, `/` or `~`, or ending with `/`). -Note that the shell will attempt to change directory without requiring `cd` -if the name of a directory is provided (starting with '`.`', '`/`' or `~`', or ending -with '`/`'). \subsection cd-example Examples -`cd` changes the working directory to your home directory. +\fish +cd +# changes the working directory to your home directory. -`cd /usr/src/fish-shell` changes the working directory to -`/usr/src/fish-shell`. +cd /usr/src/fish-shell +# changes the working directory to /usr/src/fish-shell +\endfish diff --git a/doc_src/commandline.txt b/doc_src/commandline.txt index b3eaba5ad..347f48700 100644 --- a/doc_src/commandline.txt +++ b/doc_src/commandline.txt @@ -7,69 +7,53 @@ commandline [OPTIONS] [CMD] \subsection commandline-description Description -`commandline` can be used to set or get the current contents of the command -line buffer. +`commandline` can be used to set or get the current contents of the command line buffer. -With no parameters, `commandline` returns the current value of the command -line. +With no parameters, `commandline` returns the current value of the command line. -With `CMD` specified, the command line buffer is erased and replaced with -the contents of `CMD`. +With `CMD` specified, the command line buffer is erased and replaced with the contents of `CMD`. The following options are available: -- `-C` or `--cursor` set or get the current cursor position, not - the contents of the buffer. If no argument is given, the current - cursor position is printed, otherwise the argument is interpreted - as the new cursor position. -- `-f` or `--function` inject readline functions into the - reader. This option cannot be combined with any other option. It - will cause any additional arguments to be interpreted as readline - functions, and these functions will be injected into the reader, so - that they will be returned to the reader before any additional - actual key presses are read. +- `-C` or `--cursor` set or get the current cursor position, not the contents of the buffer. If no argument is given, the current cursor position is printed, otherwise the argument is interpreted as the new cursor position. -The following options change the way `commandline` updates the -command line buffer: +- `-f` or `--function` inject readline functions into the reader. This option cannot be combined with any other option. It will cause any additional arguments to be interpreted as readline functions, and these functions will be injected into the reader, so that they will be returned to the reader before any additional actual key presses are read. -- `-a` or `--append` do not remove the current commandline, append - the specified string at the end of it -- `-i` or `--insert` do not remove the current commandline, insert - the specified string at the current cursor position -- `-r` or `--replace` remove the current commandline and replace it - with the specified string (default) +The following options change the way `commandline` updates the command line buffer: -The following options change what part of the commandline is printed -or updated: +- `-a` or `--append` do not remove the current commandline, append the specified string at the end of it + +- `-i` or `--insert` do not remove the current commandline, insert the specified string at the current cursor position + +- `-r` or `--replace` remove the current commandline and replace it with the specified string (default) + +The following options change what part of the commandline is printed or updated: - `-b` or `--current-buffer` select the entire buffer (default) + - `-j` or `--current-job` select the current job + - `-p` or `--current-process` select the current process + - `-t` or `--current-token` select the current token. -The following options change the way `commandline` prints the current -commandline buffer: +The following options change the way `commandline` prints the current commandline buffer: + +- `-c` or `--cut-at-cursor` only print selection up until the current cursor position -- `-c` or `--cut-at-cursor` only print selection up until the - current cursor position - `-o` or `--tokenize` tokenize the selection and print one string-type token per line - -If `commandline` is called during a call to complete a given string -using `complete -C STRING`, `commandline` will consider the -specified string to be the current contents of the command line. +If `commandline` is called during a call to complete a given string using `complete -C STRING`, `commandline` will consider the specified string to be the current contents of the command line. The following options output metadata about the commandline state: -- `-L` or `--line` print the line that the cursor is on, with the topmost -line starting at 1 -- `-S` or `--search-mode` evaluates to true if the commandline is performing -a history search -- `-P` or `--paging-mode` evaluates to true if the commandline is showing -pager contents, such as tab completions +- `-L` or `--line` print the line that the cursor is on, with the topmost line starting at 1 + +- `-S` or `--search-mode` evaluates to true if the commandline is performing a history search + +- `-P` or `--paging-mode` evaluates to true if the commandline is showing pager contents, such as tab completions \subsection commandline-example Example -`commandline -j $history[3]` replaces the job under the cursor with the -third item from the command line history. +`commandline -j $history[3]` replaces the job under the cursor with the third item from the command line history. diff --git a/doc_src/complete.txt b/doc_src/complete.txt index c2aae0400..cb4e6bdef 100644 --- a/doc_src/complete.txt +++ b/doc_src/complete.txt @@ -34,62 +34,43 @@ options, the same styles as the GNU version of the getopt library. These styles are: - Short options, like '`-a`'. Short options are a single character long, are preceded by a single hyphen and may be grouped together (like '`-la`', which is equivalent to '`-l -a`'). Option arguments may be specified in the following parameter ('`-w 32`') or by appending the option with the value ('`-w32`'). + - Old style long options, like '`-Wall`'. Old style long options can be more than one character long, are preceded by a single hyphen and may not be grouped together. Option arguments are specified in the following parameter ('`-ao null`'). + - GNU style long options, like '`--colors`'. GNU style long options can be more than one character long, are preceded by two hyphens, and may not be grouped together. Option arguments may be specified in the following parameter ('`--quoting-style`') or by appending the option with a '`=`' and the value ('`--quoting-style=shell`'). GNU style long options may be abbreviated so long as the abbreviation is unique ('`--h`') is equivalent to '`--help`' if help is the only long option beginning with an 'h'). -The options for specifying command name, command path, or command -switches may all be used multiple times to specify multiple commands -which have the same completion or multiple switches accepted by a -command. +The options for specifying command name, command path, or command switches may all be used multiple times to specify multiple commands which have the same completion or multiple switches accepted by a command. -The \c -w or \c --wraps options causes the specified command to inherit -completions from another command. The inheriting command is said to -"wrap" the inherited command. The wrapping command may have its own -completions in addition to inherited ones. A command may wrap multiple -commands, and wrapping is transitive: if A wraps B, and B wraps C, -then A automatically inherits all of C's completions. Wrapping can -be removed using the \c -e or \c --erase options. +The `-w` or `--wraps` options causes the specified command to inherit completions from another command. The inheriting command is said to "wrap" the inherited command. The wrapping command may have its own completions in addition to inherited ones. A command may wrap multiple commands, and wrapping is transitive: if A wraps B, and B wraps C, then A automatically inherits all of C's completions. Wrapping can be removed using the `-e` or `--erase` options. + +When erasing completions, it is possible to either erase all completions for a specific command by specifying `complete -e -c COMMAND`, or by specifying a specific completion option to delete by specifying either a long, short or old style option. -When erasing completions, it is possible to either erase all -completions for a specific command by specifying `complete -e -c -COMMAND`, or by specifying a specific completion option to delete -by specifying either a long, short or old style option. \subsection complete-example Example -The short style option `-o` for the `gcc` command requires -that a file follows it. This can be done using writing: +The short style option `-o` for the `gcc` command requires that a file follows it. This can be done using writing: `complete -c gcc -s o -r` -The short style option `-d` for the `grep` command requires -that one of the strings '`read`', '`skip`' or '`recurse`' is used. This can -be specified writing: +The short style option `-d` for the `grep` command requires that one of the strings '`read`', '`skip`' or '`recurse`' is used. This can be specified writing: `complete -c grep -s d -x -a "read skip recurse"` -The `su` command takes any username as an argument. Usernames are -given as the first colon-separated field in the file /etc/passwd. This -can be specified as: +The `su` command takes any username as an argument. Usernames are given as the first colon-separated field in the file /etc/passwd. This can be specified as: -`complete -x -c su -d "Username" ` -`-a "(cat /etc/passwd | cut -d : -f 1)"` +`complete -x -c su -d "Username" -a "(cat /etc/passwd | cut -d : -f 1)"` -The `rpm` command has several different modes. If the `-e` or `--erase` flag has been specified, `rpm` should delete one or more -packages, in which case several switches related to deleting packages are valid, like the `nodeps` switch. +The `rpm` command has several different modes. If the `-e` or `--erase` flag has been specified, `rpm` should delete one or more packages, in which case several switches related to deleting packages are valid, like the `nodeps` switch. This can be written as: -`complete -c rpm -n "__fish_contains_opt -s e erase"` -`-l nodeps -d "Don't check dependencies"` +`complete -c rpm -n "__fish_contains_opt -s e erase" -l nodeps -d "Don't check dependencies"` -where `__fish_contains_opt` is a function that checks the commandline -buffer for the presence of a specified set of options. +where `__fish_contains_opt` is a function that checks the commandline buffer for the presence of a specified set of options. To implement an alias, use the \c -w or \c --wraps option: complete -c hub -w git -Now hub inherits all of the completions from git. Note this can -also be specified in a function declaration. +Now hub inherits all of the completions from git. Note this can also be specified in a function declaration. diff --git a/doc_src/contains.txt b/doc_src/contains.txt index 2ec6e0920..4c947c9df 100644 --- a/doc_src/contains.txt +++ b/doc_src/contains.txt @@ -7,15 +7,14 @@ contains [OPTIONS] KEY [VALUES...] \subsection contains-description Description -`contains` tests whether the set `VALUES` contains the string -`KEY`. If so, `contains` exits with status 0; if not, it exits -with status 1. +`contains` tests whether the set `VALUES` contains the string `KEY`. If so, `contains` exits with status 0; if not, it exits with status 1. The following options are available: - `-i` or `--index` print the word index - `-h` or `--help` display this message + \subsection contains-example Example \fish diff --git a/doc_src/continue.txt b/doc_src/continue.txt index cb92c9cf3..1585b04a8 100644 --- a/doc_src/continue.txt +++ b/doc_src/continue.txt @@ -6,9 +6,11 @@ LOOP_CONSTRUCT; [COMMANDS...;] continue; [COMMANDS...;] end \endfish \subsection continue-description Description + `continue` skips the remainder of the current iteration of the current inner loop, such as a for loop or a while loop. It is usually added inside of a conditional block such as an if statement or a switch statement. \subsection continue-example Example + The following code removes all tmp files that do not contain the word smurf. \fish diff --git a/doc_src/count.txt b/doc_src/count.txt index bf66d2071..4587209fd 100644 --- a/doc_src/count.txt +++ b/doc_src/count.txt @@ -7,25 +7,21 @@ count $VARIABLE \subsection count-description Description -`count` prints the number of arguments that were -passed to it. This is usually used to find out how many elements an -environment variable array contains. +`count` prints the number of arguments that were passed to it. This is usually used to find out how many elements an environment variable array contains. `count` does not accept any options, including '`-h`'. -`count` exits with a non-zero exit status if no arguments were passed -to it, and with zero if at least one argument was passed. +`count` exits with a non-zero exit status if no arguments were passed to it, and with zero if at least one argument was passed. + \subsection count-example Example -
+\fish count $PATH --returns the number of directories in the users PATH variable. +# Returns the number of directories in the users PATH variable. -
count *.txt --returns the number of files in the current working directory ending with the suffix '.txt'. +# Returns the number of files in the current working directory ending with the suffix '.txt'. +\endfish \ No newline at end of file diff --git a/doc_src/design.hdr b/doc_src/design.hdr index 714321d62..1cd27662e 100644 --- a/doc_src/design.hdr +++ b/doc_src/design.hdr @@ -8,114 +8,87 @@ \section design-overview Overview -This is a description of the design principles that have been used to -design fish. The fish design has three high level goals. These are: +This is a description of the design principles that have been used to design fish. The fish design has three high level goals. These are: --# Everything that can be done in other shell languages should be -possible to do in fish, though fish may rely on external commands in -doing so. --# Fish should be user friendly, but not at the expense of expressiveness. -Most tradeoffs between power and ease of use can be avoided with careful design. --# Whenever possible without breaking the above goals, fish should -follow the Posix syntax. +-# Everything that can be done in other shell languages should be possible to do in fish, though fish may rely on external commands in doing so. + +-# Fish should be user friendly, but not at the expense of expressiveness. Most tradeoffs between power and ease of use can be avoided with careful design. + +-# Whenever possible without breaking the above goals, fish should follow the Posix syntax. + +To achieve these high-level goals, the fish design relies on a number of more specific design principles. These are presented below, together with a rationale and a few examples for each. -To achieve these high-level goals, the fish design relies on a number -of more specific design principles. These are presented below, -together with a rationale and a few examples for each. \section ortho The law of orthogonality -The shell language should have a small set of orthogonal features. Any -situation where two features are related but not identical, one of them -should be removed, and the other should be made powerful and general -enough to handle all common use cases of either feature. +The shell language should have a small set of orthogonal features. Any situation where two features are related but not identical, one of them should be removed, and the other should be made powerful and general enough to handle all common use cases of either feature. Rationale: - -Related features make the language larger, which makes it harder to -learn. It also increases the size of the sourcecode, making the -program harder to maintain and update. +Related features make the language larger, which makes it harder to learn. It also increases the size of the sourcecode, making the program harder to maintain and update. Examples: - Here documents are too similar to using echo inside of a pipeline. + - Subshells, command substitution and process substitution are strongly related. `fish` only supports command substitution, the others can be achieved either using a block or the psub shellscript function. + - Having both aliases and functions is confusing, especially since both of them have limitations and problems. `fish` functions have none of the drawbacks of either syntax. + - The many Posix quoting styles are silly, especially $''. -\section sep The law of responsiveness + +\section design-response The law of responsiveness The shell should attempt to remain responsive to the user at all times, even in the face of contended or unresponsive filesystems. It is only acceptable to block in response to a user initiated action, such as running a command. Rationale: - Bad performance increases user-facing complexity, because it trains users to recognize and route around slow use cases. It is also incredibly frustrating. Examples: - Features like syntax highlighting and autosuggestions must perform all of their disk I/O asynchronously. + - Startup should minimize forks and disk I/O, so that fish can be started even if the system is under load. -\section conf Configurability is the root of all evil +\section design-configurability Configurability is the root of all evil -Every configuration option in a program is a place where the program -is too stupid to figure out for itself what the user really wants, and -should be considered a failiure of both the program and the programmer -who implemented it. +Every configuration option in a program is a place where the program is too stupid to figure out for itself what the user really wants, and should be considered a failiure of both the program and the programmer who implemented it. Rationale: - -Different configuration options are a nightmare to maintain, since the -number of potential bugs caused by specific configuration combinations -quickly becomes an issue. Configuration options often imply -assumptions about the code which change when reimplementing the code, -causing issues with backwards compatibility. But mostly, configuration -options should be avoided since they simply should not exist, as the -program should be smart enough to do what is best, or at least a good -enough approximation of it. +Different configuration options are a nightmare to maintain, since the number of potential bugs caused by specific configuration combinations quickly becomes an issue. Configuration options often imply assumptions about the code which change when reimplementing the code, causing issues with backwards compatibility. But mostly, configuration options should be avoided since they simply should not exist, as the program should be smart enough to do what is best, or at least a good enough approximation of it. Examples: - Fish allows the user to set various syntax highlighting colors. This is needed because fish does not know what colors the terminal uses by default, which might make some things unreadable. The proper solution would be for text color preferences to be defined centrally by the user for all programs, and for the terminal emulator to send these color properties to fish. + - Fish does not allow you to set the history filename, the number of history entries, different language substyles or any number of other common shell configuration options. -A special note on the evils of configurability is the long list of -very useful features found in some shells, that are not turned on by -default. Both zsh and bash support command specific completions, but -no such completions are shipped with bash by default, and they are -turned off by default in zsh. Other features that zsh support that are -disabled by default include tab-completion of strings containing -wildcards, a sane completion pager and a history file. +A special note on the evils of configurability is the long list of very useful features found in some shells, that are not turned on by default. Both zsh and bash support command specific completions, but no such completions are shipped with bash by default, and they are turned off by default in zsh. Other features that zsh support that are disabled by default include tab-completion of strings containing wildcards, a sane completion pager and a history file. + \section user The law of user focus -When designing a program, one should first think about how to make a -intuitive and powerful program. Implementation issues should only be -considered once a user interface has been designed. +When designing a program, one should first think about how to make a intuitive and powerful program. Implementation issues should only be considered once a user interface has been designed. Rationale: - -This design rule is different than the others, since it describes how -one should go about designing new features, not what the features -should be. The problem with focusing on what can be done, and what is -easy to do, is that to much of the implementation is exposed. This -means that the user must know a great deal about the underlying system -to be able to guess how the shell works, it also means that the -language will often be rather low-level. +This design rule is different than the others, since it describes how one should go about designing new features, not what the features should be. The problem with focusing on what can be done, and what is easy to do, is that to much of the implementation is exposed. This means that the user must know a great deal about the underlying system to be able to guess how the shell works, it also means that the language will often be rather low-level. Examples: - - There should only be one type of input to the shell, lists of commands. Loops, conditionals and variable assignments are all performed through regular commands. + - The differences between builtin commands and shellscript functions should be made as small as possible. Builtins and shellscript functions should have exactly the same types of argument expansion as other commands, should be possible to use in any position in a pipeline, and should support any io redirection. + - Instead of forking when performing command substitution to provide a fake variable scope, all fish commands are performed from the same process, and fish instead supports true scoping. + - All blocks end with the `end` builtin. + \section disc The law of discoverability -A program should be designed to make its features as -easy as possible to discover for the user. +A program should be designed to make its features as easy as possible to discover for the user. Rationale: +A program whose features are discoverable turns a new user into an expert in a shorter span of time, since the user will become an expert on the program simply by using it. A program whose features are discoverable turns a new user into an expert in a shorter span of time, since the user will become an expert @@ -131,12 +104,16 @@ different program, and then she/he remembers the new information until the next time she/he uses the same program. Examples: - - Everything should be tab-completable, and every tab completion should have a description. + - Every syntax error and error in a builtin command should contain an error message describing what went wrong and a relevant help page. Whenever possible, errors should be flagged red by the syntax highlighter. + - The help manual should be easy to read, easily available from the shell, complete and contain many examples + - The language should be uniform, so that once the user understands the command/argument syntax, he will know the whole language, and be able to use tab-completion to discover new featues. + + \htmlonly[block] diff --git a/doc_src/dirh.txt b/doc_src/dirh.txt index 00bd581fc..d25b9c2ad 100644 --- a/doc_src/dirh.txt +++ b/doc_src/dirh.txt @@ -7,8 +7,6 @@ dirh \subsection dirh-description Description -`dirh` prints the current directory history. The current position in the -history is highlighted using the color defined in the -`fish_color_history_current` environment variable. +`dirh` prints the current directory history. The current position in the history is highlighted using the color defined in the `fish_color_history_current` environment variable. `dirh` does not accept any parameters. diff --git a/doc_src/dirs.txt b/doc_src/dirs.txt index c15834c57..231b678b9 100644 --- a/doc_src/dirs.txt +++ b/doc_src/dirs.txt @@ -6,7 +6,7 @@ dirs \endfish \subsection dirs-description Description -`dirs` prints the current directory stack, as created by the -`pushd` command. + +`dirs` prints the current directory stack, as created by the `pushd` command. `dirs` does not accept any parameters. diff --git a/doc_src/echo.txt b/doc_src/echo.txt index 7b9b03182..d70627161 100644 --- a/doc_src/echo.txt +++ b/doc_src/echo.txt @@ -12,9 +12,13 @@ echo [OPTIONS] [STRING] The following options are available: - `-n`, Do not output a newline + - `-s`, Do not separate arguments with spaces + - `-E`, Disable interpretation of backslash escapes (default) + - `-e`, Enable interpretation of backslash escapes + - `-h`, `--help` Display this help \subsection echo-escapes Escape Sequences @@ -22,20 +26,35 @@ The following options are available: If `-e` is used, the following sequences are recognized: - `\` backslash + - `\a` alert (BEL) + - `\b` backspace + - `\c` produce no further output + - `\e` escape + - `\f` form feed + - `\n` new line + - `\r` carriage return + - `\t` horizontal tab + - `\v` vertical tab + - `\0NNN` byte with octal value NNN (1 to 3 digits) + - `\xHH` byte with hexadecimal value HH (1 to 2 digits) \subsection echo-example Example -`echo 'Hello World'` Print hello world to stdout +\fish +echo 'Hello World' +# Print hello world to stdout -`echo -e 'Top\nBottom'` Print Top and Bottom on separate lines, using an escape sequence +echo -e 'Top\nBottom' +# Print Top and Bottom on separate lines, using an escape sequence +\endfish diff --git a/doc_src/else.txt b/doc_src/else.txt index a22cfcdb9..76e0c61f3 100644 --- a/doc_src/else.txt +++ b/doc_src/else.txt @@ -6,13 +6,13 @@ if CONDITION; COMMANDS_TRUE...; [else; COMMANDS_FALSE...;] end \endfish \subsection else-description Description -`if` will execute the command `CONDITION`. If the condition's exit -status is 0, the commands `COMMANDS_TRUE` will execute. If it is not 0 and -`else` is given, `COMMANDS_FALSE` will be executed. + +`if` will execute the command `CONDITION`. If the condition's exit status is 0, the commands `COMMANDS_TRUE` will execute. If it is not 0 and `else` is given, `COMMANDS_FALSE` will be executed. + \subsection else-example Example -The following code tests whether a file `foo`.txt exists as a regular file. +The following code tests whether a file `foo.txt` exists as a regular file. \fish if test -f foo.txt diff --git a/doc_src/emit.txt b/doc_src/emit.txt index d8f17b45e..df154c5df 100644 --- a/doc_src/emit.txt +++ b/doc_src/emit.txt @@ -9,10 +9,10 @@ emit EVENT_NAME [ARGUMENTS...] `emit` emits, or fires, an event. Events are delivered to, or caught by, special functions called event handlers. The arguments are passed to the event handlers as function arguments. + \subsection emit-example Example -The following code first defines an event handler for the generic -event named 'test_event', and then emits an event of that type. +The following code first defines an event handler for the generic event named 'test_event', and then emits an event of that type. \fish function event_test --on-event test_event diff --git a/doc_src/end.txt b/doc_src/end.txt index aca294955..76cbe3603 100644 --- a/doc_src/end.txt +++ b/doc_src/end.txt @@ -10,10 +10,10 @@ switch VALUE; [case [WILDCARD...]; [COMMANDS...]; ...] end \endfish \subsection end-description Description + `end` ends a block of commands. For more information, read the -documentation for the block constructs, such as \c if, \c for and \c -while. +documentation for the block constructs, such as `if`, `for` and `while`. -The \c end command does not change the current exit status. +The `end` command does not change the current exit status. diff --git a/doc_src/eval.txt b/doc_src/eval.txt index c966b5761..1ba8f97ee 100644 --- a/doc_src/eval.txt +++ b/doc_src/eval.txt @@ -8,11 +8,10 @@ eval [COMMANDS...] \subsection eval-description Description `eval` evaluates the specified parameters as a command. If more than one parameter is specified, all parameters will be joined using a space character as a separator. + \subsection eval-example Example -The following code will call the ls command. Note that \c fish does not -support the use of shell variables as direct commands; \c eval can -be used to work around this. +The following code will call the ls command. Note that `fish` does not support the use of shell variables as direct commands; `eval` can be used to work around this. \fish set cmd ls diff --git a/doc_src/exec.txt b/doc_src/exec.txt index 4bcd39996..f8936101a 100644 --- a/doc_src/exec.txt +++ b/doc_src/exec.txt @@ -7,11 +7,9 @@ exec COMMAND [OPTIONS...] \subsection exec-description Description -`exec` replaces the currently running shell with a new command. -On successful completion, `exec` never returns. `exec` cannot be used -inside a pipeline. +`exec` replaces the currently running shell with a new command. On successful completion, `exec` never returns. `exec` cannot be used inside a pipeline. + \subsection exec-example Example -`exec emacs` starts up the emacs text editor, and exits `fish`. -When emacs exits, the session will terminate. +`exec emacs` starts up the emacs text editor, and exits `fish`. When emacs exits, the session will terminate. diff --git a/doc_src/exit.txt b/doc_src/exit.txt index fcec4b923..5b43b612a 100644 --- a/doc_src/exit.txt +++ b/doc_src/exit.txt @@ -7,10 +7,6 @@ exit [STATUS] \subsection exit-description Description -`exit` causes fish to exit. If `STATUS` is -supplied, it will be converted to an integer and used as the exit -code. Otherwise, the exit code will be that of the last command executed. +`exit` causes fish to exit. If `STATUS` is supplied, it will be converted to an integer and used as the exit code. Otherwise, the exit code will be that of the last command executed. -If exit is called while sourcing a file (using the . builtin) the rest of the file will be skipped, -but the shell itself will not exit. +If exit is called while sourcing a file (using the . builtin) the rest of the file will be skipped, but the shell itself will not exit. diff --git a/doc_src/faq.hdr b/doc_src/faq.hdr index 6d3ead30a..99c2ada49 100644 --- a/doc_src/faq.hdr +++ b/doc_src/faq.hdr @@ -7,21 +7,37 @@ \endhtmlonly - How do I set or clear an environment variable? + - How do I run a command every login? What's fish's equivalent to `.bashrc`? + - How do I set my prompt? + - How do I run a command from history? + - How do I run a subcommand? The backtick doesn't work! + - How do I get the exit status of a command? + - How do I set an environment variable for just one command? + - How do I customize my syntax highlighting colors? + - How do I update man page completions? + - Why does cd, pwd and other fish commands always resolve symlinked directories to their canonical path? + - I accidentally entered a directory path and fish changed directory. What happened? + - The open command doesn't work. + - How do I make fish my default shell? + - I'm seeing weird output before each prompt when using screen. What's wrong? + - How do I change the greeting message? + - Why doesn't history substitution ("!$" etc.) work? + - How do I uninstall fish? \htmlonly[block] @@ -31,6 +47,7 @@
-v
or --on-variable VARIABLE_NAME
tells fish to run this function when the variable VARIABLE_NAME changes value.
-If the user enters any additional arguments after the function, they
-are inserted into the environment variable array
-`$argv`. If the `--argument-names` option is provided, the arguments are
-also assigned to names specified in that option.
+If the user enters any additional arguments after the function, they are inserted into the environment variable array `$argv`. If the `--argument-names` option is provided, the arguments are also assigned to names specified in that option.
By using one of the event handler switches, a function can be made to run automatically at specific events. The user may generate new events using the emit builtin. Fish generates the following named events:
- `fish_prompt`, which is emitted whenever a new fish prompt is about to be displayed.
+
- `fish_command_not_found`, which is emitted whenever a command lookup failed.
+
\subsection function-example Example
\fish
diff --git a/doc_src/functions.txt b/doc_src/functions.txt
index 24e375c45..6e7f92d59 100644
--- a/doc_src/functions.txt
+++ b/doc_src/functions.txt
@@ -15,39 +15,36 @@ functions [-eq] FUNCTIONS...
The following options are available:
- `-a` or `--all` lists all functions, even those whose name start with an underscore.
+
- `-c OLDNAME NEWNAME` or `--copy OLDNAME NEWNAME` creates a new function named NEWNAME, using the definition of the OLDNAME function.
+
- `-d DESCRIPTION` or `--description=DESCRIPTION` changes the description of this function.
+
- `-e` or `--erase` causes the specified functions to be erased.
+
- `-h` or `--help` displays a help message and exits.
+
- `-n` or `--names` lists the names of all defined functions.
+
- `-q` or `--query` tests if the specified functions exist.
-The default behavior of `functions`, when called with no arguments,
-is to print the names of all defined functions. Unless the `-a` option is
-given, no functions starting with underscores are not included in the output.
+The default behavior of `functions`, when called with no arguments, is to print the names of all defined functions. Unless the `-a` option is given, no functions starting with underscores are not included in the output.
-If any non-option parameters are given, the definition of the specified
-functions are printed.
+If any non-option parameters are given, the definition of the specified functions are printed.
-Automatically loaded functions cannot be removed using `functions
--e`. Either remove the definition file or change the
-$fish_function_path variable to remove autoloaded functions.
+Automatically loaded functions cannot be removed using `functions -e`. Either remove the definition file or change the $fish_function_path variable to remove autoloaded functions.
-Copying a function using `-c` copies only the body of the function, and
-does not attach any event notifications from the original function.
+Copying a function using `-c` copies only the body of the function, and does not attach any event notifications from the original function.
-Only one function's description can be changed in a single invocation
-of `functions -d`.
+Only one function's description can be changed in a single invocation of `functions -d`.
+
+The exit status of `functions` is the number of functions specified in the argument list that do not exist, which can be used in concert with the `-q` option.
-The exit status of `functions` is the number of functions
-specified in the argument list that do not exist, which can be used in
-concert with the `-q` option.
\subsection functions-example Examples
`functions -n` displays a list of currently-defined functions.
-`functions -c foo bar` copies the `foo` function to a new function called
-`bar`.
+`functions -c foo bar` copies the `foo` function to a new function called `bar`.
`functions -e bar` erases the function `bar`.
diff --git a/doc_src/help.txt b/doc_src/help.txt
index d862da8cc..e279e62b0 100644
--- a/doc_src/help.txt
+++ b/doc_src/help.txt
@@ -11,11 +11,10 @@ help [SECTION]
If a `SECTION` is specified, the help for that command is shown.
-If the BROWSER environment variable is set, it will be used to display the
-documentation. Otherwise, fish will search for a suitable browser.
+If the BROWSER environment variable is set, it will be used to display the documentation. Otherwise, fish will search for a suitable browser.
+
+Note that most builtin commands display their help in the terminal when given the `--help` option.
-Note that most builtin commands display their help in the terminal when
-given the `--help` option.
\subsection help-example Example
diff --git a/doc_src/history.txt b/doc_src/history.txt
index 1edddd64c..b6e153408 100644
--- a/doc_src/history.txt
+++ b/doc_src/history.txt
@@ -36,12 +36,16 @@ prompt will be given. If `--delete` is specified with either of these
parameters, an interactive prompt will be displayed before any items are
deleted.
+
\subsection history-examples Example
-`history --clear` deletes all history items
+\fish
+history --clear
+# Deletes all history items
-`history --search --contains "foo"` outputs a list of all previous
-commands containing the string "foo".
+history --search --contains "foo"
+# Outputs a list of all previous commands containing the string "foo".
-`history --delete --prefix "foo"` interactively deletes the record
-of previous commands which start with "foo".
+history --delete --prefix "foo"
+# Interactively deletes the record of previous commands which start with "foo".
+\endfish
diff --git a/doc_src/if.txt b/doc_src/if.txt
index c53738010..0e9a7cb14 100644
--- a/doc_src/if.txt
+++ b/doc_src/if.txt
@@ -10,22 +10,17 @@ end
\subsection if-description Description
-`if` will execute the command `CONDITION`. If the condition's
-exit status is 0, the commands `COMMANDS_TRUE` will execute. If the
-exit status is not 0 and `else` is given, `COMMANDS_FALSE` will
-be executed.
+`if` will execute the command `CONDITION`. If the condition's exit status is 0, the commands `COMMANDS_TRUE` will execute. If the exit status is not 0 and `else` is given, `COMMANDS_FALSE` will be executed.
-In order to use the exit status of multiple commands as the condition
-of an if block, use `begin; ...; end` and
-the short circuit commands `and`
-and `or`.
+In order to use the exit status of multiple commands as the condition of an if block, use `begin; ...; end` and the short circuit commands `and` and `or`.
+
+The exit status of the last foreground command to exit can always be accessed using the $status variable.
-The exit status of the last foreground command to exit can always be
-accessed using the $status
-variable.
\subsection if-example Example
+The following code will print `foo.txt exists` if the file foo.txt exists and is a regular file, otherwise it will print `bar.txt exists` if the file bar.txt exists and is a regular file, otherwise it will print `foo.txt and bar.txt do not exist`.
+
\fish
if test -f foo.txt
echo foo.txt exists
@@ -35,9 +30,3 @@ else
echo foo.txt and bar.txt do not exist
end
\endfish
-
-will print `foo.txt exists` if the file foo.txt
-exists and is a regular file, otherwise it will print
-`bar.txt exists` if the file bar.txt exists
-and is a regular file, otherwise it will print
-`foo.txt and bar.txt do not exist`.
diff --git a/doc_src/index.hdr.in b/doc_src/index.hdr.in
index 1f3a9cc3c..a24905c3e 100644
--- a/doc_src/index.hdr.in
+++ b/doc_src/index.hdr.in
@@ -42,11 +42,17 @@ Every program on your computer can be used as a command in `fish`. If the progra
Here is a list of some useful commands:
- `cd`, change the current directory
+
- `ls`, list files and directories
+
- `man`, display a manual page on the screen
+
- `mv`, move (rename) files
+
- `cp`, copy files
+
- `open`, open files with the default application associated with each filetype
+
- `less`, list the contents of files
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.
@@ -80,40 +86,76 @@ would remove the two files 'cumbersome' and 'filename.txt'.
Some characters can not be written directly on the command line. For these characters, so called escape sequences are provided. These are:
- '\\a
' escapes the alert character
+
- '\\b
' escapes the backspace character
+
- '\\e
' escapes the escape character
+
- '\\f
' escapes the form feed character
+
- '\\n
' escapes a newline character
+
- '\\r
' escapes the carriage return character
+
- '\\t
' escapes the tab character
+
- '\\v
' escapes the vertical tab character
+
- '\\
' escapes the space character
+
- '\\$
' escapes the dollar character
+
- '\\\\
' escapes the backslash character
+
- '\\*
' escapes the star character
+
- '\\?
' escapes the question mark character
+
- '\\~
' escapes the tilde character
+
- '\\%
' escapes the percent character
+
- '\\#
' escapes the hash character
+
- '\\(
' escapes the left parenthesis character
+
- '\\)
' escapes the right parenthesis character
+
- '\\{
' escapes the left curly bracket character
+
- '\\}
' escapes the right curly bracket character
+
- '\\[
' escapes the left bracket character
+
- '\\]
' escapes the right bracket character
+
- '\\
' escapes the less than character
+
- '\\\>
' escapes the more than character
+
- '\\^
' escapes the circumflex character
+
- '\\&
' escapes the ampersand character
+
- '\\;
' escapes the semicolon character
+
- '\\"
' escapes the quote character
+
- '\\'
' escapes the apostrophe character
+
- '\\xxx
', where xx
is a hexadecimal number, escapes the ascii character with the specified value. For example, `\x9` is the tab character.
-- '\\Xxx
', where xx
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.
+
+- '\\Xxx
', where xx
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.
+
- '\\ooo
', where ooo
is an octal number, escapes the ascii character with the specified value. For example, `\011` is the tab character.
+
- '\\uxxxx
', where xxxx
is a hexadecimal number, escapes the 16-bit Unicode character with the specified value. For example, `\u9` is the tab character.
+
- '\\Uxxxxxxxx
', where xxxxxxxx
is a hexadecimal number, escapes the 32-bit Unicode character with the specified value. For example, `\U9` is the tab character.
-- '\\cx
', where x
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
+
+- '\\cx
', where x
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
\subsection redirects Input/Output (IO) redirection
@@ -121,7 +163,9 @@ Some characters can not be written directly on the command line. For these chara
Most programs use three input/output (IO) streams, each represented by a number called a file descriptor (FD). These are:
- Standard input, FD 0, for reading, defaults to reading from the keyboard.
+
- Standard output, FD 1, for writing, defaults to writing to the screen.
+
- Standard error, FD 2, for writing errors and warnings, defaults to writing to the screen.
The reason for providing for two output file descriptors is to allow
@@ -232,6 +276,7 @@ end
There are a few important things that need to be noted about aliases:
- Always take care to add the `$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 refix the call to the program with `command` in order to tell fish that the unction should not call itself, but rather a command with the same name. ailing to do so will cause infinite recursion bugs.
To easily create a function of this form, you can use the alias command.
@@ -262,12 +307,19 @@ The other conditionals use the exit status of a
This is a short explanation of some of the commonly used words in fish.
- argument a parameter given to a command
+
- 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.
+
- 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.
+
- 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
+
- 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.
@@ -296,18 +348,27 @@ Tab completion is one of the most time saving features of any modern shell. By t
These are the general purpose tab completions that `fish` provides:
- Completion of commands (builtins, functions and regular programs).
+
- Completion of shell variable names.
+
- Completion of usernames for tilde expansion.
+
- Completion of filenames, even on strings with wildcards such as '`*`', '`**`' and '`?`'.
+
- Completion of job ID, job name and process names for process expansion.
`fish` provides a large number of program specific completions. Most of these completions are simple options like the `-l` option for `ls`, but some are more advanced. The latter include:
- The programs `man` and `whatis` show all installed manual pages as completions.
+
- The `make` program uses all targets in the Makefile in the current directory as completions.
+
- The `mount` command uses all mount points specified in fstab as completions.
+
- The `ssh` command uses all hosts that are stored in the known_hosts file as completions. (See the ssh documentation for more information)
+
- The `su` command uses all users on the system as completions.
+
- The `apt-get`, `rpm` and `yum` commands use all installed packages as completions.
@@ -332,16 +393,24 @@ For examples of how to write your own complex completions, study the 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.
-Functions beginning with the string `__fish_print_` print a newline- separated list of strings. For example, `__fish_print_filesystems` prints a list of all known file systems. Functions 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.
+Functions beginning with the string `__fish_print_` print a newline separated list of strings. For example, `__fish_print_filesystems` prints a list of all known file systems. Functions 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.
- `__fish_complete_directories STRING DESCRIPTION` performs path completion on STRING, allowing only directories, and giving them the description DESCRIPTION.
+
- `__fish_complete_groups` prints a list of all user groups with the groups members as description.
+
- `__fish_complete_pids` prints a list of all processes IDs with the command name as description.
+
- `__fish_complete_suffix SUFFIX` performs file completion allowing only files ending in SUFFIX. The mimetype database is used to find a suitable description.
+
- `__fish_complete_users` prints a list of all users with their full name as description.
+
- `__fish_print_filesystems` 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 actually understands.
+
- `__fish_print_hostnames` 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.
+
- `__fish_print_interfaces` prints a list of all known network interfaces.
+
- `__fish_print_packages` prints a list of all installed packages. This function currently handles Debian, rpm and Gentoo packages.
@@ -364,7 +433,9 @@ When an argument for a program is given on the commandline, it undergoes the pro
If a star (`*`) or a question mark (`?`) is present in the parameter, `fish` attempts to match the given parameter to any files in such a way that:
- '`?`' can match any single character except '/'.
+
- '`*`' 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.
Wildcard matches are sorted case insensitively. When sorting matches 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.
@@ -374,7 +445,9 @@ File names beginning with a dot are not considered when wildcarding unless a dot
Examples:
- `a*` matches any files beginning with an 'a' in the current directory.
+
- `???` matches any file in the current directory whose name is exactly three characters long.
+
- `**` matches any files and directories in the current directory and all of its subdirectories.
Note that if no matches are found for a specific wildcard, it will expand into 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.
@@ -406,6 +479,7 @@ The command begin; set -l IFS; set data (cat data.txt); end
will set the \c data variable to the contents of 'data.txt' without
splitting it into an array.
+
\subsection expand-brace Brace expansion
A comma separated list of characters enclosed in curly braces will be expanded so each element of the list becomes a new parameter.
@@ -419,6 +493,7 @@ mv *.{c,h} src/
# Moves all files with the suffix '.c' or '.h' to the subdirectory src.
\endfish
+
\subsection expand-variable Variable expansion
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 Shell variables section.
@@ -502,6 +577,7 @@ echo $PATH[$n..-1]
Note that variables can be used as indices for expansion of variables, but not command substitution.
+
\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.
@@ -512,9 +588,13 @@ The `~` (tilde) character at the beginning of a parameter, followed by a usernam
The `%` (percent) character at the beginning of a parameter followed by a string is expanded into a process ID (PID). The following expansions are performed:
- If the string is the entire word `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.
+
- Otherwise, if any child processes match the specified string, their PIDs are the result of the expansion.
+
- Otherwise, if any processes owned by the user match the specified string, their PIDs are the result of the expansion.
+
- If none of these matches apply, an error is produced.
This form of expansion is useful for commands like kill and fg, which take process IDs as arguments.
@@ -533,9 +613,13 @@ All of the above expansions can be combined. If several expansions result in mor
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.
@@ -596,8 +680,8 @@ Universal variables are variables that are shared between all the users fish ses
To see universal variables in action, start two fish sessions side by side, and issue the following command in one of them `set fish_color_cwd blue`. Since `fish_color_cwd` is a universal 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
+\subsection variables-functions Variable scope for functions
When calling a function, all current local variables temporarily disappear. This shadowing of the local scope is needed since the variable namespace would become cluttered, making it very easy to accidentally overwrite variables from another function.
@@ -701,9 +785,9 @@ values of most of these variables.
- \c USER, the current username. This variable can be changed by the user.
- \c CMD_DURATION, the runtime of the last command in milliseconds.
-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
-bash.
+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 bash.
+
+Variables whose name are in uppercase are exported to the commands started by fish, while those in lowercase are not exported. This rule is not enforced by fish, but it is good coding practice to use casing to distinguish between exported and unexported variables. `fish` also uses several variables internally. Such variables are prefixed with the string `__FISH` or `__fish`. These should never be used by the user. Changing their value may break fish.
Variables whose name are in uppercase are exported to the commands
started by fish, while those in lowercase are not exported. This rule is not
@@ -722,9 +806,13 @@ Fish stores the exit status of the last process in the last job to exit in the `
If `fish` encounters a problem while executing a command, the status variable may also be set to a specific value:
- 1 is the generally the exit status from fish builtin commands if they were supplied with invalid arguments
+
- 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
+
- 127 means that no function, builtin or command with the given name could be located
If a process exits through a signal, the exit status will be 128 plus the number of the signal.
@@ -737,26 +825,42 @@ The colors used by fish for syntax highlighting can be configured by changing th
The following variables are available to change the highlighting colors in fish:
- `fish_color_normal`, the default color
+
- `fish_color_command`, the color for commands
+
- `fish_color_quote`, the color for quoted blocks of text
+
- `fish_color_redirection`, the color for IO redirections
+
- `fish_color_end`, the color for process separators like ';' and '&'
+
- `fish_color_error`, the color used to highlight potential errors
+
- `fish_color_param`, the color for regular command parameters
+
- `fish_color_comment`, the color used for code comments
+
- `fish_color_match`, the color used to highlight matching parenthesis
+
- `fish_color_search_match`, the color used to highlight history search matches
+
- `fish_color_operator`, the color for parameter expansion operators like '*' and '~'
+
- `fish_color_escape`, the color used to highlight character escapes like '\\n' and '\\x70'
+
- `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:
- `fish_pager_color_prefix`, the color of the prefix string, i.e. the string that is to be completed
+
- `fish_pager_color_completion`, the color of the completion itself
+
- `fish_pager_color_description`, the color of the completion description
+
- `fish_pager_color_progress`, the color of the progress bar at the bottom left corner
+
- `fish_pager_color_secondary`, the background color of the every second completion
Example:
@@ -792,25 +896,45 @@ Similar to bash, fish has Emacs and Vi editing modes. The default editing mode i
\subsection emacs-mode Emacs mode commands
- @key{Tab} completes the current token.
+
- @key{Home} or @key{Control,A} moves the cursor to the beginning of the line.
+
- @key{End} or @key{Control,E} moves to the end of line. If the cursor is already at the end of the line, and an autosuggestion is available, @key{End} or @key{Control,E} accepts the autosuggestion.
+
- @cursor_key{←,Left} (or @key{Control,B}) and @cursor_key{→,Right} (or @key{Control,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 @cursor_key{→,Right} key and the @key{Control,F} combination accept the suggestion.
+
- @key{Alt,←,Left} and @key{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, @key{Alt,→,Right} (or @key{Alt,F}) accepts the first word in the suggestion.
+
- @cursor_key{↑,Up} and @cursor_key{↓,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 history section for more information on history searching.
+
- @key{Alt,↑,Up} and @key{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 history section for more information on history searching.
+
- @key{Delete} and @key{Backspace} removes one character forwards or backwards respectively.
+
- @key{Control,C} deletes the entire line.
+
- @key{Control,D} delete one character to the right of the cursor. If the command line is empty, @key{Control,D} will exit fish.
+
- @key{Control,K} moves contents from the cursor to the end of line to the killring.
+
- @key{Control,U} moves contents from the beginning of line to the cursor to the killring.
+
- @key{Control,L} clears and repaints the screen.
+
- @key{Control,W} moves the previous word to the killring.
+
- @key{Alt,D} moves the next word to the killring.
+
- @key{Alt,W} prints a short description of the command under the cursor.
+
- @key{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.
+
- @key{Alt,P} adds the string '`| less;`' to the end of the job under the cursor. The result is that the output of the command will be paged.
+
- @key{Alt,C} capitalizes the current word.
+
- @key{Alt,U} makes the current word uppercase.
+
- @key{F1} shows the manual page for the current command, if one exists.
You can change these key bindings using the bind builtin command.
@@ -821,15 +945,25 @@ You can change these key bindings using the bindjobs and their status.
+
+`jobs` prints a list of the currently running jobs and their status.
jobs accepts the following switches:
- `-c` or `--command` prints the command name for each process in jobs.
+
- `-g` or `--group` only prints the group ID of each job.
+
- `-h` or `--help` displays a help message and exits.
+
- `-l` or `--last` prints only the last job to be started.
+
- `-p` or `--pid` prints the process ID for each process in all jobs.
-On systems that supports this feature, jobs will print the CPU usage
-of each job since the last command was executed. The CPU usage is
-expressed as a percentage of full CPU activity. Note that on
-multiprocessor systems, the total activity may be more than 100\%.
+On systems that supports this feature, jobs will print the CPU usage of each job since the last command was executed. The CPU usage is expressed as a percentage of full CPU activity. Note that on multiprocessor systems, the total activity may be more than 100\%.
+
\subsection jobs-example Example
diff --git a/doc_src/license.hdr b/doc_src/license.hdr
index 1d736e4fa..037828cec 100644
--- a/doc_src/license.hdr
+++ b/doc_src/license.hdr
@@ -7,8 +7,7 @@
\endhtmlonly
-`fish` Copyright © 2005-2009 Axel Liljencrantz. `fish` is released under the GNU
-General Public License, version 2. The license agreement is included below.
+`fish` Copyright © 2005-2009 Axel Liljencrantz. `fish` is released under the GNU General Public License, version 2. The license agreement is included below.
## GNU GENERAL PUBLIC LICENSE
@@ -25,318 +24,126 @@ Version 2, June 1991
## Preamble
-The licenses for most software are designed to take away your freedom to share
-and change it. By contrast, the GNU General Public License is intended to
-guarantee your freedom to share and change free software - to make sure the
-software is free for all its users. This General Public License applies to
-most of the Free Software Foundation's software and to any other program whose
-authors commit to using it. (Some other Free Software Foundation software is
-covered by the GNU Library General Public License instead.) You can apply it
-to your programs, too.
+The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software - to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too.
-When we speak of free software, we are referring to freedom, not price. Our
-General Public Licenses are designed to make sure that you have the freedom to
-distribute copies of free software (and charge for this service if you wish),
-that you receive source code or can get it if you want it, that you can change
-the software or use pieces of it in new free programs; and that you know you
-can do these things.
+When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things.
-To protect your rights, we need to make restrictions that forbid anyone to
-deny you these rights or to ask you to surrender the rights. These
-restrictions translate to certain responsibilities for you if you distribute
-copies of the software, or if you modify it.
+To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it.
-For example, if you distribute copies of such a program, whether gratis or for
-a fee, you must give the recipients all the rights that you have. You must
-make sure that they, too, receive or can get the source code. And you must
-show them these terms so they know their rights.
+For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.
-We protect your rights with two steps: (1) copyright the software, and (2)
-offer you this license which gives you legal permission to copy, distribute
-and/or modify the software.
+We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software.
-Also, for each author's protection and ours, we want to make certain that
-everyone understands that there is no warranty for this free software. If the
-software is modified by someone else and passed on, we want its recipients to
-know that what they have is not the original, so that any problems introduced
-by others will not reflect on the original authors' reputations.
+Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations.
-Finally, any free program is threatened constantly by software patents. We
-wish to avoid the danger that redistributors of a free program will
-individually obtain patent licenses, in effect making the program proprietary.
-To prevent this, we have made it clear that any patent must be licensed for
-everyone's free use or not licensed at all.
+Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all.
-The precise terms and conditions for copying, distribution and modification
-follow.
+The precise terms and conditions for copying, distribution and modification follow.
## TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-- This License applies to any program or other work which contains a notice
-placed by the copyright holder saying it may be distributed under the terms of
-this General Public License. The "Program", below, refers to any such program
-or work, and a "work based on the Program" means either the Program or any
-derivative work under copyright law: that is to say, a work containing the
-Program or a portion of it, either verbatim or with modifications and/or
-translated into another language. (Hereinafter, translation is included
-without limitation in the term "modification".) Each licensee is addressed as
-"you".
+- This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you".
- Activities other than copying, distribution and modification are not covered
-by this License; they are outside its scope. The act of running the Program
-is not restricted, and the output from the Program is covered only if its
-contents constitute a work based on the Program (independent of having been
-made by running the Program). Whether that is true depends on what the Program
-does.
+ Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does.
-1. You may copy and distribute verbatim copies of the Program's source code as
-you receive it, in any medium, provided that you conspicuously and
-appropriately publish on each copy an appropriate copyright notice and
-disclaimer of warranty; keep intact all the notices that refer to this License
-and to the absence of any warranty; and give any other recipients of the
-Program a copy of this License along with the Program.
+1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program.
- You may charge a fee for the physical act of transferring a copy, and you may
-at your option offer warranty protection in exchange for a fee.
+ You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.
-2. You may modify your copy or copies of the Program or any portion of it,
-thus forming a work based on the Program, and copy and distribute such
-modifications or work under the terms of Section 1 above, provided that you
-also meet all of these conditions:
+2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:
- -# You must cause the modified files to carry prominent notices stating
-that you changed the files and the date of any change.
+ -# You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change.
- -# You must cause any work that you distribute or publish, that in whole or
-in part contains or is derived from the Program or any part thereof, to be
-licensed as a whole at no charge to all third parties under the terms of this
-License.
+ -# You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License.
- -# If the modified program normally reads commands interactively when run,
-you must cause it, when started running for such interactive use in the most
-ordinary way, to print or display an announcement including an appropriate
-copyright notice and a notice that there is no warranty (or else, saying that
-you provide a warranty) and that users may redistribute the program under
-these conditions, and telling the user how to view a copy of this License.
-(Exception: if the Program itself is interactive but does not normally print
-such an announcement, your work based on the Program is not required to print
-an announcement.)
+ -# If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.)
- These requirements apply to the modified work as a whole. If identifiable
-sections of that work are not derived from the Program, and can be reasonably
-considered independent and separate works in themselves, then this License,
-and its terms, do not apply to those sections when you distribute them as
-separate works. But when you distribute the same sections as part of a whole
-which is a work based on the Program, the distribution of the whole must be on
-the terms of this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
+ These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.
- Thus, it is not the intent of this section to claim rights or contest your
-rights to work written entirely by you; rather, the intent is to exercise the
-right to control the distribution of derivative or collective works based on
-the Program.
+ Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program.
- In addition, mere aggregation of another work not based on the Program with
-the Program (or with a work based on the Program) on a volume of a storage or
-distribution medium does not bring the other work under the scope of this
-License.
+ In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.
-3. You may copy and distribute the Program (or a work based on it, under
-Section 2) in object code or executable form under the terms of Sections 1 and
-2 above provided that you also do one of the following:
+3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following:
- -# Accompany it with the complete corresponding machine-readable source code,
-which must be distributed under the terms of Sections 1 and 2 above on a
-medium customarily used for software interchange; or,
+ -# Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
- -# Accompany it with a written offer, valid for at least three years, to give
-any third party, for a charge no more than your cost of physically
-performing source distribution, a complete machine-readable copy of the
-corresponding source code, to be distributed under the terms of Sections 1
-and 2 above on a medium customarily used for software interchange; or,
+ -# Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
- -# Accompany it with the information you received as to the offer to
-distribute corresponding source code. (This alternative is allowed only
-for noncommercial distribution and only if you received the program in
-object code or executable form with such an offer, in accord with
-Subsection b above.)
+ -# Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.)
- The source code for a work means the preferred form of the work for making
-modifications to it. For an executable work, complete source code means all
-the source code for all modules it contains, plus any associated interface
-definition files, plus the scripts used to control compilation and
-installation of the executable. However, as a special exception, the source
-code distributed need not include anything that is normally distributed (in
-either source or binary form) with the major components (compiler, kernel, and
-so on) of the operating system on which the executable runs, unless that
-component itself accompanies the executable.
+ The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.
- If distribution of executable or object code is made by offering access to
-copy from a designated place, then offering equivalent access to copy the
-source code from the same place counts as distribution of the source code,
-even though third parties are not compelled to copy the source along with the
-object code.
+ If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code.
-4. You may not copy, modify, sublicense, or distribute the Program except as
-expressly provided under this License. Any attempt otherwise to copy, modify,
-sublicense or distribute the Program is void, and will automatically terminate
-your rights under this License. However, parties who have received copies, or
-rights, from you under this License will not have their licenses terminated so
-long as such parties remain in full compliance.
+4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.
-5. You are not required to accept this License, since you have not signed it.
-However, nothing else grants you permission to modify or distribute the
-Program or its derivative works. These actions are prohibited by law if you
-do not accept this License. Therefore, by modifying or distributing the
-Program (or any work based on the Program), you indicate your acceptance of
-this License to do so, and all its terms and conditions for copying,
-distributing or modifying the Program or works based on it.
+5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it.
-6. Each time you redistribute the Program (or any work based on the Program),
-the recipient automatically receives a license from the original licensor to
-copy, distribute or modify the Program subject to these terms and conditions.
-You may not impose any further restrictions on the recipients' exercise of the
-rights granted herein. You are not responsible for enforcing compliance by
-third parties to this License.
+6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License.
-7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or otherwise)
-that contradict the conditions of this License, they do not excuse you from
-the conditions of this License. If you cannot distribute so as to satisfy
-simultaneously your obligations under this License and any other pertinent
-obligations, then as a consequence you may not distribute the Program at all.
-For example, if a patent license would not permit royalty-free redistribution
-of the Program by all those who receive copies directly or indirectly through
-you, then the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
+7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program.
- If any portion of this section is held invalid or unenforceable under any
-particular circumstance, the balance of the section is intended to apply and
-the section as a whole is intended to apply in other circumstances.
+ If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances.
- It is not the purpose of this section to induce you to infringe any patents or
-other property right claims or to contest validity of any such claims; this
-section has the sole purpose of protecting the integrity of the free software
-distribution system, which is implemented by public license practices. Many
-people have made generous contributions to the wide range of software
-distributed through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing to
-distribute software through any other system and a licensee cannot impose that
-choice.
+ It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.
- This section is intended to make thoroughly clear what is believed to be a
-consequence of the rest of this License.
+ This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.
-8. If the distribution and/or use of the Program is restricted in certain
-countries either by patents or by copyrighted interfaces, the original
-copyright holder who places the Program under this License may add an explicit
-geographical distribution limitation excluding those countries, so that
-distribution is permitted only in or among countries not thus excluded. In
-such case, this License incorporates the limitation as if written in the body
-of this License.
+8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.
-9. The Free Software Foundation may publish revised and/or new versions of the
-General Public License from time to time. Such new versions will be similar
-in spirit to the present version, but may differ in detail to address new
-problems or concerns.
+9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
- Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any later
-version", you have the option of following the terms and conditions either of
-that version or of any later version published by the Free Software
-Foundation. If the Program does not specify a version number of this License,
-you may choose any version ever published by the Free Software Foundation.
+ Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation.
-10. If you wish to incorporate parts of the Program into other free programs
-whose distribution conditions are different, write to the author to ask for
-permission. For software which is copyrighted by the Free Software
-Foundation, write to the Free Software Foundation; we sometimes make
-exceptions for this. Our decision will be guided by the two goals of
-preserving the free status of all derivatives of our free software and of
-promoting the sharing and reuse of software generally.
+10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.
__NO WARRANTY__
-11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR
-THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE
-STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE
-PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
-INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
-FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND
-PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE,
-YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL
-ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE
-THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
-GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE
-OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR
-DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR
-A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH
-HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
----
+
## License for wcslcat and wcslcpy
+`fish` also contains small amounts of code under the BSD license, namely versions of the two functions strlcat and strlcpy, modified for use with wide character strings. This code is copyrighted by Todd C. Miller.
-`fish` also contains small amounts of code under the BSD license, namely
-versions of the two functions strlcat and strlcpy, modified for use with wide
-character strings. This code is copyrighted by Todd C. Miller.
+Permission to use, copy, modify, and distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
-Permission to use, copy, modify, and distribute this software for any purpose
-with or without fee is hereby granted, provided that the above copyright
-notice and this permission notice appear in all copies.
-
-THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
-REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
-INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
-LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-PERFORMANCE OF THIS SOFTWARE.
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
----
+
## License for XSel
-
-The XSel command, written and copyrighted by Conrad Parker, is distributed
-together with `fish`.
+The XSel command, written and copyrighted by Conrad Parker, is distributed together with `fish`.
It is Copyright © 2001 Conrad Parker \