diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 30d1b42e4..82a34c03d 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -12,13 +12,23 @@ Notable improvements and fixes dmesg -w | string match '*usb*' - Prompts whose width exceeds $COLUMNS will now be truncated instead of replaced with ``"> "`` (:issue:`904`). + For example:: + + ~/dev/build/fish-shell-git/src/fish-shell/build (makepkg)> + + will turn into:: + + …h-shell/build (makepkg)> + + It is still possible to react to $COLUMNS inside the prompt to implement smarter behavior. - When pressing Tab, fish displays ambiguous completions even when they have a common prefix, without the user having to press Tab again (:issue:`6924`). - fish is less aggressive about resetting terminal modes, such as flow control, after every command. Although flow control remains off by default, enterprising users can now enable it for external commands with ``stty`` (:issue:`2315`). -- A new ``fish_add_path`` helper function to add paths to $PATH without producing duplicates, to be used interactively or in ``config.fish`` (:issue:`6960`, :issue:`7028`). +- A new ``fish_add_path`` helper function to add paths to $PATH without producing duplicates, + to be used interactively or in ``config.fish`` (:issue:`6960`, :issue:`7028`). For example:: fish_add_path /opt/mycoolthing/bin @@ -43,13 +53,19 @@ Notable improvements and fixes Syntax changes and new commands ------------------------------- + - Range limits in index range expansions like ``$x[$start..$end]`` may be omitted: ``$start`` and ``$end`` default to 1 and -1 (the last item) respectively (:issue:`6574`). - Logical operators ``&&`` and ``||`` can be followed by newlines before their right operand, matching POSIX shells. - When globbing, a segment which is exactly ``**`` may now match zero directories. For example ``**/foo`` may match ``foo`` in the current directory (:issue:`7222`). Scripting improvements ---------------------- + +- The ``type`` and ``_`` gettext functions are now implemented as a builtin for performance purposes (:issue:`7342`, :issue:`7036`). - ``set`` and backgrounded jobs no longer overwrite ``$pipestatus`` (:issue:`6820`), improving its use in command substitutions (:issue:`6998`). +- Computed ("electric") variables such as ``status`` are now only global in scope, so ``set -Uq status`` returns false (:issue:`7032`). +- The output for ``set --show`` has been shortened, only mentioning the scopes in which a variable exists (:issue:`6944`). + In addition it now shows if a variable is a path variable. - ``fish_preexec`` and ``fish_postexec`` events are no longer triggered for empty commands (:issue:`4829`, :issue:`7085`). - A new variable, ``fish_kill_signal``, is set to the signal that terminated the last foreground job, or ``0`` if the job exited normally (:issue:`6824`, :issue:`6822`). - A new subcommand, ``string pad``, allows extending strings to a given width (:issue:`7340`, :issue:`7102`). @@ -58,17 +74,17 @@ Scripting improvements - ``string split`` has a new ``--fields`` option to specify fields to output, similar to ``cut -f`` (:issue:`6770`). - ``string trim`` now also trims vertical tabs by default (:issue:`6795`). +- ``string replace`` no longer errors if a capturing group wasn't matched, instead treating it as empty (:issue:`7343`). +- ``string`` subcommands now quit early when used with ``--quiet`` (:issue:`7495`). +- ``string repeat`` now handles multiple arguments, repeating each one (:issue:`5988`). - ``printf`` no longer prints an error if not given an argument (not even a format string) - The ``true`` and ``false`` builtins ignore any arguments, like other shells (:issue:`7030`). -- Computed ("electric") variables such as ``status`` are now only global in scope, so ``set -Uq status`` returns false (:issue:`7032`). -- The output for ``set --show`` has been shortened, only mentioning the scopes in which a variable exists (:issue:`6944`). - In addition it now shows if a variable is a path variable. - A new ``fish_posterror`` event is emitted when attempting to execute a command with syntax errors (:issue:`6880`, :issue:`6816`). -- ``fish_indent`` now removes unnecessary quotes in simple cases (:issue:`6722`) +- ``fish_indent`` now removes unnecessary quotes in simple cases (:issue:`6722`) and learned a ``--check`` option to just check if a file is indented correctly (:issue:`7251`). -- ``fish_indent`` indents continuation lines that follow a line ending in a backslash, ``|``, ``&&`` or ``||``. -- ``pushd`` only adds a directory to the stack if changing to it was successful (:issue:`6947`). +- ``fish_indent`` indents continuation lines that follow a line ending in a backslash, ``|``, ``&&`` or ``||``. +- ``pushd`` only adds a directory to the stack if changing to it was successful (:issue:`6947`). - A new ``fish_job_summary`` function is called whenever a background job stops or ends, or any job terminates from a signal (:issue:`6959`, :issue:`2727`, :issue:`4319`). The default behaviour can now be customized by redefining it. @@ -78,37 +94,36 @@ Scripting improvements - ``status`` gained new ``dirname`` and ``basename`` convenience subcommands to get just the directory to the running script or the name of it, to simplify common tasks such as running ``(dirname (status filename))`` (:issue:`7076`, :issue:`1818`). -- The ``type`` and ``_`` gettext functions are now implemented as a builtin for performance purposes (:issue:`7342`, :issue:`7036`). - Broken pipelines are now handled more smoothly; in particular, bad redirection mid-pipeline results in the job continuing to run but with the broken file descriptor replaced with a closed file descriptor. This allows better error recovery and is more in line with other shells' behaviour (:issue:`7038`). - ``jobs --quiet PID`` no longer prints "no suitable job" if the job for PID does not exist (eg because it has finished) (:issue:`6809`, :issue:`6812`). - ``jobs`` now shows continued child processes correctly (:issue:`6818`) +- ``disown`` should no longer create zombie processes when job control is off, such as in ``config.fish`` (:issue:`7183`). - ``command``, ``jobs`` and ``type`` builtins support ``--query`` as the long form of ``-q``, matching other builtins. The long form ``--quiet`` is deprecated (:issue:`7276`). - ``argparse`` no longer requires a short flag letter for long-only options (:issue:`7585`) and only prints a backtrace with invalid options to argparse itself (:issue:`6703`). - ``argparse`` now passes the validation variables (e.g. ``$_flag_value``) as local-exported variables, avoiding the need for ``--no-scope-shadowing`` in validation functions. -- ``complete`` takes the first argument as the name of the command if the ``--command``/``-c`` option is not used (``complete git`` is treated like ``complete --command git``), and can show the loaded completions for specific commands with ``complete COMMANDNAME`` (:issue:`7321`). +- ``complete`` takes the first argument as the name of the command if the ``--command``/``-c`` option is not used, + so ``complete git`` is treated like ``complete --command git``, + and it can show the loaded completions for specific commands with ``complete COMMANDNAME`` (:issue:`7321`). - ``set_color -b`` (without an argument) no longer prints an error message, matching other invalid invocations of this command (:issue:`7154`). - Functions triggered by the ``fish_exit`` event are correctly run when the terminal is closed or the shell receives SIGHUP (:issue:`7014`). -- ``string replace`` no longer errors if a capturing group wasn't matched, instead treating it as empty (:issue:`7343`). - ``exec`` no longer produces a syntax error when the command cannot be found (:issue:`6098`). -- ``disown`` should no longer create zombie processes when job control is off, such as in ``config.fish`` (:issue:`7183`). -- Using ``read --silent`` while fish is in private mode was adding these potentially-sensitive entries to the history; this has been fixed (:issue:`7230`). - ``set --erase`` and ``abbr --erase`` can now erase multiple things in one go, matching ``functions --erase`` (:issue:`7377`). - ``abbr --erase`` no longer errors on an unset abbreviation (:issue:`7376`). -- ``test -t``, for testing whether file descriptors are connected to a terminal, works for file descriptors 0, 1, and 2 (:issue:`4766`). It can still return incorrect results in other cases (:issue:`1228`). +- ``test -t``, for testing whether file descriptors are connected to a terminal, works for file descriptors 0, 1, and 2 (:issue:`4766`). + It can still return incorrect results in other cases (:issue:`1228`). - Trying to execute scripts with Windows line endings (CRLF) produces a sensible error (:issue:`2783`). - Trying to execute commands with arguments that exceed the operating system limit now produces a specific error (:issue:`6800`). - An ``alias`` that delegates to a command with the same name no longer triggers an error about recursive completion (:issue:`7389`). -- ``math`` now has a ``--base`` option to output the result in hexadecimal or octal (:issue:`7496`) and produces more specific error messages (:issue:`7508`). -- ``math`` learned bitwise functions ``bitand``, ``bitor`` and ``bitxor``, used like ``math "bitand(0xFE, 5)"`` (:issue:`7281`). -- ``math`` learned tau for those wishing to cut down on typing "2 * pi". -- ``string`` subcommands now quit early when used with ``--quiet`` (:issue:`7495`). -- ``string repeat`` now handles multiple arguments, repeating each one (:issue:`5988`). +- ``math`` now has a ``--base`` option to output the result in hexadecimal or octal (:issue:`7496`) and produces more specific error messages (:issue:`7508`). +- ``math`` learned bitwise functions ``bitand``, ``bitor`` and ``bitxor``, used like ``math "bitand(0xFE, 5)"`` (:issue:`7281`). +- ``math`` learned tau for those wishing to cut down on typing "2 * pi". - Failed redirections will now set ``$status`` (:issue:`7540`). - More consistent $status after errors, including invalid expansions like ``$foo[``. +- Using ``read --silent`` while fish is in private mode was adding these potentially-sensitive entries to the history; this has been fixed (:issue:`7230`). - ``read`` can now read interactively from other files, so e.g. forcing it to read from the terminal via ``read ``). -- The ``set`` completions no longer hide variables starting with ``__``, they are sorted last instead. +- Lots of improvements to completions. +- Improvements to the manpage completion generator (:issue:`7086`, :issue:`6879`, :issue:`7187`). +- Significant performance improvements to completion of the available commands (:issue:`7153`), especially on macOS Big Sur where there was a significant regression (:issue:`7365`, :issue:`7511`). +- ``__fish_complete_suffix`` now uses the same fuzzy matching logic as normal file completion. +- ``__fish_complete_suffix`` completes any file but sorts files with matching suffix first (:issue:`7040`, :issue:`7547`). Previously, it only completed files with matching suffix. +- Completions for ``git`` learned to complete the right and left parts of a commit range like ``from..to`` or ``left...right``. +- The ``__fish_print_packages`` function was broken apart into one function per package manager, and any completion now only calls its specific function. This helps if multiple package managers are installed on a system (e.g. to create containers). ``__fish_print_packages`` remains as a stub that calls all functions (:issue:`7542`). +- Many completions have their descriptions shortened to fit more options on the screen (:issue:`6981`, :issue:`7550`, :issue:`7109`, :issue:`7569`, :issue:`7081`, :issue:`7291`, :issue:`7163`, :issue:`7378`). +- The ``make`` completions no longer second-guess make's file detection, fixing target completion in some cases (:issue:`7535`). +- The command completions now correctly print the description even if the command was fully matched (like in ``ls``). +- The ``set`` completions no longer hide variables starting with ``__``, they are sorted last instead. Changes not visible to users ---------------------------- -- fish has a new interactive test driver based on pexpect. This means that interactive tests are now written in python rather than the less known tcl, which reduces the number of programming languages required to work on fish (:issue:`5451`, :issue:`6825`). -- The ``littlecheck`` script test driver gained improved output based on diffing rather than stopping on the first error. This makes understanding test failures much easier. -- fish's test suite now checks all of its .fish scripts with ``fish --no-execute`` (:issue:`6619`). -- The tests no longer fail if a user with a name starting with "haha" exists on the system (:issue:`6811`). -- The CHANGELOG was moved to restructured text, allowing it to be included in the documentation (:issue:`7057`). -- fish moved CI from Travis (which is no longer available for opensource projects) to Github Actions (:issue:`6846`, :issue:`7447`) -- fish handles ncurses installed in a non-standard prefix better (:issue:`6600`, :issue:`7219`), and uses variadic tparm on NetBSD curses (:issue: `6626`). -- The web configuration tool no longer uses an obsolete Angular version (:issue:`7147`). -- The fish project has adopted the Contributor Covenant code of conduct (:issue:`7151`). +- fish has a new interactive test driver based on pexpect. This means that interactive tests are now written in python rather than the less known tcl, which reduces the number of programming languages required to work on fish (:issue:`5451`, :issue:`6825`). +- The ``littlecheck`` script test driver gained improved output based on diffing rather than stopping on the first error. This makes understanding test failures much easier. +- fish's test suite now checks all of its .fish scripts with ``fish --no-execute`` (:issue:`6619`). +- The tests no longer fail if a user with a name starting with "haha" exists on the system (:issue:`6811`). +- The CHANGELOG was moved to restructured text, allowing it to be included in the documentation (:issue:`7057`). +- fish moved CI from Travis (which is no longer available for opensource projects) to Github Actions (:issue:`6846`, :issue:`7447`) +- fish handles ncurses installed in a non-standard prefix better (:issue:`6600`, :issue:`7219`), and uses variadic tparm on NetBSD curses (:issue:`6626`). +- The web configuration tool no longer uses an obsolete Angular version (:issue:`7147`). +- The fish project has adopted the Contributor Covenant code of conduct (:issue:`7151`). Deprecations and removed features --------------------------------- -- fish no longer attempts to modify the terminal size via ``TIOCSWINSZ`` (:issue:`6994`). -- The ``fish_color_match`` variable is no longer used. (Previously this controlled the color of matching quotes and parens when using ``read``). -- fish 3.2.0 will be the last release in which the redirection to standard error with the ``^`` character is enabled. The ``stderr-nocaret`` feature flag will be changed to "on" in future releases. -- ``string`` is now a reserved word and cannot be used for function names (see above). -- ``fish_vi_cursor``'s option ``--force-iterm`` has been deprecated (see above). -- ``command``, ``jobs`` and ``type`` long-form option ``--quiet`` is deprecated in favor of ``--query`` (see above). + +- The ``fish_color_match`` variable is no longer used. (Previously this controlled the color of matching quotes and parens when using ``read``). +- fish 3.2.0 will be the last release in which the redirection to standard error with the ``^`` character is enabled. The ``stderr-nocaret`` feature flag will be changed to "on" in future releases. +- ``string`` is now a reserved word and cannot be used for function names (see above). +- ``fish_vi_cursor``'s option ``--force-iterm`` has been deprecated (see above). +- ``command``, ``jobs`` and ``type`` long-form option ``--quiet`` is deprecated in favor of ``--query`` (see above). +- The ``fish_command_not_found`` event is no longer emitted, instead there is a function of that name. By default it will call a previously-defined ``__fish_command_not_found_handler``. To emit the event manually use ``emit fish_command_not_found``. For distributors and developers -------------------------------