fish 3.0.0 (released December 28, 2018)
fish 3 is a major release, which introduces some breaking changes alongside improved functionality. Although most existing scripts will continue to work, they should be reviewed against the list contained below.
Download links: To download the source code for fish, we suggest the file named "fish-3.0.0.tar.gz". The file downloaded from "Source code (tar.gz)" may not build correctly. The SHA-256 sum of this file is ea9dd3614bb0346829ce7319437c6a93e3e1dfde3b7f6a469b543b0d2c68f2cf. A GPG signature from David Adam (0x7A67D962D88A709A) is available as "fish-3.0.0.tar.gz.asc".
Compared to the beta release of fish 3.0b1, fish version 3.0.0:
- builds correctly against musl libc (#5407)
- handles huge numeric arguments to
testcorrectly (#5414) - removes the history colouring introduced in 3.0b1, which did not always work correctly
There is one significant known issue which was not able to be corrected before the release:
- fish 3.0.0 builds on Cygwin (#5423), but does not run correctly (#5426) and will result in a hanging terminal when started. Cygwin users are encouraged to continue using 2.7.1 until a release which corrects this is available.
If you are upgrading from version 2.7.1 or before, please also review the release notes for 3.0b1, which follow.
Notable non-backward compatible changes
- Process and job expansion has largely been removed.
%will no longer perform these expansions, except for%selffor the PID of the current shell. Additionally, job management commands (disown,wait,bg,fgandkill) will expand job specifiers starting with%(#4230, #1202). set x[1] x[2] a b, to set multiple elements of an array at once, is no longer valid syntax (#4236).- A literal
{}now expands to itself, rather than nothing. This makes working withfind -execeasier (#1109, #4632). - Literally accessing a zero-index is now illegal syntax and is caught by the parser (#4862). (fish indices start at 1)
- Successive commas in brace expansions are handled in less surprising manner. For example,
{,,,}expands to four empty strings rather than an empty string, a comma and an empty string again (#3002, #4632). forloop control variables are no longer local to theforblock (#1935).- Variables set in
ifandwhileconditions are available outside the block (#4820). - Local exported (
set -lx) vars are now visible to functions (#1091). - The new
mathbuiltin (see below) does not support logical expressions;testshould be used instead (#4777). - Range expansion will now behave sensibly when given a single positive and negative index (
$foo[5..-1]or$foo[-1..5]), clamping to the last valid index without changing direction if the list has fewer elements than expected. readnow uses-sas short for--silent(à labash);--shell's abbreviation (formerly-s) is now-Sinstead (#4490).cdno longer resolves symlinks. fish now maintains a virtual path, matching other shells (#3350).sourcenow requires an explicit-as the filename to read from the terminal (#2633).- Arguments to
endare now errors, instead of being silently ignored. - The names
argparse,read,set,status,testand[are now reserved and not allowed as function names. This prevents users unintentionally breaking stuff (#3000). - The
fish_user_abbreviationsvariable is no longer used; abbreviations will be migrated to the new storage format automatically. - The
FISH_READ_BYTE_LIMITvariable is now calledfish_byte_limit(#4414). - Environment variables are no longer split into arrays based on the record separator character on startup. Instead, variables are not split, unless their name ends in PATH, in which case they are split on colons (#436).
- The
historybuiltin's--with-timeoption has been removed; this has been deprecated in favor of--show-timesince 2.7.0 (#4403). - The internal variables
__fish_datadirand__fish_sysconfdirare now known as__fish_data_dirand__fish_sysconf_dirrespectively.
Deprecations
With the release of fish 3, a number of features have been marked for removal in the future. All users are encouraged to explore alternatives. A small number of these features are currently behind feature flags, which are turned on at present but may be turned off by default in the future.
A new feature flags mechanism is added for staging deprecations and breaking changes. Feature flags may be specified at launch with fish --features ... or by setting the universal fish_features variable. (#4940)
- The use of the
IFSvariable forreadis deprecated;IFSwill be ignored in the future (#4156). Use theread --delimiteroption instead. - The
function --on-process-exitswitch will be removed in future (#4700). Use thefish_exitevent instead:function --on-event fish_exit. $_is deprecated and will removed in the future (#813). Usestatus current-commandin a command substitution instead.^as a redirection deprecated and will be removed in the future. (#4394). Use2>to redirect stderr. This is controlled by thestderr-nocaretfeature flag.?as a glob (wildcard) is deprecated and will be removed in the future (#4520). This is controlled by theqmark-noglobfeature flag.
Notable fixes and improvements
Syntax changes and new commands
- fish now supports
&&(likeand),||(likeor), and!(likenot), for better migration from POSIX-compliant shells (#4620). - Variables may be used as commands (#154).
- fish may be started in private mode via
fish --private. Private mode fish sessions do not have access to the history file and any commands evaluated in private mode are not persisted for future sessions. A session variable$fish_private_modecan be queried to detect private mode and adjust the behavior of scripts accordingly to respect the user's wish for privacy. - A new
waitcommand for waiting on backgrounded processes (#4498). mathis now a builtin rather than a wrapper aroundbc(#3157). Floating point computations is now used by default, and can be controlled with the new--scaleoption (#4478).- Setting
$PATHno longer warns on non-existent directories, allowing for a single $PATH to be shared across machines (eg via dotfiles) (#2969). whilesets$statusto a non-zero value if the loop is not executed (#4982).- Command substitution output is now limited to 10 MB by default, controlled by the
fish_read_limitvariable (#3822). Notably, this is larger than most operating systems' argument size limit, so trying to pass argument lists this size to external commands has never worked. - The machine hostname, where available, is now exposed as the
$hostnamereserved variable. This removes the dependency on thehostnameexecutable (#4422). - Bare
bindinvocations in config.fish now work. Thefish_user_key_bindingsfunction is no longer necessary, but will still be executed if it exists (#5191). $fish_pidand$last_pidare available as replacements for%selfand%last.
New features in commands
aliashas a new--saveoption to save the generated function immediately (#4878).bindhas a new--silentoption to ignore bind requests for named keys not available under the current terminal (#4188, #4431).completehas a new--keep-orderoption to show the provided or dynamically-generated argument list in the same order as specified, rather than alphabetically (#361).execprompts for confirmation if background jobs are running.funcedhas a new--saveoption to automatically save the edited function after successfully editing (#4668).functionshas a new--handlersoption to show functions registered as event handlers (#4694).history searchsupports globs for wildcard searching (#3136) and has a new--reverseoption to show entries from oldest to newest (#4375).jobshas a new--quietoption to silence the output.readhas a new--delimiteroption for splitting input into arrays (#4256).readwrites directly to stdout if called without arguments (#4407).readcan now read individual lines into separate variables without consuming the input in its entirety via the new/--lineoption.sethas new--appendand--prependoptions (#1326).sethas a new--showoption to show lots of information about variables (#4265).string matchwith an empty pattern and--entirein glob mode now matches everything instead of nothing (#4971).string splitsupports a new--no-emptyoption to exclude empty strings from the result (#4779).stringhas new subcommandssplit0andjoin0for working with NUL-delimited output.stringno longer stops processing text after NUL characters (#4605)string escapehas a new--style regexoption for escaping strings to be matched literally instringregex operations.testnow supports floating point values in numeric comparisons.
Interactive improvements
- A pipe at the end of a line now allows the job to continue on the next line (#1285).
- Italics and dim support out of the box on macOS for Terminal.app and iTerm (#4436).
cdtab completions no longer descend into the deepest unambiguous path (#4649).- Pager navigation has been improved. Most notably, moving down now wraps around, moving up from the commandline now jumps to the last element and moving right and left now reverse each other even when wrapping around (#4680).
- Typing normal characters while the completion pager is active no longer shows the search field. Instead it enters them into the command line, and ends paging (#2249).
- A new input binding
pager-toggle-searchtoggles the search field in the completions pager on and off. By default, this is bound to Ctrl-S. - Searching in the pager now does a full fuzzy search (#5213).
- The pager will now show the full command instead of just its last line if the number of completions is large (#4702).
- Abbreviations can be tab-completed (#3233).
- Tildes in file names are now properly escaped in completions (#2274).
- Wrapping completions (from
complete --wrapsorfunction --wraps) can now inject arguments. For example,complete gco --wraps 'git checkout'now works properly (#1976). Thealiasfunction has been updated to respect this behavior. - Path completions now support expansions, meaning expressions like
python ~/<TAB>now provides file suggestions just like any other relative or absolute path. (This includes support for other expansions, too.) - Autosuggestions try to avoid arguments that are already present in the command line.
- Notifications about crashed processes are now always shown, even in command substitutions (#4962).
- The screen is no longer reset after a BEL, fixing graphical glitches (#3693).
- vi-mode now supports ';' and ',' motions. This introduces new {forward,backward}-jump-till and repeat-jump{,-reverse} bind functions (#5140).
- The
*yvi-mode binding now works (#5100). - True color is now enabled in neovim by default (#2792).
- Terminal size variables (
$COLUMNS/$LINES) are now updated beforefish_promptis called, allowing the prompt to react (#904). - Multi-line prompts no longer repeat when the terminal is resized (#2320).
xclipsupport has been added to the clipboard integration (#5020).- The Alt-P keybinding paginates the last command if the command line is empty.
$cmd_durationis no longer reset when no command is executed (#5011).- Deleting a one-character word no longer erases the next word as well (#4747).
- Token history search (Alt-Up) omits duplicate entries (#4795).
- The
fish_escape_delay_mstimeout, allowing the use of the escape key both on its own and as part of a control sequence, was applied to all control characters; this has been reduced to just the escape key. - Completing a function shows the description properly (#5206).
- Added completions for
ansible, includingansible-galaxy,ansible-playbookandansible-vault(#4697)bb-power(#4800)bd(#4472)bowerclangandclang++(#4174)conda(#4837)configure(for autoconf-generated files only)curldoas(#5196)ebuild(#4911)emaint(#4758)eopkg(#4600)exercism(#4495)hjsonhugo(#4529)j(from autojump #4344)jbake(#4814)jhipster(#4472)kittykldloadkldunloadmakensis(#5242)mesonmkdocs(#4906)ngrok(#4642)- OpenBSD's
pkg_add,pkg_delete,pkg_info,pfctl,rcctl,signify, andvmctl(#4584) openocdoptipngopkg(#5168)pandoc(#2937)port(#4737)powerpill(#4800)pstack(#5135)serve(#5026)ttxunzipvirsh(#5113)xclip(#5126)xsvzfsandzpool(#4608)
- Lots of improvements to completions (especially
darcs(#5112),git,hgandsudo). - Completions for
yarnandnpmnow require theall-the-package-namesNPM package for full functionality. - Completions for
bowerandyarnnow require thejqutility for full functionality. - Improved French translations.
Other fixes and improvements
- Significant performance improvements to
abbr(#4048), setting variables (#4200, #4341), executing functions, globs (#4579),stringreading from standard input (#4610), and slicing history (in particular,$history[1]for the last executed command). - Fish's internal wcwidth function has been updated to deal with newer Unicode, and the width of some characters can be configured via the
fish_ambiguous_width(#5149) andfish_emoji_width(#2652) variables. Alternatively, a new build-time option INTERNAL_WCWIDTH can be used to use the system's wcwidth instead (#4816). functionscorrectly supports-das the short form of--description. (#5105)/etc/pathsis now parsed like macOS' bashpath_helper, fixing $PATH order (#4336, #4852) on macOS.- Using a read-only variable in a
forloop produces an error, rather than silently producing incorrect results (#4342). - The universal variables filename no longer contains the hostname or MAC address. It is now at the fixed location
.config/fish/fish_variables(#1912). - Exported variables in the global or universal scope no longer have their exported status affected by local variables (#2611).
- Major rework of terminal and job handling to eliminate bugs (#3805, #3952, #4178, #4235, #4238, #4540, #4929, #5210).
- Improvements to the manual page completion generator (#2937, #4313).
suspend --forcenow works correctly (#4672).- Pressing Ctrl-C while running a script now reliably terminates fish (#5253).
For distributors and developers
- fish ships with a new build system based on CMake. CMake 3.2 is the minimum required version. Although the autotools-based Makefile and the Xcode project are still shipped with this release, they will be removed in the near future. All distributors and developers are encouraged to migrate to the CMake build.
- Build scripts for most platforms no longer require bash, using the standard sh instead.
- The
hostnamecommand is no longer required for fish to operate.