From 105a256e5a1d6f21ae273e3efea7cb61e7401ccb Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Thu, 30 Jan 2020 17:34:48 +0100 Subject: [PATCH 01/18] Tests: Don't remove a parent of $PWD Solaris/OpenIndiana/Illumos `rm` checks that and errors out. In these cases we don't actually need it to be a part of $PWD as it's just for cleanup, so we `cd` out before. See #5472 See 1ee57e92447781b5ff79aaa7c55f6468fc84a37d Fixes #6555 Fixes #6558 (cherry picked from commit 9cbd3d57a01ba8f4813febff83210f595518cea1) --- tests/checks/cd.fish | 2 +- tests/checks/wildcard.fish | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/checks/cd.fish b/tests/checks/cd.fish index 3232e11f1..d9eb97cb7 100644 --- a/tests/checks/cd.fish +++ b/tests/checks/cd.fish @@ -19,8 +19,8 @@ begin cd x pwd end -rm -rf $tmp cd $oldpwd +rm -rf $tmp # Create a test directory to store our stuff. set -l base /tmp/cdcomp_test diff --git a/tests/checks/wildcard.fish b/tests/checks/wildcard.fish index 2758d6b2e..0384c63de 100644 --- a/tests/checks/wildcard.fish +++ b/tests/checks/wildcard.fish @@ -2,6 +2,7 @@ # Ensure that, if variable expansion results in multiple strings # and one of them fails a glob, that we don't fail the entire expansion. +set -l oldpwd (pwd) set dir (mktemp -d) cd $dir mkdir a @@ -12,4 +13,5 @@ set dirs ./a ./b echo $dirs/*.txt # CHECK: ./b/file.txt +cd $oldpwd rm -Rf $dir From ef618b2626daf95423bf6dc9a72b880e5406b82a Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Thu, 30 Jan 2020 17:36:51 +0100 Subject: [PATCH 02/18] Add Solaris' error message to a test Just another version of the error. We still want to get a bug if it ever triggers a *wrong* error, so we still list all the options instead of going for `.*option:.*Z.*`. Fixes #6554 (cherry picked from commit e8000cfea9d2abde4acf07e759e18706a1f8010a) --- tests/checks/bad-option.fish | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/checks/bad-option.fish b/tests/checks/bad-option.fish index 8d7509c4b..6a1140944 100644 --- a/tests/checks/bad-option.fish +++ b/tests/checks/bad-option.fish @@ -1,2 +1,2 @@ #RUN: %fish -Z -#CHECKERR: {{.*fish}}: {{unrecognized option: Z|invalid option -- '?Z'?|unknown option -- Z}} +#CHECKERR: {{.*fish}}: {{unrecognized option: Z|invalid option -- '?Z'?|unknown option -- Z}|illegal option -- Z}} From 4cee04596715eb29cccaf607ec88a1cf632c7869 Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Thu, 30 Jan 2020 20:50:08 -0800 Subject: [PATCH 03/18] Update to latest widecharwidth Fixes a Cygwin incompatibility. Fixes #6549 Cherry-pick from 73106198c8f36adb26c7dab906119d51023329eb --- src/widecharwidth/widechar_width.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/widecharwidth/widechar_width.h b/src/widecharwidth/widechar_width.h index 3e63ffbd0..402bc4407 100644 --- a/src/widecharwidth/widechar_width.h +++ b/src/widecharwidth/widechar_width.h @@ -1,5 +1,5 @@ /** - * widechar_width.h, generated on 2019-05-14. + * widechar_width.h, generated on 2020-01-30. * See https://github.com/ridiculousfish/widecharwidth/ * * SHA1 file hashes: @@ -30,8 +30,8 @@ enum { /* An inclusive range of characters. */ struct widechar_range { - wchar_t lo; - wchar_t hi; + uint32_t lo; + uint32_t hi; }; /* Simple ASCII characters - used a lot, so we check them first. */ @@ -506,14 +506,14 @@ static const struct widechar_range widechar_widened_table[] = { }; template -bool widechar_in_table(const Collection &arr, wchar_t c) { +bool widechar_in_table(const Collection &arr, uint32_t c) { auto where = std::lower_bound(std::begin(arr), std::end(arr), c, - [](widechar_range p, wchar_t c) { return p.hi < c; }); + [](widechar_range p, uint32_t c) { return p.hi < c; }); return where != std::end(arr) && where->lo <= c; } /* Return the width of character c, or a special negative value. */ -int widechar_wcwidth(wchar_t c) { +int widechar_wcwidth(uint32_t c) { if (widechar_in_table(widechar_ascii_table, c)) return 1; if (widechar_in_table(widechar_private_table, c)) From 578cde6ec6ddbdb0a04e4d521e695416cb496539 Mon Sep 17 00:00:00 2001 From: David Adam Date: Fri, 31 Jan 2020 22:25:35 +0800 Subject: [PATCH 04/18] CHANGELOG: work towards 3.1.0 --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b77aa5c0a..2ded386fe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# fish 3.1.0 + +Compared to the beta release of fish 3.1b1, fish version 3.1.0 fixes a number of problems in compiling on Cygwin and Solaris-derived systems such as Illumos. + +If you are upgrading from version 2.5.0 or before, please also review the release notes for 3.1b1 (included below). + # fish 3.1b1 (released January 26, 2020) ## Notable improvements and fixes From 5932440e49d7ccb9a0d8b8dc07bb2c0c16b2d936 Mon Sep 17 00:00:00 2001 From: Jason Nader Date: Fri, 31 Jan 2020 12:38:56 +0900 Subject: [PATCH 05/18] Fix broken links to index.html in cmd docs (cherry picked from commit bc3b64bb508e5a14850296ad49c4e0be6b80cdc6) --- sphinx_doc_src/cmds/and.rst | 2 +- sphinx_doc_src/cmds/bg.rst | 2 +- sphinx_doc_src/cmds/bind.rst | 4 ++-- sphinx_doc_src/cmds/breakpoint.rst | 2 +- sphinx_doc_src/cmds/disown.rst | 2 +- sphinx_doc_src/cmds/fg.rst | 2 +- sphinx_doc_src/cmds/fish_breakpoint_prompt.rst | 2 +- sphinx_doc_src/cmds/fish_prompt.rst | 2 +- sphinx_doc_src/cmds/function.rst | 2 +- sphinx_doc_src/cmds/jobs.rst | 2 +- sphinx_doc_src/faq.rst | 2 +- 11 files changed, 12 insertions(+), 12 deletions(-) diff --git a/sphinx_doc_src/cmds/and.rst b/sphinx_doc_src/cmds/and.rst index 7fef3296f..e5644f4c9 100644 --- a/sphinx_doc_src/cmds/and.rst +++ b/sphinx_doc_src/cmds/and.rst @@ -18,7 +18,7 @@ Description ``and`` statements may be used as part of the condition in an :ref:`while ` or :ref:`if ` block. -``and`` does not change the current exit status itself, but the command it runs most likely will. The exit status of the last foreground command to exit can always be accessed using the `$status `__ variable. +``and`` does not change the current exit status itself, but the command it runs most likely will. The exit status of the last foreground command to exit can always be accessed using the :ref:`$status ` variable. Example ------- diff --git a/sphinx_doc_src/cmds/bg.rst b/sphinx_doc_src/cmds/bg.rst index d40efc573..b14049f50 100644 --- a/sphinx_doc_src/cmds/bg.rst +++ b/sphinx_doc_src/cmds/bg.rst @@ -13,7 +13,7 @@ Synopsis Description ----------- -``bg`` sends `jobs `__ to the background, resuming them if they are stopped. +``bg`` sends :ref:`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. diff --git a/sphinx_doc_src/cmds/bind.rst b/sphinx_doc_src/cmds/bind.rst index 662e89b4c..dd0e590cb 100644 --- a/sphinx_doc_src/cmds/bind.rst +++ b/sphinx_doc_src/cmds/bind.rst @@ -20,7 +20,7 @@ Description ``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, :kbd:`Alt+w` can be written as ``\ew``. The control character can be written in much the same way using the ``\c`` escape, for example :kbd:`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 :ref:`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, :kbd:`Alt+w` can be written as ``\ew``. The control character can be written in much the same way using the ``\c`` escape, for example :kbd:`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. @@ -36,7 +36,7 @@ When multiple ``COMMAND``\s are provided, they are all run in the specified orde If no ``SEQUENCE`` is provided, all bindings (or just the bindings in the specified ``MODE``) are printed. If ``SEQUENCE`` is provided without ``COMMAND``, just the binding matching that sequence is printed. -To save custom keybindings, put the ``bind`` statements into `config.fish `__. Alternatively, fish also automatically executes a function called ``fish_user_key_bindings`` if it exists. +To save custom keybindings, put the ``bind`` statements into :ref:`config.fish `. Alternatively, fish also automatically executes a function called ``fish_user_key_bindings`` if it exists. Key bindings may use "modes", which mimics Vi's modal input behavior. The default mode is "default", and every bind applies to a single mode. The mode can be viewed/changed with the ``$fish_bind_mode`` variable. diff --git a/sphinx_doc_src/cmds/breakpoint.rst b/sphinx_doc_src/cmds/breakpoint.rst index aa465be6a..6fe19088b 100644 --- a/sphinx_doc_src/cmds/breakpoint.rst +++ b/sphinx_doc_src/cmds/breakpoint.rst @@ -16,6 +16,6 @@ Description ``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 :ref:`Debugging fish scripts ` in the ``fish`` manual. There are no parameters for ``breakpoint``. diff --git a/sphinx_doc_src/cmds/disown.rst b/sphinx_doc_src/cmds/disown.rst index 2cc3607aa..94078a3ee 100644 --- a/sphinx_doc_src/cmds/disown.rst +++ b/sphinx_doc_src/cmds/disown.rst @@ -13,7 +13,7 @@ Synopsis Description ----------- -``disown`` removes the specified `job `__ from the list of jobs. The job itself continues to exist, but fish does not keep track of it any longer. +``disown`` removes the specified :ref:`job ` from the list of jobs. The job itself continues to exist, but fish does not keep track of it any longer. Jobs in the list of jobs are sent a hang-up signal when fish terminates, which usually causes the job to terminate; ``disown`` allows these processes to continue regardless. diff --git a/sphinx_doc_src/cmds/fg.rst b/sphinx_doc_src/cmds/fg.rst index 3cbb4acf2..3d0d2e0f7 100644 --- a/sphinx_doc_src/cmds/fg.rst +++ b/sphinx_doc_src/cmds/fg.rst @@ -13,7 +13,7 @@ Synopsis Description ----------- -``fg`` brings the specified `job `__ to the foreground, resuming it if it is stopped. While a foreground job is executed, fish is suspended. If no job is specified, the last job to be used is put in the foreground. If PID is specified, the job with the specified group ID is put in the foreground. +``fg`` brings the specified :ref:`job ` to the foreground, resuming it if it is stopped. While a foreground job is executed, fish is suspended. If no job is specified, the last job to be used is put in the foreground. If PID is specified, the job with the specified group ID is put in the foreground. Example diff --git a/sphinx_doc_src/cmds/fish_breakpoint_prompt.rst b/sphinx_doc_src/cmds/fish_breakpoint_prompt.rst index 200bee6e7..6203a3ea0 100644 --- a/sphinx_doc_src/cmds/fish_breakpoint_prompt.rst +++ b/sphinx_doc_src/cmds/fish_breakpoint_prompt.rst @@ -18,7 +18,7 @@ Description By defining the ``fish_breakpoint_prompt`` function, the user can choose a custom prompt when asking for input in response to a :ref:`breakpoint ` command. The ``fish_breakpoint_prompt`` function is executed when the prompt is to be shown, and the output is used as a prompt. -The exit status of commands within ``fish_breakpoint_prompt`` will not modify the value of `$status `__ outside of the ``fish_breakpoint_prompt`` function. +The exit status of commands within ``fish_breakpoint_prompt`` will not modify the value of :ref:`$status ` outside of the ``fish_breakpoint_prompt`` function. ``fish`` ships with a default version of this function that displays the function name and line number of the current execution context. diff --git a/sphinx_doc_src/cmds/fish_prompt.rst b/sphinx_doc_src/cmds/fish_prompt.rst index f11c6036d..773d5d0d3 100644 --- a/sphinx_doc_src/cmds/fish_prompt.rst +++ b/sphinx_doc_src/cmds/fish_prompt.rst @@ -18,7 +18,7 @@ Description By defining the ``fish_prompt`` function, the user can choose a custom prompt. The ``fish_prompt`` function is executed when the prompt is to be shown, and the output is used as a prompt. -The exit status of commands within ``fish_prompt`` will not modify the value of `$status `__ outside of the ``fish_prompt`` function. +The exit status of commands within ``fish_prompt`` will not modify the value of :ref:`$status ` outside of the ``fish_prompt`` function. ``fish`` ships with a number of example prompts that can be chosen with the ``fish_config`` command. diff --git a/sphinx_doc_src/cmds/function.rst b/sphinx_doc_src/cmds/function.rst index 52724cf8a..16d3a84eb 100644 --- a/sphinx_doc_src/cmds/function.rst +++ b/sphinx_doc_src/cmds/function.rst @@ -44,7 +44,7 @@ The following options are available: - ``-V`` or ``--inherit-variable NAME`` snapshots the value of the variable ``NAME`` and defines a local variable with that same name and value when the function is defined. This is similar to a closure in other languages like Python but a bit different. Note the word "snapshot" in the first sentence. If you change the value of the variable after defining the function, even if you do so in the same scope (typically another function) the new value will not be used by the function you just created using this option. See the ``function notify`` example below for how this might be used. -If the user enters any additional arguments after the function, they are inserted into the environment `variable list `__ ``$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 :ref:`variable list ` ``$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 :ref:`emit ` builtin. Fish generates the following named events: diff --git a/sphinx_doc_src/cmds/jobs.rst b/sphinx_doc_src/cmds/jobs.rst index 949f10704..278e2acc5 100644 --- a/sphinx_doc_src/cmds/jobs.rst +++ b/sphinx_doc_src/cmds/jobs.rst @@ -14,7 +14,7 @@ Synopsis Description ----------- -``jobs`` prints a list of the currently running `jobs `__ and their status. +``jobs`` prints a list of the currently running :ref:`jobs ` and their status. jobs accepts the following switches: diff --git a/sphinx_doc_src/faq.rst b/sphinx_doc_src/faq.rst index 454dd2514..b8b0dc35d 100644 --- a/sphinx_doc_src/faq.rst +++ b/sphinx_doc_src/faq.rst @@ -233,7 +233,7 @@ Fish history recall is very simple yet effective: - If you want to reuse several arguments from the same line ("!!:3*" and the like), consider recalling the whole line and removing what you don't need (:kbd:`Alt+D` and :kbd:`Alt+Backspace` are your friends). -See `documentation `__ for more details about line editing in fish. +See :ref:`documentation ` for more details about line editing in fish. How can I use ``-`` as a shortcut for ``cd -``? From 9b4cb28c8fc270b5e09ea5d9117d2e44809d8021 Mon Sep 17 00:00:00 2001 From: Jason Nader Date: Fri, 31 Jan 2020 12:53:14 +0900 Subject: [PATCH 06/18] Remove explicit .html links See commit 1711636 (cherry picked from commit ce61c745a5c90d2d5632e0340344e948f78ffee3) --- sphinx_doc_src/index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sphinx_doc_src/index.rst b/sphinx_doc_src/index.rst index 7e1fa3ebb..d174cdd01 100644 --- a/sphinx_doc_src/index.rst +++ b/sphinx_doc_src/index.rst @@ -77,7 +77,7 @@ You can make fish your default shell by adding fish's executable in two places: - add ``/usr/local/bin/fish`` to ``/etc/shells`` - change your default shell with ``chsh -s`` to ``/usr/local/bin/fish`` -For for detailed instructions see `Switching to fish `_. +For for detailed instructions see :ref:`Switching to fish `. Uninstalling ------------ From eaecb817ca9cffd5bdf91710d0363efb9d5d4791 Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Sun, 2 Feb 2020 17:51:04 -0800 Subject: [PATCH 07/18] Retain leading spaces in non-expanding braces This makes two changes: 1. Remove the 'brace_text_start' idea. The idea of 'brace_text_start' was to prevent emitting `BRACE_SPACE` at the beginning or end of an item. But we later strip these off anyways, so there is no apparent benefit. If we are not doing brace expansion, this prevented emitting whitespace at the beginning or end of an item, leading to #6564. 2. When performing brace expansion, only stomp the space character with `BRACE_SPACE`; do not stomp newlines and tabs. This is because the fix in came from a newline or tab literal, then we would have effectively replaced a newline or tab with a space, so this is important for #6564 as well. Moreover, it is not easy to place a literal newline or tab inside a brace expansion, and users who do probably do not mean for it to be stripped, so I believe this is a good change in general. Fixes #6564 --- src/common.cpp | 11 +------- tests/checks/braces.fish | 50 +++++++++++++++++++++++++++++++++++ tests/parameter_expansion.in | 6 ----- tests/parameter_expansion.out | 2 -- tests/test1.err | 3 --- tests/test1.in | 15 ----------- tests/test1.out | 14 ---------- 7 files changed, 51 insertions(+), 50 deletions(-) create mode 100644 tests/checks/braces.fish diff --git a/src/common.cpp b/src/common.cpp index 3fd2da590..f76445fc0 100644 --- a/src/common.cpp +++ b/src/common.cpp @@ -1435,7 +1435,6 @@ static bool unescape_string_internal(const wchar_t *const input, const size_t in // The positions of variable expansions or brace ","s. // We only read braces as expanders if there's a variable expansion or "," in them. std::vector vars_or_seps; - bool brace_text_start = false; int brace_count = 0; bool errored = false; @@ -1531,7 +1530,6 @@ static bool unescape_string_internal(const wchar_t *const input, const size_t in // assert(brace_count > 0 && "imbalanced brackets are a tokenizer error, we // shouldn't be able to get here"); brace_count--; - brace_text_start = brace_text_start && brace_count > 0; to_append_or_none = BRACE_END; if (!braces.empty()) { // If we didn't have a var or separator since the last '{', @@ -1559,17 +1557,13 @@ static bool unescape_string_internal(const wchar_t *const input, const size_t in case L',': { if (unescape_special && brace_count > 0) { to_append_or_none = BRACE_SEP; - brace_text_start = false; vars_or_seps.push_back(input_position); } break; } - case L'\n': - case L'\t': case L' ': { if (unescape_special && brace_count > 0) { - to_append_or_none = - brace_text_start ? maybe_t(BRACE_SPACE) : none(); + to_append_or_none = BRACE_SPACE; } break; } @@ -1586,9 +1580,6 @@ static bool unescape_string_internal(const wchar_t *const input, const size_t in break; } default: { - if (unescape_special && brace_count > 0) { - brace_text_start = true; - } break; } } diff --git a/tests/checks/braces.fish b/tests/checks/braces.fish new file mode 100644 index 000000000..c42fd8e76 --- /dev/null +++ b/tests/checks/braces.fish @@ -0,0 +1,50 @@ +#RUN: %fish %s + +echo x-{1} +#CHECK: x-{1} + +echo x-{1,2} +#CHECK: x-1 x-2 + +echo foo-{1,2{3,4}} +#CHECK: foo-1 foo-23 foo-24 + +echo foo-{} # literal "{}" expands to itself +#CHECK: foo-{} + +echo foo-{{},{}} # the inner "{}" expand to themselves, the outer pair expands normally. +#CHECK: foo-{} foo-{} + +echo foo-{{a},{}} # also works with something in the braces. +#CHECK: foo-{a} foo-{} + +echo foo-{""} # still expands to foo-{} +#CHECK: foo-{} + +echo foo-{$undefinedvar} # still expands to nothing +#CHECK: + +echo foo-{,,,} # four empty items in the braces. +#CHECK: foo- foo- foo- foo- + +echo foo-{,\,,} # an empty item, a "," and an empty item. +#CHECK: foo- foo-, foo- + +echo .{ foo bar }. # see 6564 +#CHECK: .{ foo bar }. + +# whitespace within entries is retained +for foo in {a, hello +wo rld } + echo \'$foo\' +end +# CHECK: 'a' +# CHECK: 'hello +# CHECK: wo rld' + +for foo in {hello +world} + echo \'$foo\' +end +#CHECK: '{hello +#CHECK: world}' diff --git a/tests/parameter_expansion.in b/tests/parameter_expansion.in index 7804adf5d..31c89a690 100644 --- a/tests/parameter_expansion.in +++ b/tests/parameter_expansion.in @@ -14,12 +14,6 @@ echo \'{ hello , world }\' for phrase in {good\,, beautiful ,morning}; echo -n "$phrase "; end | string trim; for phrase in {goodbye\,,\ cruel\ ,world\n}; echo -n $phrase; end; -# whitespace within entries converted to spaces in a single entry -for foo in {a, hello -world } - echo \'$foo\' -end - # dual expansion cartesian product echo { alpha, beta }\ {lambda, gamma }, | string replace -r ',$' '' diff --git a/tests/parameter_expansion.out b/tests/parameter_expansion.out index d541621e0..4717848c7 100644 --- a/tests/parameter_expansion.out +++ b/tests/parameter_expansion.out @@ -6,8 +6,6 @@ apple orange banana 'hello' 'world' good, beautiful morning goodbye, cruel world -'a' -'hello world' alpha lambda, beta lambda, alpha gamma, beta gamma Meg Jo diff --git a/tests/test1.err b/tests/test1.err index c425878af..ee269e5a2 100644 --- a/tests/test1.err +++ b/tests/test1.err @@ -2,9 +2,6 @@ #################### # Comments in odd places don't cause problems -#################### -# Brace expansion - #################### # Escaped newlines diff --git a/tests/test1.in b/tests/test1.in index 6657a19eb..2d1b81009 100644 --- a/tests/test1.in +++ b/tests/test1.in @@ -11,21 +11,6 @@ for i in 1 2 # Comment on same line as command end; end -logmsg Brace expansion -echo x-{1} -echo x-{1,2} -echo foo-{1,2{3,4}} - -echo foo-{} # literal "{}" expands to itself -echo foo-{{},{}} # the inner "{}" expand to themselves, the outer pair expands normally. -echo foo-{{a},{}} # also works with something in the braces. -echo foo-{""} # still expands to foo-{} -echo banana # just as a marker -echo foo-{$undefinedvar} # still expands to nothing - -echo foo-{,,,} # four empty items in the braces. -echo foo-{,\,,} # an empty item, a "," and an empty item. - logmsg Escaped newlines echo foo\ bar echo foo\ diff --git a/tests/test1.out b/tests/test1.out index 5868a7a02..7e01503c8 100644 --- a/tests/test1.out +++ b/tests/test1.out @@ -6,20 +6,6 @@ 2a 2b -#################### -# Brace expansion -x-{1} -x-1 x-2 -foo-1 foo-23 foo-24 -foo-{} -foo-{} foo-{} -foo-{a} foo-{} -foo-{} -banana - -foo- foo- foo- foo- -foo- foo-, foo- - #################### # Escaped newlines foo bar From ee3f0b19b47825d261d3dd0ccffe6140a055a44f Mon Sep 17 00:00:00 2001 From: David Adam Date: Thu, 6 Feb 2020 12:48:08 +0800 Subject: [PATCH 08/18] config.fish: skip path modifications if tests running Closes #6556. --- share/config.fish | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/config.fish b/share/config.fish index 400556832..6157c7c1c 100644 --- a/share/config.fish +++ b/share/config.fish @@ -123,7 +123,7 @@ end # system utilities. # -if test -d /usr/xpg4/bin +if begin; not set -q FISH_UNIT_TESTS_RUNNING; and test -d /usr/xpg4/bin; end not contains -- /usr/xpg4/bin $PATH and set PATH /usr/xpg4/bin $PATH end From 6866f8e6b5759114a94bfc2da12b598238d41bfe Mon Sep 17 00:00:00 2001 From: Geoff Nixon Date: Fri, 31 Jan 2020 13:55:08 -0800 Subject: [PATCH 09/18] Avoid apropos on macOS 10.15 with man completion Same issue occurs here, as in #6270 (and fixed in 611a658 for `__fish_describe_command.fish`). Same reason. I've just copied the same workaround and changed the function name to match. (cherry picked from commit f7edfba5d7c52bb9d2e1d11c9568fb2e0ca14982) --- share/functions/__fish_complete_man.fish | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/share/functions/__fish_complete_man.fish b/share/functions/__fish_complete_man.fish index 5fbe87345..edb5511bd 100644 --- a/share/functions/__fish_complete_man.fish +++ b/share/functions/__fish_complete_man.fish @@ -1,3 +1,20 @@ +# macOS 10.15 "Catalina" has some major issues. +# The whatis database is non-existent, so apropos tries (and fails) to create it every time, +# which takes about half a second. +# +# So we disable this entirely in that case. +if test (uname) = Darwin + set -l darwin_version (uname -r | string split .) + # macOS 15 is Darwin 19, this is an issue at least up to 10.15.3. + # If this is fixed in later versions uncomment the second check. + if test "$darwin_version[1]" = 19 # -a "$darwin_version[2]" -le 3 + function __fish_complete_man + end + # (remember: exit when `source`ing only exits the file, not the shell) + exit + end +end + function __fish_complete_man # Try to guess what section to search in. If we don't know, we # use [^)]*, which should match any section. From 3a5eb6151d84f3f7dfa3dc4d8a9ea53d2e01ada3 Mon Sep 17 00:00:00 2001 From: Collin Styles Date: Mon, 10 Feb 2020 12:01:08 -0800 Subject: [PATCH 10/18] Correct `list-language` to `list-languages` in bat completions --- share/completions/bat.fish | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/completions/bat.fish b/share/completions/bat.fish index 036543fac..e3bf1e58b 100644 --- a/share/completions/bat.fish +++ b/share/completions/bat.fish @@ -56,7 +56,7 @@ set -l tabs_opts ' ' complete -c bat -n 'not __fish_seen_subcommand_from cache' -x -s l -l language -a '(__bat_complete_languages_and_extensions)' -d 'Set language for syntax highlighting' -complete -c bat -n 'not __fish_seen_subcommand_from cache' -f -s L -l list-language -d 'List supported languages for syntax highlighting' +complete -c bat -n 'not __fish_seen_subcommand_from cache' -f -s L -l list-languages -d 'List supported languages for syntax highlighting' complete -c bat -n 'not __fish_seen_subcommand_from cache' -x -s m -l map-syntax -d 'Map file name/extension to existing syntax' complete -c bat -n 'not __fish_seen_subcommand_from cache' -x -l theme -a '(__bat_complete_themes)' -d 'Set theme for syntax highlighting' complete -c bat -n 'not __fish_seen_subcommand_from cache' -f -l list-themes -d 'List syntax-highlighting themes' From 30d98d385ceb041e9aae1894a6c3ca77d7d33ff6 Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Mon, 10 Feb 2020 21:46:08 +0100 Subject: [PATCH 11/18] CHANGELOG [ci skip] --- CHANGELOG.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ded386fe..f6eb2aca9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ # fish 3.1.0 -Compared to the beta release of fish 3.1b1, fish version 3.1.0 fixes a number of problems in compiling on Cygwin and Solaris-derived systems such as Illumos. +Compared to the beta release of fish 3.1b1, fish version 3.1.0: + +- Fixes a number of problems in compiling and running the test suite on Cygwin and Solaris-derived systems such as Illumos +- Also disables any `apropos` invocations on macos via the man completion, not just command completion. +- Fixes a regression where spaces after a brace were removed when brace expansion wasn't triggered (#6564) +- Fixes some broken links in the documentation. +- Fixes a typo in the `bat` completions (#6580) If you are upgrading from version 2.5.0 or before, please also review the release notes for 3.1b1 (included below). From bd7608a6b71bf0153d83a4ab80ef085c8c363b4d Mon Sep 17 00:00:00 2001 From: David Adam Date: Tue, 11 Feb 2020 14:25:49 +0800 Subject: [PATCH 12/18] make_pkg: use absolute source directories in all arguments (cherry picked from commit 6682f0e8ca2fd39ef5eb5c89dc23d2f413ba28bf) --- build_tools/make_pkg.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build_tools/make_pkg.sh b/build_tools/make_pkg.sh index 71c8ee1ed..8d07562db 100755 --- a/build_tools/make_pkg.sh +++ b/build_tools/make_pkg.sh @@ -24,9 +24,9 @@ OUTPUT_PATH=${FISH_ARTEFACT_PATH:-~/fish_built} mkdir -p "$PKGDIR/build" "$PKGDIR/root" "$PKGDIR/intermediates" "$PKGDIR/dst" { cd "$PKGDIR/build" && cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo "$SRC_DIR" && make -j 4 && env DESTDIR="$PKGDIR/root/" make install; } -pkgbuild --scripts build_tools/osx_package_scripts --root "$PKGDIR/root/" --identifier 'com.ridiculousfish.fish-shell-pkg' --version "$VERSION" "$PKGDIR/intermediates/fish.pkg" +pkgbuild --scripts "$SRC_DIR/build_tools/osx_package_scripts" --root "$PKGDIR/root/" --identifier 'com.ridiculousfish.fish-shell-pkg' --version "$VERSION" "$PKGDIR/intermediates/fish.pkg" -productbuild --package-path "$PKGDIR/intermediates" --distribution build_tools/osx_distribution.xml --resources build_tools/osx_package_resources/ "$OUTPUT_PATH/fish-$VERSION.pkg" +productbuild --package-path "$PKGDIR/intermediates" --distribution "$SRC_DIR/build_tools/osx_distribution.xml" --resources "$SRC_DIR/build_tools/osx_package_resources/" "$OUTPUT_PATH/fish-$VERSION.pkg" # Make the app From 2e709dc58c9a9f9d2946a7a37665280967e0e73f Mon Sep 17 00:00:00 2001 From: Maksim Novikov Date: Tue, 11 Feb 2020 11:07:07 +0100 Subject: [PATCH 13/18] Include special characters in conda env names Allows completion for environments with names containing special characters. For example: my-env, myenv.1, myenv+1 --- share/completions/conda.fish | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/completions/conda.fish b/share/completions/conda.fish index 88a391485..c969233b7 100644 --- a/share/completions/conda.fish +++ b/share/completions/conda.fish @@ -31,7 +31,7 @@ function __fish_conda_config_keys end function __fish_conda_environments - conda env list | string match -rv '^#' | string match -r '^\w+' + conda env list | string match -rv '^#' | string match -r '^\S+' end # common options From d7dd30852f10a011bbe9ad89c309cb30c4f37344 Mon Sep 17 00:00:00 2001 From: David Adam Date: Wed, 12 Feb 2020 15:15:30 +0800 Subject: [PATCH 14/18] CHANGELOG: final work on 3.1.0 --- CHANGELOG.md | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f6eb2aca9..4e6eff85c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,12 +1,10 @@ # fish 3.1.0 Compared to the beta release of fish 3.1b1, fish version 3.1.0: - -- Fixes a number of problems in compiling and running the test suite on Cygwin and Solaris-derived systems such as Illumos -- Also disables any `apropos` invocations on macos via the man completion, not just command completion. -- Fixes a regression where spaces after a brace were removed when brace expansion wasn't triggered (#6564) -- Fixes some broken links in the documentation. -- Fixes a typo in the `bat` completions (#6580) +- fixes a regression where spaces after a brace were removed despite brace expansion not occurring (#6564) +- fixes a number of problems in compiling and testing on Cygwin (#6549) and Solaris-derived systems such as Illumos (#6553, #6554, #6555, #6556, and #6558); +- fixes the process for building macOS packages; and +- contains some improvements to the documentation and a small number of completions. If you are upgrading from version 2.5.0 or before, please also review the release notes for 3.1b1 (included below). From 8d34f7432085a92f258086c379bf1d59ae28b0ff Mon Sep 17 00:00:00 2001 From: David Adam Date: Wed, 12 Feb 2020 15:16:04 +0800 Subject: [PATCH 15/18] CHANGELOG: typo --- CHANGELOG.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e6eff85c..b9cd6387c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,9 @@ Compared to the beta release of fish 3.1b1, fish version 3.1.0: - fixes the process for building macOS packages; and - contains some improvements to the documentation and a small number of completions. -If you are upgrading from version 2.5.0 or before, please also review the release notes for 3.1b1 (included below). +If you are upgrading from version 3.0.0 or before, please also review the release notes for 3.1b1 (included below). + +--- # fish 3.1b1 (released January 26, 2020) From 407a9e2dee27f9bf1f4cf206a4303cda5da14014 Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Wed, 12 Feb 2020 14:57:05 +0100 Subject: [PATCH 16/18] Drop "invalid wide char string" message down to debug level 3 Super annoying in a C locale if the prompt contains non-ascii chars. See #6584 --- src/output.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/output.cpp b/src/output.cpp index 501d3ecd3..e1bcd7cdb 100644 --- a/src/output.cpp +++ b/src/output.cpp @@ -404,7 +404,7 @@ void outputter_t::writestr(const wchar_t *str) { size_t len = wcstombs(nullptr, str, 0); // figure amount of space needed if (len == static_cast(-1)) { - debug(1, L"Tried to print invalid wide character string"); + debug(3, L"Tried to print invalid wide character string"); return; } From eab6f2f37b2cde2dde85e9cfe02a984f2091823d Mon Sep 17 00:00:00 2001 From: David Adam Date: Wed, 12 Feb 2020 22:03:44 +0800 Subject: [PATCH 17/18] CHANGELOG: final final work on 3.1.0 --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b9cd6387c..bf717d70b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,8 @@ Compared to the beta release of fish 3.1b1, fish version 3.1.0: - fixes a regression where spaces after a brace were removed despite brace expansion not occurring (#6564) - fixes a number of problems in compiling and testing on Cygwin (#6549) and Solaris-derived systems such as Illumos (#6553, #6554, #6555, #6556, and #6558); -- fixes the process for building macOS packages; and +- fixes the process for building macOS packages; +- fixes a regression where excessive error messages are printed if Unicode characters are emitted in non-Unicode-capable locales (#6584); and - contains some improvements to the documentation and a small number of completions. If you are upgrading from version 3.0.0 or before, please also review the release notes for 3.1b1 (included below). From 9b7b4b91c66f7254bce5c07b9729ea8828563c8e Mon Sep 17 00:00:00 2001 From: David Adam Date: Wed, 12 Feb 2020 22:04:07 +0800 Subject: [PATCH 18/18] Release 3.1.0 Closes #5934. Closes #6333. --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bf717d70b..46f643e53 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -# fish 3.1.0 +# fish 3.1.0 (released February 12, 2020) Compared to the beta release of fish 3.1b1, fish version 3.1.0: - fixes a regression where spaces after a brace were removed despite brace expansion not occurring (#6564)