mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-04 15:51:15 -03:00
Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
216a45edee | ||
|
|
7828f2303a | ||
|
|
245be2c2e4 | ||
|
|
14b953e414 | ||
|
|
ade6ebf522 | ||
|
|
768277a312 | ||
|
|
c53951b9b3 | ||
|
|
46b819a265 | ||
|
|
4d1e77fcae | ||
|
|
4efd0dfd65 | ||
|
|
c1e15ef084 | ||
|
|
8ec81393a3 |
22
CHANGELOG.md
22
CHANGELOG.md
@@ -1,3 +1,21 @@
|
||||
# fish 2.3.0 (released May 20, 2016)
|
||||
|
||||
There are no significant changes between 2.3.0 and 2.3b2.
|
||||
|
||||
## Other notable fixes and improvements
|
||||
|
||||
- `abbr` now allows non-letter keys (#2996).
|
||||
- Define a few extra colours on first start (#2987).
|
||||
- Multiple documentation updates.
|
||||
- Added completions for rmmod (#3007).
|
||||
- Improved completions for git (#2998).
|
||||
|
||||
## Known issues
|
||||
|
||||
- Interactive commands started from fish configuration files or from the `-c` option may, under certain circumstances, be started with incorrect terminal modes and fail to behave as expected. A fix is planned but requires further testing (#2619).
|
||||
|
||||
---
|
||||
|
||||
# fish 2.3b2 (released May 5, 2016)
|
||||
|
||||
## Significant changes
|
||||
@@ -12,6 +30,8 @@
|
||||
- Avoid confusing the terminal line driver with non-printing characters in `fish_title` (#2453).
|
||||
- Improved completions for busctl, git (#2585, #2879, #2984), and netctl.
|
||||
|
||||
---
|
||||
|
||||
# fish 2.3b1 (released April 19, 2016)
|
||||
|
||||
## Significant Changes
|
||||
@@ -67,6 +87,8 @@
|
||||
- PWD shortening in the prompt can now be configured via the `fish_prompt_pwd_dir_length` variable, set to the length per path component (#2473)
|
||||
- fish no longer requires `/etc/fish/config.fish` to correctly start, and now ships a skeleton file that only contains some documentation (#2799)
|
||||
|
||||
---
|
||||
|
||||
# fish 2.2.0 (released July 12, 2015)
|
||||
|
||||
### Significant changes ###
|
||||
|
||||
@@ -7,11 +7,12 @@ 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 previous command) is 0.
|
||||
|
||||
`and` does not change the current exit status.
|
||||
`and` statements may be used as part of the condition in an <a href="#if">`and`</a> or <a href="#while">`while`</a> block. See the documentation
|
||||
for <a href="#if">`if`</a> and <a href="#while">`while`</a> for examples.
|
||||
|
||||
The exit status of the last foreground command to exit can always be accessed using the <a href="index.html#variables-status">$status</a> variable.
|
||||
`and` does not change the current exit status. The exit status of the last foreground command to exit can always be accessed using the <a href="index.html#variables-status">$status</a> variable.
|
||||
|
||||
|
||||
\subsection and-example Example
|
||||
|
||||
@@ -136,10 +136,10 @@ The `open` command uses the MIME type database and the `.desktop` files used by
|
||||
<hr>
|
||||
\section faq-default How do I make fish my default shell?
|
||||
|
||||
If you installed fish manually (e.g. by compiling it, not by using a package manager), you first need to add fish to the list of shells by executing the following command (assuming you installed fish in /usr/local) as root:
|
||||
If you installed fish manually (e.g. by compiling it, not by using a package manager), you first need to add fish to the list of shells by executing the following command (assuming you installed fish in /usr/local):
|
||||
|
||||
\fish{cli-dark}
|
||||
echo /usr/local/bin/fish >>/etc/shells
|
||||
echo /usr/local/bin/fish | sudo tee -a /etc/shells
|
||||
\endfish
|
||||
|
||||
If you installed a prepackaged version of fish, the package manager should have already done this for you.
|
||||
|
||||
@@ -12,7 +12,7 @@ end
|
||||
|
||||
`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 <a href="#begin">`begin; ...; end`</a> and the short circuit commands <a href="commands.html#and">`and`</a> and <a href="commands.html#or">`or`</a>.
|
||||
You can use <a href="#and">`and`</a> or <a href="#and">`or`</a> in the condition. See the second example below.
|
||||
|
||||
The exit status of the last foreground command to exit can always be accessed using the <a href="index.html#variables-status">$status</a> variable.
|
||||
|
||||
@@ -33,9 +33,8 @@ end
|
||||
|
||||
The following code will print "foo.txt exists and is readable" if foo.txt is a regular file and readable
|
||||
\fish
|
||||
if begin test -f foo.txt
|
||||
and test -r foo.txt
|
||||
end
|
||||
if test -f foo.txt
|
||||
and test -r foo.txt
|
||||
echo "foo.txt exists and is readable"
|
||||
end
|
||||
\endfish
|
||||
|
||||
@@ -396,7 +396,7 @@ By default, Fish searches the following for completions, using the first availab
|
||||
- A directory for systems administrators to install completions for all users on the system, usually `/etc/fish/completions`;
|
||||
- A directory for third-party software vendors to ship their own completions for their software, usually `/usr/share/fish/vendor_completions.d`;
|
||||
- The completions shipped with fish, usually installed in `/usr/share/fish/completions`; and
|
||||
- Completions automatically generated from the operating system's manual, usually stored in `~/.local/share/generated_completions`.
|
||||
- Completions automatically generated from the operating system's manual, usually stored in `~/.local/share/fish/generated_completions`.
|
||||
|
||||
These paths are controlled by parameters set at build, install, or run time, and may vary from the defaults listed above.
|
||||
|
||||
@@ -522,7 +522,7 @@ echo The plural of $WORD is {$WORD}s
|
||||
|
||||
Note that without the quotes or braces, fish will try to expand a variable called `$WORDs`, which may not exist.
|
||||
|
||||
The latter syntax `{$WORD}` works by exploiting <a href="#expand-brace">brace expansion</a>; care should be taken with array variables and undefined variables, as these behave very differently to POSIX shells.
|
||||
The latter syntax `{$WORD}` works by exploiting <a href="#expand-brace">brace expansion</a>; care should be taken with array variables and undefined variables, as these expand as a <a href="#cartesian-product">cartesian product</a>, so undefined variables eliminate the string.
|
||||
|
||||
Variable expansion is the only type of expansion performed on double quoted strings. There is, however, an important difference in how variables are expanded when quoted and when unquoted. An unquoted variable expansion will result in a variable number of arguments. For example, if the variable `$foo` has zero elements or is undefined, the argument `$foo` will expand to zero elements. If the variable $foo is an array of five elements, the argument `$foo` will expand to five elements. When quoted, like `"$foo"`, a variable expansion will always result in exactly one argument. Undefined variables will expand to the empty string, and array variables will be concatenated using the space character.
|
||||
|
||||
@@ -900,6 +900,10 @@ The following variables are available to change the highlighting colors in fish:
|
||||
|
||||
- `fish_color_autosuggestion`, the color used for autosuggestions
|
||||
|
||||
- `fish_color_user`, the color used to print the current username in some of fish default prompts
|
||||
|
||||
- `fish_color_host`, the color used to print the current host system in some of fish default prompts
|
||||
|
||||
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
|
||||
|
||||
@@ -7,12 +7,12 @@ COMMAND1; or COMMAND2
|
||||
|
||||
\subsection or-description Description
|
||||
|
||||
`or` is used to execute a command if the current exit status (as set by the last previous command) is not 0.
|
||||
`or` is used to execute a command if the current exit status (as set by the previous command) is not 0.
|
||||
|
||||
`or` does not change the current exit status.
|
||||
|
||||
The exit status of the last foreground command to exit can always be accessed using the <a href="index.html#variables-status">$status</a> variable.
|
||||
`or` statements may be used as part of the condition in an <a href="#if">`and`</a> or <a href="#while">`while`</a> block. See the documentation
|
||||
for <a href="#if">`if`</a> and <a href="#while">`while`</a> for examples.
|
||||
|
||||
`or` does not change the current exit status. The exit status of the last foreground command to exit can always be accessed using the <a href="index.html#variables-status">$status</a> variable.
|
||||
|
||||
\subsection or-example Example
|
||||
|
||||
|
||||
@@ -11,12 +11,11 @@ while CONDITION; COMMANDS...; end
|
||||
|
||||
If the exit status of `CONDITION` is non-zero on the first iteration, `COMMANDS` will not be executed at all.
|
||||
|
||||
Use <a href="#begin">`begin; ...; end`</a> for complex conditions; more complex control can be achieved with `while true` containing a <a href="#break">break</a>.
|
||||
|
||||
You can use <a href="#and">`and`</a> or <a href="#and">`or`</a> for complex conditions. Even more complex control can be achieved with `while true` containing a <a href="#break">break</a>.
|
||||
|
||||
\subsection while-example Example
|
||||
|
||||
\fish
|
||||
while test -f foo.txt; echo file exists; sleep 10; end
|
||||
# outputs 'file exists' at 10 second intervals as long as the file foo.txt exists.
|
||||
\endfish
|
||||
while test -f foo.txt; or test -f bar.txt ; echo file exists; sleep 10; end
|
||||
# outputs 'file exists' at 10 second intervals as long as the file foo.txt or bar.txt exists.
|
||||
\endfish
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>2.2.991</string>
|
||||
<string>2.3.0</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>0.1</string>
|
||||
<key>LSApplicationCategoryType</key>
|
||||
|
||||
38
osx/config.h
38
osx/config.h
@@ -222,7 +222,7 @@
|
||||
#define PACKAGE_NAME "fish"
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
#define PACKAGE_STRING "fish 2.3b2"
|
||||
#define PACKAGE_STRING "fish 2.3.0"
|
||||
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#define PACKAGE_TARNAME "fish"
|
||||
@@ -231,7 +231,7 @@
|
||||
#define PACKAGE_URL ""
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#define PACKAGE_VERSION "2.3b2"
|
||||
#define PACKAGE_VERSION "2.3.0"
|
||||
|
||||
/* The size of `wchar_t', as computed by sizeof. */
|
||||
#define SIZEOF_WCHAR_T 4
|
||||
@@ -248,17 +248,49 @@
|
||||
/* Perform string translations with gettext */
|
||||
/* #undef USE_GETTEXT */
|
||||
|
||||
/* Enable extensions on AIX 3, Interix. */
|
||||
#ifndef _ALL_SOURCE
|
||||
# define _ALL_SOURCE 1
|
||||
#endif
|
||||
/* Enable GNU extensions on systems that have them. */
|
||||
#ifndef _GNU_SOURCE
|
||||
# define _GNU_SOURCE 1
|
||||
#endif
|
||||
/* Enable threading extensions on Solaris. */
|
||||
#ifndef _POSIX_PTHREAD_SEMANTICS
|
||||
# define _POSIX_PTHREAD_SEMANTICS 1
|
||||
#endif
|
||||
/* Enable extensions on HP NonStop. */
|
||||
#ifndef _TANDEM_SOURCE
|
||||
# define _TANDEM_SOURCE 1
|
||||
#endif
|
||||
/* Enable general extensions on Solaris. */
|
||||
#ifndef __EXTENSIONS__
|
||||
# define __EXTENSIONS__ 1
|
||||
#endif
|
||||
|
||||
|
||||
/* The size of wchar_t in bits. */
|
||||
#define WCHAR_T_BITS 32
|
||||
|
||||
/* Define to 1 if on MINIX. */
|
||||
/* #undef _MINIX */
|
||||
|
||||
/* Macro to enable additional prototypes under BSD */
|
||||
/* #undef _NETBSD_SOURCE */
|
||||
|
||||
/* Define to 2 if the system does not provide POSIX.1 features except with
|
||||
this defined. */
|
||||
/* #undef _POSIX_1_SOURCE */
|
||||
|
||||
/* Define to 1 if you need to in order for `stat' and other things to work. */
|
||||
/* #undef _POSIX_SOURCE */
|
||||
|
||||
/* Macro to enable additional prototypes under BSD */
|
||||
/* #undef __BSD_VISIBLE */
|
||||
|
||||
/* Macro to enable additional prototypes under Solaris */
|
||||
/* #undef __EXTENSIONS__ */
|
||||
#define __EXTENSIONS__ 1
|
||||
|
||||
#if __GNUC__ >= 3
|
||||
#ifndef __warn_unused
|
||||
|
||||
@@ -245,6 +245,7 @@ complete -f -c git -n "__fish_git_using_command remote; and __fish_seen_subcomma
|
||||
complete -f -c git -n '__fish_git_needs_command' -a show -d 'Shows the last commit of a branch'
|
||||
complete -f -c git -n '__fish_git_using_command show' -a '(__fish_git_branches)' -d 'Branch'
|
||||
complete -f -c git -n '__fish_git_using_command show' -a '(__fish_git_unique_remote_branches)' -d 'Remote branch'
|
||||
complete -f -c git -n '__fish_git_using_command show' -a '(__fish_git_tags)' --description 'Tag'
|
||||
complete -f -c git -n '__fish_git_using_command show' -a '(__fish_git_commits)'
|
||||
# TODO options
|
||||
|
||||
|
||||
8
share/completions/rmmod.fish
Normal file
8
share/completions/rmmod.fish
Normal file
@@ -0,0 +1,8 @@
|
||||
# rmmod completion
|
||||
complete -c rmmod -x -a "(/sbin/lsmod | awk 'NR > 1 {print \$1}')"
|
||||
|
||||
complete -c rmmod -s h -l help -d "Prints the help text."
|
||||
complete -c rmmod -s s -l syslog -d "Send errors to syslog instead of standard error."
|
||||
complete -c rmmod -s v -l verbose -d "Print messages about what the program is doing."
|
||||
complete -c rmmod -s V -l version -d "Show version of program and exit"
|
||||
complete -c rmmod -s f -l force -d "With this option, you can remove modules which are being used, or which are not designed to be removed, or have been marked as unsafe"
|
||||
@@ -9,7 +9,7 @@ function __fish_cancel_commandline
|
||||
#
|
||||
# Set reverse fg/bg color mode, output ^C, restore normal mode, clear to EOL (to erase any
|
||||
# autosuggestion).
|
||||
echo (tput smso)"^C"(tput rmso)(tput el)
|
||||
echo -n (tput smso)"^C"(tput rmso)(tput el)
|
||||
for i in (seq (commandline -L))
|
||||
echo ""
|
||||
end
|
||||
|
||||
@@ -46,8 +46,12 @@ function __fish_config_interactive -d "Initializations that should be performed
|
||||
set -q fish_color_error; or set -U fish_color_error red --bold
|
||||
set -q fish_color_escape; or set -U fish_color_escape cyan
|
||||
set -q fish_color_operator; or set -U fish_color_operator cyan
|
||||
set -q fish_color_end; or set -U fish_color_end green
|
||||
set -q fish_color_quote; or set -U fish_color_quote brown
|
||||
set -q fish_color_autosuggestion; or set -U fish_color_autosuggestion 555 yellow
|
||||
set -q fish_color_user; or set -U fish_color_user green
|
||||
|
||||
set -q fish_color_host; or set -U fish_color_host normal
|
||||
set -q fish_color_valid_path; or set -U fish_color_valid_path --underline
|
||||
|
||||
set -q fish_color_cwd; or set -U fish_color_cwd green
|
||||
|
||||
@@ -85,7 +85,7 @@ function abbr --description "Manage abbreviations"
|
||||
set key $kv[1]
|
||||
set value $kv[2]
|
||||
# ensure the key contains at least one non-space character
|
||||
if not string match -qr "\w" -- $key
|
||||
if not string match -qr "[^\s]" -- $key
|
||||
printf ( _ "%s: abbreviation must have a non-empty key\n" ) abbr >&2
|
||||
return 1
|
||||
end
|
||||
|
||||
@@ -903,7 +903,7 @@ def usage(script_name):
|
||||
-h, --help\t\tShow this help message
|
||||
-v, --verbose [0, 1, 2]\tShow debugging output to stderr. Larger is more verbose.
|
||||
-s, --stdout\tWrite all completions to stdout (trumps the --directory option)
|
||||
-d, --directory [dir]\tWrite all completions to the given directory, instead of to ~/.config/fish/generated_completions
|
||||
-d, --directory [dir]\tWrite all completions to the given directory, instead of to ~/.local/share/fish/generated_completions
|
||||
-m, --manpath\tProcess all man1 and man8 files available in the manpath (as determined by manpath)
|
||||
-p, --progress\tShow progress
|
||||
""")
|
||||
|
||||
Reference in New Issue
Block a user