From da601d4d69354bea0cfa125ae488f003e00deda5 Mon Sep 17 00:00:00 2001
From: nat-418 <93013864+nat-418@users.noreply.github.com>
Date: Sun, 29 Jan 2023 16:54:39 +0100
Subject: [PATCH 001/200] feat: add support for fossil-scm in prompt (#9500)

* feat: add support for fossil-scm in prompt

* fix: change directory testing and string matching

(cherry picked from commit cf67709931ce5f61f05a31b00dbf1de9e705b52f)
---
 share/functions/fish_fossil_prompt.fish | 53 +++++++++++++++++++++++++
 share/functions/fish_vcs_prompt.fish    |  1 +
 2 files changed, 54 insertions(+)
 create mode 100644 share/functions/fish_fossil_prompt.fish

diff --git a/share/functions/fish_fossil_prompt.fish b/share/functions/fish_fossil_prompt.fish
new file mode 100644
index 000000000..5c42f47e8
--- /dev/null
+++ b/share/functions/fish_fossil_prompt.fish
@@ -0,0 +1,53 @@
+function fish_fossil_prompt --description 'Write out the fossil prompt'
+    # Bail if fossil is not available
+    if not command -sq fossil
+        return 1
+    end
+
+    # Bail if not a fossil checkout
+    if not fossil ls &> /dev/null
+	return 127
+    end
+
+    # Parse fossil info
+    set -l fossil_info (fossil info)
+    string match --regex --quiet \
+        '^project-name:\s*(?<fossil_project_name>.*)$' $fossil_info
+    string match --regex --quiet \
+        '^tags:\s*(?<fossil_tags>.*)$' $fossil_info
+
+    echo -n ' ['
+    set_color --bold magenta
+    echo -n $fossil_project_name
+    set_color normal
+    echo -n ':'
+    set_color --bold yellow
+    echo -n $fossil_tags
+    set_color normal
+
+    # Parse fossil status
+    set -l fossil_status (fossil status)
+    if string match --quiet 'ADDED*' $fossil_status
+        set_color --bold green
+        echo -n '+'
+    end
+    if string match --quiet 'DELETED*' $fossil_status
+        set_color --bold red
+        echo -n '-'
+    end
+    if string match --quiet 'MISSING*' $fossil_status
+        set_color --bold red
+        echo -n '!'
+    end
+    if string match --quiet 'RENAMED*' $fossil_status
+        set_color --bold yellow
+        echo -n '→'
+    end
+    if string match --quiet 'CONFLICT*' $fossil_status
+        set_color --bold green
+        echo -n '×'
+    end
+
+    set_color normal
+    echo -n ']'
+end
diff --git a/share/functions/fish_vcs_prompt.fish b/share/functions/fish_vcs_prompt.fish
index 4b1723d36..b3a42cdb6 100644
--- a/share/functions/fish_vcs_prompt.fish
+++ b/share/functions/fish_vcs_prompt.fish
@@ -3,6 +3,7 @@ function fish_vcs_prompt --description "Print all vcs prompts"
     # This is so we don't try svn if git already worked.
     fish_git_prompt $argv
     or fish_hg_prompt $argv
+    or fish_fossil_prompt $argv
     # The svn prompt is disabled by default because it's quite slow on common svn repositories.
     # To enable it uncomment it.
     # You can also only use it in specific directories by checking $PWD.

From 024fae798359f7831b65cfcc9004e708f874c6f4 Mon Sep 17 00:00:00 2001
From: Fabian Boehm <FHomborg@gmail.com>
Date: Thu, 2 Mar 2023 16:51:24 +0100
Subject: [PATCH 002/200] Disable bracketed paste for read

It's not of much use (read will only read a single line anyway) and
breaks things

Fixes #8285

(cherry picked from commit af49b4d0f8edc49da0ec0871e1fb665ef2332d48)
---
 share/functions/__fish_config_interactive.fish | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/share/functions/__fish_config_interactive.fish b/share/functions/__fish_config_interactive.fish
index 7b8b130bd..97557a6a8 100644
--- a/share/functions/__fish_config_interactive.fish
+++ b/share/functions/__fish_config_interactive.fish
@@ -193,8 +193,10 @@ end" >$__fish_config_dir/config.fish
     # the sequences to bind.expect
     if not set -q FISH_UNIT_TESTS_RUNNING
         # Enable bracketed paste before every prompt (see __fish_shared_bindings for the bindings).
-        # Enable bracketed paste when the read builtin is used.
-        function __fish_enable_bracketed_paste --on-event fish_prompt --on-event fish_read
+        # We used to do this for read, but that would break non-interactive use and
+        # compound commandlines like `read; cat`, because
+        # it won't disable it after the read.
+        function __fish_enable_bracketed_paste --on-event fish_prompt
             printf "\e[?2004h"
         end
 
@@ -205,7 +207,9 @@ end" >$__fish_config_dir/config.fish
 
         # Tell the terminal we support BP. Since we are in __f_c_i, the first fish_prompt
         # has already fired.
-        __fish_enable_bracketed_paste
+        # But only if we're interactive, in case we are in `read`
+        status is-interactive
+        and __fish_enable_bracketed_paste
     end
 
     # Similarly, enable TMUX's focus reporting when in tmux.

From 3bef75fb79f0c10b8377dae7d65073a2a8b8dd0e Mon Sep 17 00:00:00 2001
From: Fabian Boehm <FHomborg@gmail.com>
Date: Tue, 14 Mar 2023 10:50:22 +0100
Subject: [PATCH 003/200] builtins: Don't crash for negative return values

Another from the "why are we asserting instead of doing something
sensible" department.

The alternative is to make exit() and return() compute their own exit
code, but tbh I don't want any *other* builtin to hit this either?

Fixes #9659

(cherry picked from commit a16abf22d9292f232ec7d57b3cf42e2e93ffbb0a)
---
 src/builtin.cpp                |  6 ++++++
 tests/checks/status-value.fish | 23 ++++++++++++++++++++++-
 2 files changed, 28 insertions(+), 1 deletion(-)

diff --git a/src/builtin.cpp b/src/builtin.cpp
index 085b278da..6ec0119c5 100644
--- a/src/builtin.cpp
+++ b/src/builtin.cpp
@@ -475,6 +475,12 @@ proc_status_t builtin_run(parser_t &parser, const wcstring_list_t &argv, io_stre
             return proc_status_t::empty();
         }
         if (code < 0) {
+            // If the code is below 0, constructing a proc_status_t
+            // would assert() out, which is a terrible failure mode
+            // So instead, what we do is we get a positive code,
+            // and we avoid 0.
+            code = abs((256 + code) % 256);
+            if (code == 0) code = 255;
             FLOGF(warning, "builtin %ls returned invalid exit code %d", cmdname.c_str(), code);
         }
         return proc_status_t::from_exit_code(code);
diff --git a/tests/checks/status-value.fish b/tests/checks/status-value.fish
index 1a296acd9..9c9452130 100644
--- a/tests/checks/status-value.fish
+++ b/tests/checks/status-value.fish
@@ -1,4 +1,4 @@
-# RUN: %fish %s
+# RUN: %fish -C 'set -g fish %fish' %s
 
 # Empty commands should be 123
 set empty_var
@@ -24,3 +24,24 @@ echo $status
 # CHECKERR: {{.*}} No matches for wildcard '*gibberishgibberishgibberish*'. {{.*}}
 # CHECKERR: echo *gibberishgibberishgibberish*
 # CHECKERR:      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~^
+
+$fish -c 'exit -5'
+# CHECKERR: warning: builtin exit returned invalid exit code 251
+echo $status
+# CHECK: 251
+
+$fish -c 'exit -1'
+# CHECKERR: warning: builtin exit returned invalid exit code 255
+echo $status
+# CHECK: 255
+
+# (we avoid 0, so this is turned into 255 again)
+$fish -c 'exit -256'
+# CHECKERR: warning: builtin exit returned invalid exit code 255
+echo $status
+# CHECK: 255
+
+$fish -c 'exit -512'
+# CHECKERR: warning: builtin exit returned invalid exit code 255
+echo $status
+# CHECK: 255

From 252f521e9509210dee94f889895355dce3e4fddc Mon Sep 17 00:00:00 2001
From: Fabian Boehm <FHomborg@gmail.com>
Date: Mon, 27 Mar 2023 17:21:09 +0200
Subject: [PATCH 004/200] docs: Prevent overflow for narrow screens

Regression from #9003, this is visible on mobile mainly.

Fixes #9690

(cherry picked from commit ca02e88ef19d71821b633d139fe20b1284bb51b1)
---
 doc_src/python_docs_theme/static/pydoctheme.css | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/doc_src/python_docs_theme/static/pydoctheme.css b/doc_src/python_docs_theme/static/pydoctheme.css
index c9ea726c5..6eb6e2474 100644
--- a/doc_src/python_docs_theme/static/pydoctheme.css
+++ b/doc_src/python_docs_theme/static/pydoctheme.css
@@ -552,6 +552,10 @@ aside.footnote > p {
     line-height: 1.5em;
 }
 
+div.documentwrapper {
+    width: 100%;
+}
+
 /* On screens that are less than 700px wide remove anything non-essential
    - the sidebar, the gradient background, ... */
 @media screen and (max-width: 700px) {

From d6bd3d8dc83cf4891a27a23da749f2d053a20716 Mon Sep 17 00:00:00 2001
From: Chris Wendt <chrismwendt@gmail.com>
Date: Mon, 27 Mar 2023 09:29:14 -0600
Subject: [PATCH 005/200] Use stack's dynamic completions (#9681)

* Use dynamic completions for stack

* Pass the plain command

(cherry picked from commit 3a72d098e2da7d303c096d16b12297bccacbec68)
---
 share/completions/stack.fish | 80 +-----------------------------------
 1 file changed, 1 insertion(+), 79 deletions(-)

diff --git a/share/completions/stack.fish b/share/completions/stack.fish
index 79448df55..73705e2e6 100644
--- a/share/completions/stack.fish
+++ b/share/completions/stack.fish
@@ -1,81 +1,3 @@
-complete -c stack -f
-
 # Completion for 'stack' haskell build tool (http://haskellstack.org)
-# (Handmade) generated from version 1.0.0
 
-#
-# Options:
-#
-
-set -l project_path "(stack path --project-root)"
-
-complete -c stack -l help -d 'Show this help text'
-complete -c stack -l version -d'Show version'
-complete -c stack -l numeric-version -d 'Show only version number'
-complete -c stack -l docker -d 'Run \'stack --docker-help\' for details'
-complete -c stack -l nix -d 'Run \'stack --nix-help\' for details'
-complete -c stack -l verbosity -a 'silent error warn info debug' -d 'Verbosity: silent, error, warn, info, debug'
-complete -c stack -l verbose -d 'Enable verbose mode: verbosity level "debug"'
-complete -c stack -l work-dir -a '(__fish_complete_directories)' -d 'Override work directory (default: .stack-work)'
-complete -c stack -l system-ghc -d 'Enable using the system installed GHC (on the PATH) if available and a matching version'
-complete -c stack -l no-system-ghc -d 'Disable using the system installed GHC (on the PATH) if available and a matching version'
-complete -c stack -l install-ghc -d 'Enable downloading and installing GHC if necessary (can be done manually with stack setup)'
-complete -c stack -l no-install-ghc -d 'Disable downloading and installing GHC if necessary (can be done manually with stack setup)'
-complete -c stack -l arch -r -d 'System architecture, e.g. i386, x86_64'
-complete -c stack -l os -r -d 'Operating system, e.g. linux, windows'
-complete -c stack -l ghc-variant -d 'Specialized GHC variant, e.g. integersimple (implies --no-system-ghc)'
-complete -c stack -l obs -r -d 'Number of concurrent jobs to run'
-complete -c stack -l extra-include-dirs -a '(__fish_complete_directories)' -d 'Extra directories to check for C header files'
-complete -c stack -l extra-lib-dirs -a '(__fish_complete_directories)' -d 'Extra directories to check for libraries'
-complete -c stack -l skip-ghc-check -d 'Enable skipping the GHC version and architecture check'
-complete -c stack -l no-skip-ghc-check -d 'Disable skipping the GHC version and architecture check'
-complete -c stack -l skip-msys -d 'Enable skipping the local MSYS installation (Windows only)'
-complete -c stack -l no-skip-msys -d 'Disable skipping the local MSYS installation (Windows only)'
-complete -c stack -l local-bin-path -a '(__fish_complete_directories)' -d 'Install binaries to DIR'
-complete -c stack -l modify-code-page -d 'Enable setting the codepage to support UTF-8 (Windows only)'
-complete -c stack -l no-modify-code-page -d 'Disable setting the codepage to support UTF-8 (Windows only)'
-complete -c stack -l resolver -d 'Override resolver in project file'
-complete -c stack -l compiler -d 'Use the specified compiler'
-complete -c stack -l terminal -d 'Enable overriding terminal detection in the case of running in a false terminal'
-complete -c stack -l no-terminal -d 'Disable overriding terminal detection in the case of running in a false terminal'
-complete -c stack -l stack-yaml -a '(__fish_complete_path)' -d 'Override project stack.yaml file (overrides any STACK_YAML environment variable)'
-
-#
-# Commands:
-#
-
-complete -c stack -a build -d 'Build the package(s) in this directory/configuration'
-complete -c stack -a install -d 'Shortcut for \'build --copy-bins\''
-complete -c stack -a test -d 'Shortcut for \'build --test\''
-complete -c stack -a bench -d 'Shortcut for \'build --bench\''
-complete -c stack -a haddock -d 'Shortcut for \'build --haddock\''
-complete -c stack -a new -d 'Create a new project from a template. Run \'stack templates\' to see available templates.'
-complete -c stack -a templates -d 'List the templates available for \'stack new\'.'
-complete -c stack -a init -d 'Initialize a stack project based on one or more cabal packages'
-complete -c stack -a solver -d 'Use a dependency solver to try and determine missing extra-deps'
-complete -c stack -a setup -d 'Get the appropriate GHC for your project'
-complete -c stack -a path -d 'Print out handy path information'
-complete -c stack -a unpack -d 'Unpack one or more packages locally'
-complete -c stack -a update -d 'Update the package index'
-complete -c stack -a upgrade -d 'Upgrade to the latest stack (experimental)'
-complete -c stack -a upload -d 'Upload a package to Hackage'
-complete -c stack -a sdist -d 'Create source distribution tarballs'
-complete -c stack -a dot -d 'Visualize your project\'s dependency graph using Graphviz dot'
-complete -c stack -a exec -d 'Execute a command'
-complete -c stack -a ghc -d 'Run ghc'
-complete -c stack -a ghci -d 'Run ghci in the context of package(s) (experimental)'
-complete -c stack -a repl -d 'Run ghci in the context of package(s) (experimental) (alias for \'ghci\')'
-complete -c stack -a runghc -d 'Run runghc'
-complete -c stack -a runhaskell -d 'Run runghc (alias for \'runghc\')'
-complete -c stack -a eval -d 'Evaluate some haskell code inline. Shortcut for \'stack exec ghc -- -e CODE\''
-complete -c stack -a clean -d 'Clean the local packages'
-complete -c stack -a list-dependencies -d 'List the dependencies'
-complete -c stack -a query -d 'Query general build information (experimental)'
-complete -c stack -a ide -d 'IDE-specific commands'
-complete -c stack -a docker -d 'Subcommands specific to Docker use'
-complete -c stack -a config -d 'Subcommands specific to modifying stack.yaml files'
-complete -c stack -a image -d 'Subcommands specific to imaging (experimental)'
-complete -c stack -a hpc -d 'Subcommands specific to Haskell Program Coverage'
-complete -c stack -a sig -d 'Subcommands specific to package signatures (experimental)'
-
-complete -c stack -n '__fish_seen_subcommand_from exec' -a "(ls $project_path/.stack-work/install/**/bin/)"
+stack --fish-completion-script stack | source

From 3e6f5999f544235b7b9a801bded671da893da3d6 Mon Sep 17 00:00:00 2001
From: Emily Grace Seville <EmilySeville7cfg@gmail.com>
Date: Thu, 16 Mar 2023 01:47:18 +1000
Subject: [PATCH 006/200] Add md-to-clip completion

- https://github.com/command-line-interface-pages/v2-tooling/tree/main/md-to-clip

(cherry picked from commit ba7785856ebd0bbd2f5f712ca998de4599094eec)
---
 share/completions/md-to-clip.fish | 8 ++++++++
 1 file changed, 8 insertions(+)
 create mode 100644 share/completions/md-to-clip.fish

diff --git a/share/completions/md-to-clip.fish b/share/completions/md-to-clip.fish
new file mode 100644
index 000000000..928ed89a0
--- /dev/null
+++ b/share/completions/md-to-clip.fish
@@ -0,0 +1,8 @@
+# Source: https://github.com/command-line-interface-pages/v2-tooling/tree/main/md-to-clip
+complete -c md-to-clip -s h -l help -d 'Display help'
+complete -c md-to-clip -s v -l version -d 'Display version'
+complete -c md-to-clip -s a -l author -d 'Display author'
+complete -c md-to-clip -s e -l email -d 'Display author email'
+complete -c md-to-clip -o nfs -l no-file-save -d 'Whether to display conversion result in stdout instead of writing it to a file'
+complete -c md-to-clip -o od -l output-directory -d 'Directory where conversion result will be written'
+complete -c md-to-clip -o spc -l special-placeholder-config -d 'Config with special placeholders'

From 037f4b9eea847dddcaa55e49df2f694c12d51462 Mon Sep 17 00:00:00 2001
From: Fabian Boehm <FHomborg@gmail.com>
Date: Mon, 27 Mar 2023 22:55:45 +0200
Subject: [PATCH 007/200] __fish_complete_directories: Remove --foo= from token

Otherwise this would complete

`git --exec-path=foo`, by running `complete -C"'' --exec-path=foo"`,

which would print "--exec-path=foo", and so it would end as

`git --exec-path=--exec-path=foo` because the "replaces token" bit was
lost.

I'm not sure how to solve it cleanly - maybe an additional option to
`complete`?

Anyway, for now this
Fixes #9538.

(cherry picked from commit c39780fefbfc26554cd2ff0c8400884ced4c07e7)
---
 share/functions/__fish_complete_directories.fish | 6 +++++-
 tests/checks/complete_directories.fish           | 7 ++++++-
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/share/functions/__fish_complete_directories.fish b/share/functions/__fish_complete_directories.fish
index 31eaf23e1..ce844d5c6 100644
--- a/share/functions/__fish_complete_directories.fish
+++ b/share/functions/__fish_complete_directories.fish
@@ -9,7 +9,11 @@ function __fish_complete_directories -d "Complete directory prefixes" --argument
     end
 
     if not set -q comp[1]
-        set comp (commandline -ct)
+        # No token given, so we use the current commandline token.
+        # If we have a --name=val option, we need to remove it,
+        # or the complete -C below would keep it, and then whatever complete
+        # called us would add it again (assuming it's in the current token)
+        set comp (commandline -ct | string replace -r -- '^-[^=]*=' '' $comp)
     end
 
     # HACK: We call into the file completions by using an empty command
diff --git a/tests/checks/complete_directories.fish b/tests/checks/complete_directories.fish
index e6fcdc1de..681a8c633 100644
--- a/tests/checks/complete_directories.fish
+++ b/tests/checks/complete_directories.fish
@@ -1,4 +1,5 @@
-#RUN: %fish %s
+#RUN: %fish --interactive %s
+# ^ interactive so we can do `complete`
 mkdir -p __fish_complete_directories/
 cd __fish_complete_directories
 mkdir -p test/buildroot
@@ -25,3 +26,7 @@ __fish_complete_directories test/data/
 __fish_complete_directories test/data/abc 'abc dirs'
 #CHECK: test/data/abc/	abc dirs
 #CHECK: test/data/abcd/	abc dirs
+
+complete -c mydirs -l give-me-dir -a '(__fish_complete_directories)'
+complete -C'mydirs --give-me-dir='
+#CHECK: --give-me-dir=test/{{\t}}Directory

From f1a6e77b72475fe2d8deb97838a44634d5c8b27d Mon Sep 17 00:00:00 2001
From: Fabian Boehm <FHomborg@gmail.com>
Date: Mon, 27 Mar 2023 22:37:01 +0200
Subject: [PATCH 008/200] completions/git: Complete branches for
 --set-upstream-to

See #9538

(cherry picked from commit 563b4d23721cebf056356a7481d394329906745a)
---
 share/completions/git.fish | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/share/completions/git.fish b/share/completions/git.fish
index a5880bf98..f4d058914 100644
--- a/share/completions/git.fish
+++ b/share/completions/git.fish
@@ -1233,7 +1233,7 @@ complete -f -c git -n '__fish_git_using_command branch' -s a -l all -d 'Lists bo
 complete -f -c git -n '__fish_git_using_command branch' -s r -l remotes -d 'List or delete (if used with -d) the remote-tracking branches.'
 complete -f -c git -n '__fish_git_using_command branch' -s t -l track -l track -d 'Track remote branch'
 complete -f -c git -n '__fish_git_using_command branch' -l no-track -d 'Do not track remote branch'
-complete -f -c git -n '__fish_git_using_command branch' -l set-upstream-to -d 'Set remote branch to track'
+complete -f -c git -n '__fish_git_using_command branch' -l set-upstream-to -d 'Set remote branch to track' -ka '(__fish_git_branches)'
 complete -f -c git -n '__fish_git_using_command branch' -l merged -d 'List branches that have been merged'
 complete -f -c git -n '__fish_git_using_command branch' -l no-merged -d 'List branches that have not been merged'
 complete -f -c git -n '__fish_git_using_command branch' -l unset-upstream -d 'Remove branch upstream information'

From 3e638517cd226286aeee25e1312992790e12a713 Mon Sep 17 00:00:00 2001
From: Fabian Boehm <FHomborg@gmail.com>
Date: Tue, 28 Mar 2023 17:19:16 +0200
Subject: [PATCH 009/200] completions/git: Don't take options for
 --{force-,}create

We do the same for checkout -b.

Fixes #9692

(cherry picked from commit bc04abe3eca950c231fec322c8339e3a82437e12)
---
 share/completions/git.fish | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/share/completions/git.fish b/share/completions/git.fish
index f4d058914..a733ed073 100644
--- a/share/completions/git.fish
+++ b/share/completions/git.fish
@@ -1959,8 +1959,8 @@ complete -F -c git -n '__fish_git_using_command restore' -n '__fish_git_contains
 complete -f -c git -n __fish_git_needs_command -a switch -d 'Switch to a branch'
 complete -f -c git -n '__fish_git_using_command switch' -ka '(__fish_git_unique_remote_branches)' -d 'Unique Remote Branch'
 complete -f -c git -n '__fish_git_using_command switch' -ka '(__fish_git_local_branches)'
-complete -f -c git -n '__fish_git_using_command switch' -r -s c -l create -d 'Create a new branch'
-complete -f -c git -n '__fish_git_using_command switch' -r -s C -l force-create -d 'Force create a new branch'
+complete -f -c git -n '__fish_git_using_command switch' -s c -l create -d 'Create a new branch'
+complete -f -c git -n '__fish_git_using_command switch' -s C -l force-create -d 'Force create a new branch'
 complete -f -c git -n '__fish_git_using_command switch' -s d -l detach -d 'Switch to a commit for inspection and discardable experiment' -rka '(__fish_git_refs)'
 complete -f -c git -n '__fish_git_using_command switch' -l guess -d 'Guess branch name from remote branch (default)'
 complete -f -c git -n '__fish_git_using_command switch' -l no-guess -d 'Do not guess branch name from remote branch'

From b4fccb114c2e87275910259d523c82597c17d47c Mon Sep 17 00:00:00 2001
From: Fabian Boehm <FHomborg@gmail.com>
Date: Fri, 31 Mar 2023 20:03:24 +0200
Subject: [PATCH 010/200] __fish_cursor_xterm: Ignore unknown cursor settings

This prevents leaking the escape sequence by printing nonsense, and it
also allows disabling cursor setting by just setting the variable to
e.g. empty.

And if we ever added any shapes, it would allow them to be used on new
fish and ignored on old

Fixes #9698

(cherry picked from commit e45bddcbb1b9c42cf0694880fbb347aaf9775573)
---
 doc_src/interactive.rst                  | 2 ++
 share/functions/__fish_cursor_xterm.fish | 3 +++
 2 files changed, 5 insertions(+)

diff --git a/doc_src/interactive.rst b/doc_src/interactive.rst
index 8c9b99e13..db81d32ea 100644
--- a/doc_src/interactive.rst
+++ b/doc_src/interactive.rst
@@ -426,6 +426,8 @@ The ``fish_vi_cursor`` function will be used to change the cursor's shape depend
 
 Additionally, ``blink`` can be added after each of the cursor shape parameters to set a blinking cursor in the specified shape.
 
+Fish knows the shapes "block", "line" and "underscore", other values will be ignored.
+
 If the cursor shape does not appear to be changing after setting the above variables, it's likely your terminal emulator does not support the capabilities necessary to do this. It may also be the case, however, that ``fish_vi_cursor`` has not detected your terminal's features correctly (for example, if you are using ``tmux``). If this is the case, you can force ``fish_vi_cursor`` to set the cursor shape by setting ``$fish_vi_force_cursor`` in ``config.fish``. You'll have to restart fish for any changes to take effect. If cursor shape setting remains broken after this, it's almost certainly an issue with your terminal emulator, and not fish.
 
 .. _vi-mode-command:
diff --git a/share/functions/__fish_cursor_xterm.fish b/share/functions/__fish_cursor_xterm.fish
index 7a964ba99..e05a1b9a5 100644
--- a/share/functions/__fish_cursor_xterm.fish
+++ b/share/functions/__fish_cursor_xterm.fish
@@ -8,6 +8,9 @@ function __fish_cursor_xterm -d 'Set cursor (xterm)'
             set shape 4
         case line
             set shape 6
+        case '*'
+            # Unknown shape
+            return
     end
     if contains blink $argv
         set shape (math $shape - 1)

From de5bd624d8da48bdba1e2ef4b1e2517571a16f4c Mon Sep 17 00:00:00 2001
From: Robert Szulist <szuro@users.noreply.github.com>
Date: Sat, 1 Apr 2023 05:13:40 +0200
Subject: [PATCH 011/200] Add Zabbix completions (#9647)

Add Zabbix completions

(cherry picked from commit 9bd1dc14e520b5da00539141c6b7c3f029c1ce90)
---
 share/completions/zabbix_agent2.fish      | 14 ++++
 share/completions/zabbix_agentd.fish      | 34 ++++++++
 share/completions/zabbix_get.fish         | 23 ++++++
 share/completions/zabbix_js.fish          |  9 +++
 share/completions/zabbix_proxy.fish       | 60 ++++++++++++++
 share/completions/zabbix_sender.fish      | 31 ++++++++
 share/completions/zabbix_server.fish      | 96 +++++++++++++++++++++++
 share/completions/zabbix_web_service.fish |  3 +
 8 files changed, 270 insertions(+)
 create mode 100644 share/completions/zabbix_agent2.fish
 create mode 100644 share/completions/zabbix_agentd.fish
 create mode 100644 share/completions/zabbix_get.fish
 create mode 100644 share/completions/zabbix_js.fish
 create mode 100644 share/completions/zabbix_proxy.fish
 create mode 100644 share/completions/zabbix_sender.fish
 create mode 100644 share/completions/zabbix_server.fish
 create mode 100644 share/completions/zabbix_web_service.fish

diff --git a/share/completions/zabbix_agent2.fish b/share/completions/zabbix_agent2.fish
new file mode 100644
index 000000000..ac276e4a6
--- /dev/null
+++ b/share/completions/zabbix_agent2.fish
@@ -0,0 +1,14 @@
+set -l runtime "userparameter_reload" \
+    "log_level_increase" \
+    "log_level_decrease" \
+    help \
+    metrics \
+    version
+
+complete -c zabbix_agent2 -s c -l config -d "Specify an alternate config-file."
+complete -c zabbix_agent2 -r -f -s R -l runtime-control -a "$runtime" -d "Perform administrative functions."
+complete -c zabbix_agent2 -f -s p -l print -d "Print known items and exit."
+complete -c zabbix_agent2 -f -s t -l test -d "Test single item and exit."
+complete -c zabbix_agent2 -f -s h -l help -d "Display this help and exit."
+complete -c zabbix_agent2 -f -s V -l version -d "Output version information and exit."
+
diff --git a/share/completions/zabbix_agentd.fish b/share/completions/zabbix_agentd.fish
new file mode 100644
index 000000000..b342c520e
--- /dev/null
+++ b/share/completions/zabbix_agentd.fish
@@ -0,0 +1,34 @@
+set -l runtime userparameter_reload \
+    log_level_increase \
+    log_level_increase= \
+    log_level_decrease \
+    log_level_decrease=
+
+
+function __fish_string_in_command -a ch
+    string match -rq $ch (commandline)
+end
+
+function __fish_prepend -a prefix
+    if string match -rq 'log_level_(in|de)crease' $prefix
+        set var "active checks" collector listener
+    end
+
+    for i in $var
+        echo $prefix="$i"
+    end
+end
+
+# General
+complete -c zabbix_agentd -s c -l config -d "Specify an alternate config-file."
+complete -c zabbix_agentd -f -s f -l foreground -d "Run Zabbix agent in foreground."
+complete -c zabbix_agentd -r -f -s R -l runtime-control -a "$runtime" -d "Perform administrative functions."
+complete -c zabbix_agentd -f -s p -l print -d "Print known items and exit."
+complete -c zabbix_agentd -f -s t -l test -d "Test single item and exit."
+complete -c zabbix_agentd -f -s h -l help -d "Display this help and exit."
+complete -c zabbix_agentd -f -s V -l version -d "Output version information and exit."
+
+# Log levels
+complete -c zabbix_agentd -r -f -s R -l runtime-control -n "__fish_string_in_command log_level_increase" -a "(__fish_prepend log_level_increase)"
+complete -c zabbix_agentd -r -f -s R -l runtime-control -n "__fish_string_in_command log_level_decrease" -a "(__fish_prepend log_level_decrease)"
+
diff --git a/share/completions/zabbix_get.fish b/share/completions/zabbix_get.fish
new file mode 100644
index 000000000..3eabb5bf1
--- /dev/null
+++ b/share/completions/zabbix_get.fish
@@ -0,0 +1,23 @@
+# General
+complete -c zabbix_get -f -s s -l host -d "Specify host name or IP address of a host."
+complete -c zabbix_get -f -s p -l port -d "Specify port number of agent running on the host."
+complete -c zabbix_get -f -s I -l source-address -d "Specify source IP address."
+complete -c zabbix_get -f -s t -l timeout -d "Specify timeout."
+complete -c zabbix_get -f -s k -l key -d "Specify key of item to retrieve value for."
+complete -c zabbix_get -f -s h -l help -d "Display this help and exit."
+complete -c zabbix_get -f -s V -l version -d "Output version information and exit."
+
+
+# TLS
+complete -c zabbix_get -f -r -l tls-connect -a "unencrypted psk cert" -d "How to connect to agent."
+complete -c zabbix_get -l tls-ca-file -F -d "Full path of a file with the top-level CA(s)."
+complete -c zabbix_get -l tls-crl-file -F -d " Full path of a file with revoked certificates."
+complete -c zabbix_get -f -l tls-agent-cert-issuer -d "Allowed agent certificate issuer."
+complete -c zabbix_get -f -l tls-agent-cert-subject -d "Allowed agent certificate subject."
+complete -c zabbix_get -l tls-cert-file -d "Full path the certificate or certificate chain."
+complete -c zabbix_get -l tls-key-file -d "Full path of a file with the private key."
+complete -c zabbix_get -f -l tls-psk-identity -d "PSK-identity string."
+complete -c zabbix_get -l tls-psk-file -d "Full path of a file with the pre-shared key."
+complete -c zabbix_get -f -l tls-cipher13 -d "Cipher string for OpenSSL."
+complete -c zabbix_get -f -l tls-cipher -d "GnuTLS priority string."
+
diff --git a/share/completions/zabbix_js.fish b/share/completions/zabbix_js.fish
new file mode 100644
index 000000000..3100aec2f
--- /dev/null
+++ b/share/completions/zabbix_js.fish
@@ -0,0 +1,9 @@
+# General
+complete -c zabbix_js -s s -l script -d "Specify the file name of the script to execute."
+complete -c zabbix_js -f -s p -l param -d "Specify the input parameter."
+complete -c zabbix_js -s i -l input -d "Specify the file name of the input parameter."
+complete -c zabbix_js -f -s l -l loglevel -d "Specify the log level."
+complete -c zabbix_js -f -s t -l timeout -d "Specify the timeout in seconds."
+complete -c zabbix_js -f -s h -l help -d "Display this help and exit."
+complete -c zabbix_js -f -s V -l version -d "Output version information and exit."
+
diff --git a/share/completions/zabbix_proxy.fish b/share/completions/zabbix_proxy.fish
new file mode 100644
index 000000000..92f5c4adc
--- /dev/null
+++ b/share/completions/zabbix_proxy.fish
@@ -0,0 +1,60 @@
+set -l runtime config_cache_reload \
+    snmp_cache_reload \
+    housekeeper_execute \
+    diaginfo \
+    diaginfo= \
+    log_level_increase \
+    log_level_increase= \
+    log_level_decrease \
+    log_level_decrease=
+
+
+function __fish_string_in_command -a ch
+    string match -rq $ch (commandline)
+end
+
+function __fish_prepend -a prefix
+    set -l log_target "configuration syncer" \
+    "data sender" \
+    discoverer \
+    "history syncer" \
+    housekeeper \
+    "http poller" \
+    "icmp pinger"\
+    "ipmi manager" \
+    "ipmi poller" \
+    "java poller" \
+    poller \
+    self-monitoring \
+    "snmp trapper" \
+    "task manager" \
+    trapper \
+    "unreachable poller" \
+    "vmware collector"
+
+    if string match -rq 'log_level_(in|de)crease' $prefix
+        set var $log_target
+    else if string match -rq 'diaginfo' $prefix
+        set var historycache preprocessing
+    end
+
+    for i in $var
+        echo $prefix="$i"
+    end
+end
+
+
+# General
+complete -c zabbix_proxy -s c -l config -d "Use an alternate config-file."
+complete -c zabbix_proxy -f -s f -l foreground -d "Run Zabbix agent in foreground."
+complete -c zabbix_proxy -f -s R -l runtime-control -a "$runtime" -d "Perform administrative functions."
+complete -c zabbix_proxy -f -s h -l help -d "Display this help and exit."
+complete -c zabbix_proxy -f -s V -l version -d "Output version information and exit."
+
+# Logs
+complete -c zabbix_proxy -r -f -s R -l runtime-control -n "__fish_string_in_command log_level_increase" -a "(__fish_prepend log_level_increase)"
+complete -c zabbix_proxy -r -f -s R -l runtime-control -n "__fish_string_in_command log_level_decrease" -a "(__fish_prepend log_level_decrease)"
+
+# Diag info
+complete -c zabbix_proxy -r -f -s R -l runtime-control -n "__fish_string_in_command diaginfo" -a "(__fish_prepend diaginfo)"
+
diff --git a/share/completions/zabbix_sender.fish b/share/completions/zabbix_sender.fish
new file mode 100644
index 000000000..5c9a447ef
--- /dev/null
+++ b/share/completions/zabbix_sender.fish
@@ -0,0 +1,31 @@
+# General
+complete -c zabbix_sender -F -s c -l config -d "Zabbix Agent configuration file."
+complete -c zabbix_sender -f -s z -l zabbix-server -d "Hostname or IP address of Zabbix server."
+complete -c zabbix_sender -f -s p -l port -d "Specify port number of agent running on the host."
+complete -c zabbix_sender -f -s I -l source-address -d "Source IP address."
+complete -c zabbix_sender -f -s t -l timeout -d "Specify timeout."
+complete -c zabbix_sender -f -s s -l host -d "Specify host name the item belongs to."
+complete -c zabbix_sender -f -s k -l key -d "Specify item key to send value to."
+complete -c zabbix_sender -f -s o -l value -d "Specify item value."
+complete -c zabbix_sender -s i -l input-file -d "Load values from input file."
+complete -c zabbix_sender -f -s h -l help -d "Display this help and exit."
+complete -c zabbix_sender -f -s V -l version -d "Output version information and exit."
+complete -c zabbix_sender -s T -l with-timestamps -d "Input file contains timestamps"
+complete -c zabbix_sender -s N -l with-ns -d "Timestamps have nanosecond portion."
+complete -c zabbix_sender -s r -l real-time -d "Send values as soon as they are received."
+complete -c zabbix_sender -s v -l verbose -d "Verbose mode, -vv for more details."
+
+
+# TLS
+complete -c zabbix_sender -f -r -l tls-connect -a "unencrypted psk cert" -d "How to connect to agent."
+complete -c zabbix_sender -l tls-ca-file -F -d "Full path of a with the top-level CA(s)."
+complete -c zabbix_sender -l tls-crl-file -F -d "Full path of a file with revoked certificates."
+complete -c zabbix_sender -f -l tls-server-cert-issuer -d "Allowed server certificate issuer."
+complete -c zabbix_sender -f -l tls-server-cert-subject -d "Allowed server certificate subject."
+complete -c zabbix_sender -l tls-cert-file -d "Full path of the certificate or certificate chain."
+complete -c zabbix_sender -l tls-key-file -d "Full path of  the private key."
+complete -c zabbix_sender -f -l tls-psk-identity -d "PSK-identity string."
+complete -c zabbix_sender -l tls-psk-file -d "Full path of a file with the pre-shared key."
+complete -c zabbix_sender -f -l tls-cipher13 -d "Cipher string for OpenSSL."
+complete -c zabbix_sender -f -l tls-cipher -d "GnuTLS priority string."
+
diff --git a/share/completions/zabbix_server.fish b/share/completions/zabbix_server.fish
new file mode 100644
index 000000000..e6cd218ac
--- /dev/null
+++ b/share/completions/zabbix_server.fish
@@ -0,0 +1,96 @@
+set -l runtime config_cache_reload \
+    housekeeper_execute \
+    trigger_housekeeper_execute \
+    log_level_increase \
+    "log_level_increase=" \
+    log_level_decrease \
+    "log_level_decrease=" \
+    snmp_cache_reload \
+    secrets_reload \
+    diaginfo \
+    "diaginfo=" \
+    prof_enable \
+    prof_enable= \
+    prof_disable \
+    prof_disable= \
+    service_cache_reload \
+    ha_status \
+    "ha_remove_node=" \
+    ha_set_failover_delay 
+
+set -l scope rwlock mutex processing 
+
+
+function __fish_string_in_command -a ch
+    string match -rq $ch (commandline)
+end
+
+function __fish_prepend -a prefix
+    set -l log_target alerter \
+        "alert manager" \
+        "configuration syncer" \
+        discoverer \
+        escalator \
+        "history syncer" \
+        housekeeper \
+        "http poller" \
+        "icmp pinger" \
+        "ipmi manager" \
+        "ipmi poller" \
+        "java poller" \
+        poller \
+        "preprocessing manager" \
+        "preprocessing worker" \
+        "proxy poller" \
+        "self-monitoring" \
+        "snmp trapper" \
+        "task manager" \
+        timer \
+        trapper \
+        "unreachable poller" \
+        "vmware collector" \
+        "history poller" \
+        "availability manager" \
+        "service manager" \
+        "odbc poller"
+
+    if string match -rq 'log_level_(in|de)crease' $prefix
+        set var $log_target
+    else if string match -rq 'prof_(en|dis)able' $prefix
+        set var $log_target 'ha manager'
+    else if string match -rq 'diaginfo' $prefix
+        set var historycache preprocessing alerting lld valuecache locks
+    end
+
+    for i in $var
+        echo $prefix="$i"
+    end
+end
+
+
+function __fish_list_nodes
+    zabbix_server -R ha_status | tail -n+4 | awk '{print "ha_remove_node="$3}'
+end
+
+# General
+complete -c zabbix_server -s c -l config -d "Path to the configuration file."
+complete -c zabbix_server -f -s f -l foreground -d "Run Zabbix server in foreground."
+complete -c zabbix_server -f -s h -l help -d "Display this help message."
+complete -c zabbix_server -f -s V -l version -d "Display version number."
+complete -c zabbix_server -f -s R -l runtime-control -a "$runtime" -d "Perform administrative functions."
+
+
+# Log levels
+complete -c zabbix_server -r -f -s R -l runtime-control -n "__fish_string_in_command log_level_increase" -a "(__fish_prepend log_level_increase)"
+complete -c zabbix_server -r -f -s R -l runtime-control -n "__fish_string_in_command log_level_decrease" -a "(__fish_prepend log_level_decrease)"
+
+# Prof enable
+complete -c zabbix_server -r -f -s R -l runtime-control -n "__fish_string_in_command prof_enable" -a "(__fish_prepend prof_enable)"
+complete -c zabbix_server -r -f -s R -l runtime-control -n "__fish_string_in_command prof_disable" -a "(__fish_prepend prof_disable)"
+
+# HA nodes
+complete -c zabbix_server -r -f -s R -l runtime-control -n "__fish_string_in_command ha_remove_node" -a "(__fish_list_nodes)"
+
+# diaginfo
+complete -c zabbix_server -r -f -s R -l runtime-control -n "__fish_string_in_command diaginfo" -a "(__fish_prepend diaginfo)"
+
diff --git a/share/completions/zabbix_web_service.fish b/share/completions/zabbix_web_service.fish
new file mode 100644
index 000000000..003ff8ce5
--- /dev/null
+++ b/share/completions/zabbix_web_service.fish
@@ -0,0 +1,3 @@
+complete -c zabbix_web_service -s c -l config -d "Use an alternate config-file."
+complete -c zabbix_web_service -s h -l help -d "Display this help and exit."
+complete -c zabbix_web_service -s V -l version -d "Output version information and exit."

From 47587ee05a10b3afb5fc26bd60eddb97aae5e4c7 Mon Sep 17 00:00:00 2001
From: ridiculousfish <rf@fishshell.com>
Date: Fri, 31 Mar 2023 20:14:49 -0700
Subject: [PATCH 012/200] Revert "Speed up executable command completions"

This reverts commit 0b55f08de23f818cc4d839dace6926d30cf941dc.

This was found to have caused regressions in completions in #9699

(cherry picked from commit c67d77fc1887eb7b5cd070630a59abe12d24a22e)
---
 src/wildcard.cpp | 74 +++++++++---------------------------------------
 1 file changed, 13 insertions(+), 61 deletions(-)

diff --git a/src/wildcard.cpp b/src/wildcard.cpp
index 66263c300..d11229d58 100644
--- a/src/wildcard.cpp
+++ b/src/wildcard.cpp
@@ -325,61 +325,6 @@ wildcard_result_t wildcard_complete(const wcstring &str, const wchar_t *wc,
                                       out, true /* first call */);
 }
 
-static int fast_waccess(const struct stat &stat_buf, uint8_t mode) {
-    // Cache the effective user id and group id of our own shell process. These can't change on us
-    // because we don't change them.
-    static const uid_t euid = geteuid();
-    static const gid_t egid = getegid();
-
-    // Cache a list of our group memberships.
-    static const std::vector<gid_t> groups = ([&]() {
-        std::vector<gid_t> groups;
-        while (true) {
-            int ngroups = getgroups(0, nullptr);
-            // It is not defined if getgroups(2) includes the effective group of the calling process
-            groups.reserve(ngroups + 1);
-            groups.resize(ngroups, 0);
-            if (getgroups(groups.size(), groups.data()) == -1) {
-                if (errno == EINVAL) {
-                    // Race condition, ngroups has changed between the two getgroups() calls
-                    continue;
-                }
-                wperror(L"getgroups");
-            }
-            break;
-        }
-
-        groups.push_back(egid);
-        std::sort(groups.begin(), groups.end());
-        return groups;
-    })();
-
-    bool have_suid = (stat_buf.st_mode & S_ISUID);
-    if (euid == stat_buf.st_uid || have_suid) {
-        // Check permissions granted to owner
-        if (((stat_buf.st_mode & S_IRWXU) >> 6) & mode) {
-            return 0;
-        }
-    }
-    bool have_sgid = (stat_buf.st_mode & S_ISGID);
-    auto binsearch = std::lower_bound(groups.begin(), groups.end(), stat_buf.st_gid);
-    bool have_group = binsearch != groups.end() && !(stat_buf.st_gid < *binsearch);
-    if (have_group || have_sgid) {
-        // Check permissions granted to group
-        if (((stat_buf.st_mode & S_IRWXG) >> 3) & mode) {
-            return 0;
-        }
-    }
-    if (euid != stat_buf.st_uid && !have_group) {
-        // Check permissions granted to other
-        if ((stat_buf.st_mode & S_IRWXO) & mode) {
-            return 0;
-        }
-    }
-
-    return -1;
-}
-
 /// Obtain a description string for the file specified by the filename.
 ///
 /// The returned value is a string constant and should not be free'd.
@@ -390,8 +335,9 @@ static int fast_waccess(const struct stat &stat_buf, uint8_t mode) {
 /// \param stat_res The result of calling stat on the file
 /// \param buf The struct buf output of calling stat on the file
 /// \param err The errno value after a failed stat call on the file.
-static const wchar_t *file_get_desc(int lstat_res, const struct stat &lbuf, int stat_res,
-                                    const struct stat &buf, int err) {
+static const wchar_t *file_get_desc(const wcstring &filename, int lstat_res,
+                                    const struct stat &lbuf, int stat_res, const struct stat &buf,
+                                    int err) {
     if (lstat_res) {
         return COMPLETE_FILE_DESC;
     }
@@ -401,7 +347,10 @@ static const wchar_t *file_get_desc(int lstat_res, const struct stat &lbuf, int
             if (S_ISDIR(buf.st_mode)) {
                 return COMPLETE_DIRECTORY_SYMLINK_DESC;
             }
-            if (buf.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH) && fast_waccess(buf, X_OK) == 0) {
+            if (buf.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH) && waccess(filename, X_OK) == 0) {
+                // Weird group permissions and other such issues make it non-trivial to find out if
+                // we can actually execute a file using the result from stat. It is much safer to
+                // use the access function, since it tells us exactly what we want to know.
                 return COMPLETE_EXEC_LINK_DESC;
             }
 
@@ -422,7 +371,10 @@ static const wchar_t *file_get_desc(int lstat_res, const struct stat &lbuf, int
         return COMPLETE_SOCKET_DESC;
     } else if (S_ISDIR(buf.st_mode)) {
         return COMPLETE_DIRECTORY_DESC;
-    } else if (buf.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH) && fast_waccess(buf, X_OK) == 0) {
+    } else if (buf.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH) && waccess(filename, X_OK) == 0) {
+        // Weird group permissions and other such issues make it non-trivial to find out if we can
+        // actually execute a file using the result from stat. It is much safer to use the access
+        // function, since it tells us exactly what we want to know.
         return COMPLETE_EXEC_DESC;
     }
 
@@ -477,7 +429,7 @@ static bool wildcard_test_flags_then_complete(const wcstring &filepath, const wc
         return false;
     }
 
-    if (executables_only && (!is_executable || fast_waccess(stat_buf, X_OK) != 0)) {
+    if (executables_only && (!is_executable || waccess(filepath, X_OK) != 0)) {
         return false;
     }
 
@@ -489,7 +441,7 @@ static bool wildcard_test_flags_then_complete(const wcstring &filepath, const wc
     // Compute the description.
     wcstring desc;
     if (expand_flags & expand_flag::gen_descriptions) {
-        desc = file_get_desc(lstat_res, lstat_buf, stat_res, stat_buf, stat_errno);
+        desc = file_get_desc(filepath, lstat_res, lstat_buf, stat_res, stat_buf, stat_errno);
 
         if (!is_directory && !is_executable && file_size >= 0) {
             if (!desc.empty()) desc.append(L", ");

From 495f6fecbd43c3ab421017425b3462a5ad457e53 Mon Sep 17 00:00:00 2001
From: Fabian Boehm <FHomborg@gmail.com>
Date: Sat, 1 Apr 2023 16:00:42 +0200
Subject: [PATCH 013/200] docs: Chapter on combining redirections

Fixes #5319

(cherry picked from commit d6717106567e82574bad7613f60a59332f614a69)
---
 doc_src/language.rst | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/doc_src/language.rst b/doc_src/language.rst
index be642e4e2..cc7bd2203 100644
--- a/doc_src/language.rst
+++ b/doc_src/language.rst
@@ -237,6 +237,37 @@ As a convenience, the pipe ``&|`` redirects both stdout and stderr to the same p
 
 .. [#] A "pager" here is a program that takes output and "paginates" it. ``less`` doesn't just do pages, it allows arbitrary scrolling (even back!).
 
+
+Combining pipes and redirections
+--------------------------------
+
+It is possible to use multiple redirections and a pipe at the same time. In that case, they are read in this order:
+
+1. First the pipe is set up.
+2. Then the redirections are evaluated from left-to-right.
+
+This is important when any redirections reference other file descriptors with the ``&N`` syntax. When you say ``>&2``, that will redirect stdout to where stderr is pointing to *at that time*.
+
+Consider this helper function::
+
+  # Just make a function that prints something to stdout and stderr
+  function print
+      echo out
+      echo err >&2
+  end
+
+Now let's see a few cases::
+
+  # Redirect both stderr and stdout to less
+  # (can also be spelt as `&|`)
+  print 2>&1 | less
+
+  # Show the "out" on stderr, silence the "err"
+  print >&2 2>/dev/null
+  
+  # Silence both
+  print >/dev/null 2>&1
+
 .. _syntax-job-control:
 
 Job control

From 2c460cd664a5b503ad4c505977f4cfacbef7b30b Mon Sep 17 00:00:00 2001
From: Fabian Boehm <FHomborg@gmail.com>
Date: Fri, 10 Feb 2023 20:55:37 +0100
Subject: [PATCH 014/200] completions/zfs: Check for zpool

This is an additional tool, and this function is executed on source
time so we'd spew errors.

(also remove an ineffective line - it's probably *nicer* with the
read, but that's not what's currently effectively doing anything)

(cherry picked from commit 85504ca694ae099f023ae0febb363238d9c64e8d)
---
 share/functions/__fish_is_zfs_feature_enabled.fish | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/share/functions/__fish_is_zfs_feature_enabled.fish b/share/functions/__fish_is_zfs_feature_enabled.fish
index 29e63a494..66a4bca8f 100644
--- a/share/functions/__fish_is_zfs_feature_enabled.fish
+++ b/share/functions/__fish_is_zfs_feature_enabled.fish
@@ -1,4 +1,6 @@
 function __fish_is_zfs_feature_enabled -a feature target -d "Returns 0 if the given ZFS feature is available or enabled for the given full-path target (zpool or dataset), or any target if none given"
+    type -q zpool
+    or return
     set -l pool (string replace -r '/.*' '' -- $target)
     set -l feature_name ""
     if test -z "$pool"
@@ -9,7 +11,6 @@ function __fish_is_zfs_feature_enabled -a feature target -d "Returns 0 if the gi
     if test $status -ne 0 # No such feature
         return 1
     end
-    echo $feature_name | read -l _ _ state _
     set -l state (echo $feature_name | cut -f3)
     string match -qr '(active|enabled)' -- $state
     return $status

From bb11800d53d792b1e832b64b794539c6d4545568 Mon Sep 17 00:00:00 2001
From: Marcin Wojnarowski <xmarcinmarcin@gmail.com>
Date: Tue, 4 Apr 2023 05:06:15 +0200
Subject: [PATCH 015/200] Fix adb path completion (#9707)

Support paths with spaces.

(cherry picked from commit 0f1ef34736ece2c2d2522f75140d98bc5d527096)
---
 share/completions/adb.fish | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/share/completions/adb.fish b/share/completions/adb.fish
index 34f2e7266..f093f69d6 100644
--- a/share/completions/adb.fish
+++ b/share/completions/adb.fish
@@ -74,7 +74,7 @@ function __fish_adb_list_files
     end
 
     # Return list of directories suffixed with '/'
-    __fish_adb_run_command find -H "$token*" -maxdepth 0 -type d 2\>/dev/null | awk '{print $1"/"}'
+    __fish_adb_run_command find -H "$token*" -maxdepth 0 -type d 2\>/dev/null | awk '{print $0"/"}'
     # Return list of files
     __fish_adb_run_command find -H "$token*" -maxdepth 0 -type f 2\>/dev/null
 end

From e643bd645cb997ca0874475cc303749dae92cf46 Mon Sep 17 00:00:00 2001
From: Miha Filej <miha@filej.net>
Date: Tue, 4 Apr 2023 14:41:11 +0200
Subject: [PATCH 016/200] completions/mix: Add options for phx.new in 1.7.2
 (#9706)

(cherry picked from commit b5bfff9cac7c99b51325d1d2f2c9b743a4fd73cc)
---
 share/completions/mix.fish | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/share/completions/mix.fish b/share/completions/mix.fish
index a8eb5baf1..16728f879 100644
--- a/share/completions/mix.fish
+++ b/share/completions/mix.fish
@@ -163,7 +163,7 @@ complete -f -c mix -n '__fish_mix_using_command phx.gen.schema' -l migration -d
 complete -f -c mix -n '__fish_mix_using_command phx.new' -l umbrella -d "Generate an umbrella project, with one application for your domain, and a second application for the web interface."
 complete -f -c mix -n '__fish_mix_using_command phx.new' -l app -d "The name of the OTP application"
 complete -f -c mix -n '__fish_mix_using_command phx.new' -l module -d "The name of the base module in the generated skeleton"
-complete -f -c mix -n '__fish_mix_using_command phx.new' -l database -d "Specify the database adapter for Ecto"
+complete -x -c mix -n '__fish_mix_using_command phx.new' -l database -a "postgres mysql mssql sqlite3" -d "Specify the database adapter for Ecto"
 complete -f -c mix -n '__fish_mix_using_command phx.new' -l no-assets -d "Do not generate the assets folder"
 complete -f -c mix -n '__fish_mix_using_command phx.new' -l no-ecto -d "Do not generate Ecto files"
 complete -f -c mix -n '__fish_mix_using_command phx.new' -l no-html -d "Do not generate HTML views"
@@ -171,6 +171,8 @@ complete -f -c mix -n '__fish_mix_using_command phx.new' -l no-gettext -d "Do no
 complete -f -c mix -n '__fish_mix_using_command phx.new' -l no-dashboard -d "Do not include Phoenix.LiveDashboard"
 complete -f -c mix -n '__fish_mix_using_command phx.new' -l no-live -d "Comment out LiveView socket setup in assets/js/app.js"
 complete -f -c mix -n '__fish_mix_using_command phx.new' -l no-mailer -d "Do not generate Swoosh mailer files"
+complete -f -c mix -n '__fish_mix_using_command phx.new' -l no-esbuild -d "Do not include esbuild dependencies and assets"
+complete -f -c mix -n '__fish_mix_using_command phx.new' -l no-tailwind -d "Do not include tailwind dependencies and assets"
 complete -f -c mix -n '__fish_mix_using_command phx.new' -l binary-id -d "Use binary_id as primary key type in Ecto schemas"
 complete -f -c mix -n '__fish_mix_using_command phx.new' -l verbose -d "Use verbose output"
 complete -f -c mix -n '__fish_mix_using_command phx.new' -s v -l version -d "Prints the Phoenix installer version"

From d49072eb0f6019a149f9e41caf7c02a61ac7a613 Mon Sep 17 00:00:00 2001
From: "Eric N. Vander Weele" <ericvw@gmail.com>
Date: Thu, 6 Apr 2023 23:48:56 -0400
Subject: [PATCH 017/200] docs/interactive: Document fish_color_history_current
 variable

All *.theme files set variables documented in the "Syntax highlighting
variables" section, and fish_color_history_current was missing.

(cherry picked from commit a6e16a11c22b6228bc292bfdd757e7e69710e879)
---
 doc_src/interactive.rst | 1 +
 1 file changed, 1 insertion(+)

diff --git a/doc_src/interactive.rst b/doc_src/interactive.rst
index db81d32ea..f13e1ff44 100644
--- a/doc_src/interactive.rst
+++ b/doc_src/interactive.rst
@@ -125,6 +125,7 @@ Variable                                          Meaning
 .. envvar:: fish_color_status                     the last command's nonzero exit code in the default prompt
 .. envvar:: fish_color_cancel                     the '^C' indicator on a canceled command
 .. envvar:: fish_color_search_match               history search matches and selected pager items (background only)
+.. envvar:: fish_color_history_current            the current position in the history for commands like ``dirh`` and ``cdh``
 
 ==========================================        =====================================================================
 

From cf535f0f7607f31823afe94e86775aff65da84fd Mon Sep 17 00:00:00 2001
From: Andy Hall <andy@ajhall.us>
Date: Sat, 8 Apr 2023 21:30:03 -0400
Subject: [PATCH 018/200] Fix typo in `set` docs

(cherry picked from commit 6ff971e4c24a1e5a53d3e4d223163eab356742e5)
---
 doc_src/cmds/set.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc_src/cmds/set.rst b/doc_src/cmds/set.rst
index 70a62379c..07dc21758 100644
--- a/doc_src/cmds/set.rst
+++ b/doc_src/cmds/set.rst
@@ -66,7 +66,7 @@ These options modify how variables operate:
     Treat specified variable as a :ref:`path variable <variables-path>`; variable will be split on colons (``:``) and will be displayed joined by colons colons when quoted (``echo "$PATH"``) or exported.
 
 **--unpath**
-     Causes variable to no longer be tred as a :ref:`path variable <variables-path>`.
+     Causes variable to no longer be treated as a :ref:`path variable <variables-path>`.
      Note: variables ending in "PATH" are automatically path variables.
 
 Further options:

From 5df36130b7b82607dd653ad05c2c6bc3707f22c7 Mon Sep 17 00:00:00 2001
From: "Eric N. Vander Weele" <ericvw@gmail.com>
Date: Fri, 7 Apr 2023 16:22:06 -0400
Subject: [PATCH 019/200] reader: Apply fish_color_selection fg color and
 options in vi visual mode

Vi visual mode selection highlighting behaves unexpectedly when the selection
foreground and background in the highlight spec don't match. The following
unexpected behaviors are:

*  The foreground color is not being applied when defined by the
   `fish_color_selection` variable.
* `set_color` options (e.g., `--bold`) would not be applied under the cursor
  when selection begins in the middle of the command line or when the cursor
  moves forward after visually selecting text backward.

With this change, visual selection respects the foreground color and any
`set_color` options are applied consistently regardless of where visual
selection begins and the position of the cursor during selection.

(cherry picked from commit 4ed53d4e3f8b4553a94dbd3b64c3e0bdd793cb0b)
---
 src/reader.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/reader.cpp b/src/reader.cpp
index ac4797ac7..8669ac111 100644
--- a/src/reader.cpp
+++ b/src/reader.cpp
@@ -1212,7 +1212,7 @@ void reader_data_t::paint_layout(const wchar_t *reason) {
 
     // Apply any selection.
     if (data.selection.has_value()) {
-        highlight_spec_t selection_color = {highlight_role_t::normal, highlight_role_t::selection};
+        highlight_spec_t selection_color = {highlight_role_t::selection, highlight_role_t::selection};
         auto end = std::min(selection->stop, colors.size());
         for (size_t i = data.selection->start; i < end; i++) {
             colors.at(i) = selection_color;

From a2bc5709ebf03f3dff6aafe6f27126cc12ea6a4c Mon Sep 17 00:00:00 2001
From: abp <2374887+Paiusco@users.noreply.github.com>
Date: Sat, 11 Feb 2023 21:38:07 +0100
Subject: [PATCH 020/200] completions: Shortened descriptions

- Mainly work is done on gcc
- Some duplicated removed elsewhere

(cherry picked from commit bbe2a2ba9b5400f637140ab1b501eb300a6372c7)
---
 share/completions/gcc.fish    | 347 +++++++++++++++++-----------------
 share/completions/rustup.fish |   1 -
 share/completions/tmux.fish   |   1 -
 3 files changed, 169 insertions(+), 180 deletions(-)

diff --git a/share/completions/gcc.fish b/share/completions/gcc.fish
index 414b27c2b..512a0d23f 100644
--- a/share/completions/gcc.fish
+++ b/share/completions/gcc.fish
@@ -99,7 +99,7 @@ complete -c gcc -o Wno-deprecated -d '(C++ only) Do not warn about usage of depr
 complete -c gcc -o Wstrict-null-sentinel -d '(C++ only) Warn also about the use of an uncasted "NULL" as sentinel'
 complete -c gcc -o Wno-non-template-friend -d '(C++ only) Disable warnings when non-templatized friend functions are declared within a template'
 complete -c gcc -o Wold-style-cast -d 'Warn if an C-style cast to a non-void type is used in a C++ program'
-complete -c gcc -o Woverloaded-virtual -d '(C++ only) Warn when a function declaration hides virtual functions from a base class'
+complete -c gcc -o Woverloaded-virtual -d '(C++ only) Warn when a function hides virtual functions from a base class'
 complete -c gcc -o Wno-pmf-conversions -d '(C++ only) Disable the diagnostic for converting a bound pointer to member function to a plain pointer'
 complete -c gcc -o Wsign-promo -d '(C++ only) Warn when overload resolution promotes from unsigned or enumerated type to a signed type'
 complete -c gcc -o fconstant-string-class -d 'Use class-name as the name of the class to instantiate for each literal string specified with the syntax "@"'
@@ -212,7 +212,7 @@ complete -c gcc -o Wvolatile-register-var -d 'Warn if a register variable is dec
 complete -c gcc -o Wdisabled-optimization -d 'Warn if a requested optimization pass is disabled'
 complete -c gcc -o Wpointer-sign -d 'Warn for pointer argument passing or assignment with different signedness'
 complete -c gcc -o Werror -d 'Make all warnings into errors'
-complete -c gcc -o Wstack-protector -d 'This option is only active when -fstack-protector is active'
+complete -c gcc -o Wstack-protector -d 'Only active when -fstack-protector is active'
 complete -c gcc -s g -d 'Produce debugging information in the operating system’s native format (stabs, COFF, XCOFF, or DWARF 2)'
 complete -c gcc -o ggdb -d 'Produce debugging information for use by GDB'
 complete -c gcc -o gstabs -d 'Produce debugging information in stabs format (if that is supported), without GDB extensions'
@@ -236,7 +236,7 @@ complete -c gcc -s Q -d 'Makes the compiler print out each function name as it i
 complete -c gcc -o ftime-report -d 'Makes the compiler print some statistics about the time consumed by each pass when it finishes'
 complete -c gcc -o fmem-report -d 'Makes the compiler print some statistics about permanent memory allocation when it finishes'
 complete -c gcc -o fprofile-arcs -d 'Add code so that program flow arcs are instrumented'
-complete -c gcc -l coverage -d 'This option is used to compile and link code instrumented for coverage analysis'
+complete -c gcc -l coverage -d 'Used to compile and link code instrumented for coverage analysis'
 complete -c gcc -o ftest-coverage -d 'Produce a notes file that the gcov code-coverage utility can use to show program coverage'
 complete -c gcc -o dletters -d 'Says to make debugging dumps during compilation at times specified by letters'
 complete -c gcc -o fdump-rtl-pass -d 'Says to make debugging dumps during compilation at times specified by letters'
@@ -248,8 +248,8 @@ complete -c gcc -o fdump-class-hierarchy-options -d '(C++ only) Dump a represent
 complete -c gcc -o fdump-ipa-switch -d 'Control the dumping at various stages of inter-procedural analysis language tree to a file'
 complete -c gcc -o fdump-tree-switch -d 'Control the dumping at various stages of processing the intermediate language tree to a file'
 complete -c gcc -o fdump-tree-switch-options -d 'Control the dumping at various stages of processing the intermediate language tree to a file'
-complete -c gcc -o ftree-vectorizer-verbose -d 'This option controls the amount of debugging output the vectorizer prints' -x -a "1 2 3 4 5"
-complete -c gcc -o frandom-seed -d 'This option provides a seed that GCC uses when it would otherwise use random numbers' -x
+complete -c gcc -o ftree-vectorizer-verbose -d 'Controls the amount of debugging output the vectorizer prints' -x -a "1 2 3 4 5"
+complete -c gcc -o frandom-seed -d 'Provides a seed that GCC uses when it would otherwise use random numbers' -x
 complete -c gcc -o fsched-verbose -d 'On targets that use instruction scheduling, this option controls the amount of debugging output the scheduler prints' -x -a "1 2 3 4 5"
 complete -c gcc -o save-temps -d 'Store the usual "temporary" intermediate files permanently; place them in the current directory and name them based on the source file'
 complete -c gcc -o time -d 'Report the CPU time taken by each subprocess in the compilation sequence'
@@ -261,7 +261,7 @@ complete -c gcc -o print-prog-name -r -d 'Like -print-file-name, but searches fo
 complete -c gcc -o print-libgcc-file-name -d 'Same as -print-file-name=libgcc'
 complete -c gcc -o print-search-dirs -d 'Print the name of the configured installation directory and a list of program and library directories gcc will search---and don’t do anything else'
 complete -c gcc -o dumpmachine -d 'Print the compiler’s target machine (for example, i686-pc-linux-gnu)---and don’t do anything else'
-complete -c gcc -o dumpversion -d 'Print the compiler version (for example, 3'
+complete -c gcc -o dumpversion -d 'Print the compiler version (for example, 3.0,6.3 or 7)---and don’t do anything else'
 complete -c gcc -o dumpspecs -d 'Print the compiler’s built-in specs---and don’t do anything else'
 complete -c gcc -o feliminate-unused-debug-types -d 'Normally, when producing DWARF2 output, GCC will emit debugging information for all types declared in a compilation unit, regardless of whether or not they are actually used in that compilation unit'
 complete -c gcc -o O2 -d 'Optimize even more'
@@ -298,13 +298,13 @@ complete -c gcc -o fcse-skip-blocks -d 'This is similar to -fcse-follow-jumps, b
 complete -c gcc -o frerun-cse-after-loop -d 'Re-run common subexpression elimination after loop optimizations has been performed'
 complete -c gcc -o frerun-loop-opt -d 'Run the loop optimizer twice'
 complete -c gcc -o fgcse -d 'Perform a global common subexpression elimination pass'
-complete -c gcc -o fgcse-lm -d 'When -fgcse-lm is enabled, global common subexpression elimination will attempt to move loads which are only killed by stores into themselves'
-complete -c gcc -o fgcse-sm -d 'When -fgcse-sm is enabled, a store motion pass is run after global common subexpression elimination'
-complete -c gcc -o fgcse-las -d 'When -fgcse-las is enabled, the global common subexpression elimination pass eliminates redundant loads that come after stores to the same memory location (both partial and full redundancies)'
+complete -c gcc -o fgcse-lm -d 'Global common subexpression elimination will attempt to move loads which are only killed by stores into themselves'
+complete -c gcc -o fgcse-sm -d 'A store motion pass is run after global common subexpression elimination'
+complete -c gcc -o fgcse-las -d 'The global common subexpression elimination pass eliminates redundant loads that come after stores to the same memory location (both partial and full redundancies)'
 complete -c gcc -o fgcse-after-reload -d 'When -fgcse-after-reload is enabled, a redundant load elimination pass is performed after reload'
 complete -c gcc -o floop-optimize -d 'Perform loop optimizations: move constant expressions out of loops, simplify exit test conditions and optionally do strength-reduction as well'
 complete -c gcc -o floop-optimize2 -d 'Perform loop optimizations using the new loop optimizer'
-complete -c gcc -o funsafe-loop-optimizations -d 'If given, the loop optimizer will assume that loop indices do not overflow, and that the loops with nontrivial exit condition are not infinite'
+complete -c gcc -o funsafe-loop-optimizations -d 'The loop optimizer will assume that loop indices do not overflow, and that the loops with nontrivial exit condition are not infinite'
 complete -c gcc -o fcrossjumping -d 'Perform cross-jumping transformation'
 complete -c gcc -o fif-conversion -d 'Attempt to transform conditional jumps into branch-less equivalents'
 complete -c gcc -o fif-conversion2 -d 'Use conditional execution (where available) to transform conditional jumps into branch-less equivalents'
@@ -334,13 +334,13 @@ complete -c gcc -o ftree-sink -d 'Perform forward store motion on trees'
 complete -c gcc -o ftree-ccp -d 'Perform sparse conditional constant propagation (CCP) on trees'
 complete -c gcc -o ftree-store-ccp -d 'Perform sparse conditional constant propagation (CCP) on trees'
 complete -c gcc -o ftree-dce -d 'Perform dead code elimination (DCE) on trees'
-complete -c gcc -o ftree-dominator-opts -d 'Perform a variety of simple scalar cleanups (constant/copy propagation, redundancy elimination, range propagation and expression simplification) based on a dominator tree traversal'
+complete -c gcc -o ftree-dominator-opts -d 'Perform a variety of simple scalar cleanups based on a dominator tree traversal'
 complete -c gcc -o ftree-ch -d 'Perform loop header copying on trees'
 complete -c gcc -o ftree-loop-optimize -d 'Perform loop optimizations on trees'
 complete -c gcc -o ftree-loop-linear -d 'Perform linear loop transformations on tree'
 complete -c gcc -o ftree-loop-im -d 'Perform loop invariant motion on trees'
 complete -c gcc -o ftree-loop-ivcanon -d 'Create a canonical counter for number of iterations in the loop for that determining number of iterations requires complicated analysis'
-complete -c gcc -o fivopts -d 'Perform induction variable optimizations (strength reduction, induction variable merging and induction variable elimination) on trees'
+complete -c gcc -o fivopts -d 'Perform induction variable optimizations on trees'
 complete -c gcc -o ftree-sra -d 'Perform scalar replacement of aggregates'
 complete -c gcc -o ftree-copyrename -d 'Perform copy renaming on trees'
 complete -c gcc -o ftree-ter -d 'Perform temporary expression replacement during the SSA->normal phase'
@@ -353,7 +353,7 @@ complete -c gcc -o funroll-loops -d 'Unroll loops whose number of iterations can
 complete -c gcc -o funroll-all-loops -d 'Unroll all loops, even if their number of iterations is uncertain when the loop is entered'
 complete -c gcc -o fsplit-ivs-in-unroller -d 'Enables expressing of values of induction variables in later iterations of the unrolled loop using the value in the first iteration'
 complete -c gcc -o fvariable-expansion-in-unroller -d 'With this option, the compiler will create multiple copies of some local variables when unrolling a loop which can result in superior code'
-complete -c gcc -o fprefetch-loop-arrays -d 'If supported by the target machine, generate instructions to prefetch memory to improve the performance of loops that access large arrays'
+complete -c gcc -o fprefetch-loop-arrays -d 'Generate instructions to prefetch memory to improve the performance of loops that access large arrays'
 complete -c gcc -o fno-peephole -d 'Disable any machine-specific peephole optimizations'
 complete -c gcc -o fno-peephole2 -d 'Disable any machine-specific peephole optimizations'
 complete -c gcc -o fno-guess-branch-probability -d 'Do not guess branch probabilities using heuristics'
@@ -372,21 +372,21 @@ complete -c gcc -o falign-jumps -d 'Align branch targets to a power-of-two bound
 complete -c gcc -o funit-at-a-time -d 'Parse the whole compilation unit before starting to produce code'
 complete -c gcc -o fweb -d 'Constructs webs as commonly used for register allocation purposes and assign each web individual pseudo register'
 complete -c gcc -o fwhole-program -d 'Assume that the current compilation unit represents whole program being compiled'
-complete -c gcc -o fno-cprop-registers -d 'After register allocation and post-register allocation instruction splitting, we perform a copy-propagation pass to try to reduce scheduling dependencies and occasionally eliminate the copy'
+complete -c gcc -o fno-cprop-registers -d 'After register allocation and post-register allocation instruction splitting, perform a copy-propagation pass to try to reduce scheduling dependencies and occasionally eliminate the copy'
 complete -c gcc -o fprofile-generate -d 'Enable options usually used for instrumenting application to produce profile useful for later recompilation with profile feedback based optimization'
 complete -c gcc -o fprofile-use -d 'Enable profile feedback directed optimizations, and optimizations generally profitable only with profile feedback available'
 complete -c gcc -o ffloat-store -d 'Do not store floating point variables in registers, and inhibit other options that might change whether a floating point value is taken from a register or memory'
 complete -c gcc -o ffast-math -d 'Sets -fno-math-errno, -funsafe-math-optimizations, -fno-trapping-math, -ffinite-math-only, -fno-rounding-math, -fno-signaling-nans and fcx-limited-range'
 complete -c gcc -o fno-math-errno -d 'Do not set ERRNO after calling math functions that are executed with a single instruction, e'
 complete -c gcc -o funsafe-math-optimizations -d 'Allow optimizations for floating-point arithmetic that (a) assume that arguments and results are valid and (b) may violate IEEE or ANSI standards'
-complete -c gcc -o ffinite-math-only -d 'Allow optimizations for floating-point arithmetic that assume that arguments and results are not NaNs or +-Infs'
+complete -c gcc -o ffinite-math-only -d 'Allow optimizations for floating-point arithmetic that assume arguments and results are not NaNs or +-Infs'
 complete -c gcc -o fno-trapping-math -d 'Compile code assuming that floating-point operations cannot generate user-visible traps'
 complete -c gcc -o frounding-math -d 'Disable transformations and optimizations that assume default floating point rounding behavior'
 complete -c gcc -o fsignaling-nans -d 'Compile code assuming that IEEE signaling NaNs may generate uservisible traps during floating-point operations'
 complete -c gcc -o fsingle-precision-constant -d 'Treat floating point constant as single precision constant instead of implicitly converting it to double precision constant'
-complete -c gcc -o fcx-limited-range -d 'When enabled, this option states that a range reduction step is not needed when performing complex division'
-complete -c gcc -o fno-cx-limited-range -d 'When enabled, this option states that a range reduction step is not needed when performing complex division'
-complete -c gcc -o fbranch-probabilities -d 'After running a program compiled with -fprofile-arcs, you can compile it a second time using -fbranch-probabilities, to improve optimizations based on the number of times each branch was taken'
+complete -c gcc -o fcx-limited-range -d 'When enabled, states that a range reduction step is not needed when performing complex division'
+complete -c gcc -o fno-cx-limited-range -d 'When enabled, states that a range reduction step is not needed when performing complex division'
+complete -c gcc -o fbranch-probabilities -d 'After running a program with -fprofile-arcs, one can compile it again with this option, to improve optimizations based on the number of times each branch was taken'
 complete -c gcc -o fprofile-values -d 'If combined with -fprofile-arcs, it adds code so that some data about values of expressions in the program is gathered'
 complete -c gcc -o fvpt -d 'If combined with -fprofile-arcs, it instructs the compiler to add a code to gather information about values of expressions'
 complete -c gcc -o frename-registers -d 'Attempt to avoid false dependencies in scheduled code by making use of registers left over after register allocation'
@@ -430,13 +430,13 @@ complete -c gcc -s M -d 'Instead of outputting the result of preprocessing, outp
 complete -c gcc -o MM -d 'Like -M but do not mention header files that are found in system header directories, nor header files that are included, directly or indirectly, from such a header'
 complete -c gcc -o MF -d 'When used with -M or -MM, specifies a file to write the dependencies to'
 complete -c gcc -o MG -d 'In conjunction with an option such as -M requesting dependency generation, -MG assumes missing header files are generated files and adds them to the dependency list without raising an error'
-complete -c gcc -o MP -d 'This option instructs CPP to add a phony target for each dependency other than the main file, causing each to depend on nothing'
+complete -c gcc -o MP -d 'Instructs CPP to add a phony target for each dependency other than the main file, causing each to depend on nothing'
 complete -c gcc -o MT -d 'Change the target of the rule emitted by dependency generation'
 complete -c gcc -o MQ -d 'Same as -MT, but it quotes any characters which are special to Make'
 complete -c gcc -o MD -d 'is equivalent to -M -MF file, except that -E is not implied'
 complete -c gcc -o MMD -d 'Like -MD except mention only user header files, not system header files'
 complete -c gcc -o fpch-deps -d 'When using precompiled headers, this flag will cause the dependency-output flags to also list the files from the precompiled header’s dependencies'
-complete -c gcc -o fpch-preprocess -d 'This option allows use of a precompiled header together with -E'
+complete -c gcc -o fpch-preprocess -d 'Allows use of a precompiled header together with -E'
 complete -c gcc -s x -d 'Specify the source language' -a 'c  c-header  cpp-output
 c++  c++-header  c++-cpp-output objective-c  objective-c-header  objective-c-cpp-output
 objective-c++ objective-c++-header objective-c++-cpp-output
@@ -450,11 +450,11 @@ complete -c gcc -o include -d 'Process file as if "#include "file"" appeared as
 complete -c gcc -o imacros -d 'Exactly like -include, except that any output produced by scanning file is thrown away'
 complete -c gcc -o idirafter -d 'Search dir for header files, but do it after all directories specified with -I and the standard system directories have been exhausted'
 complete -c gcc -o iprefix -d 'Specify prefix as the prefix for subsequent -iwithprefix options'
-complete -c gcc -o iwithprefix -d 'Append dir to the prefix specified previously with -iprefix, and add the resulting directory to the include search path'
-complete -c gcc -o iwithprefixbefore -d 'Append dir to the prefix specified previously with -iprefix, and add the resulting directory to the include search path'
-complete -c gcc -o isysroot -d 'This option is like the --sysroot option, but applies only to header files'
+complete -c gcc -o iwithprefix -d 'Append dir to prefix defined with -iprefix, and add the result to the include search path. Add to same place as -I'
+complete -c gcc -o iwithprefixbefore -d 'Append dir to prefix defined with -iprefix, and add the result to the include search path. Add to same place as -idirafter'
+complete -c gcc -o isysroot -d 'Like the --sysroot option, but only to header files'
 complete -c gcc -o isystem -d 'Search dir for header files, after all directories specified by -I but before the standard system directories'
-complete -c gcc -o iquote -d 'Search dir only for header files requested with "#include "file""; they are not searched for "#include <file>", before all directories specified by -I and before the standard system directories'
+complete -c gcc -o iquote -d 'Search dir only for header files requested with "#include "file""'
 complete -c gcc -o fdollars-in-identifiers -d 'Accept $ in identifiers'
 complete -c gcc -o fextended-identifiers -d 'Accept universal character names in identifiers'
 complete -c gcc -o fpreprocessed -d 'Indicate to the preprocessor that the input file has already been preprocessed'
@@ -500,13 +500,13 @@ complete -c gcc -o static-libgcc -d 'Force static libgcc'
 complete -c gcc -o symbolic -d 'Bind references to global symbols when building a shared object'
 complete -c gcc -o Xlinker -d 'Pass option as an option to the linker'
 complete -c gcc -s u -d 'Pretend the symbol symbol is undefined, to force linking of library modules to define it'
-complete -c gcc -o Idir -d 'Add the directory dir to the head of the list of directories to be searched for header files'
-complete -c gcc -o iquotedir -d 'Add the directory dir to the head of the list of directories to be searched for header files only for the case of #include "file"; they are not searched for #include <file>, otherwise just like -I'
-complete -c gcc -o L -d 'Add directory dir to the list of directories to be searched for -l'
-complete -c gcc -o B -d 'This option specifies where to find the executables, libraries, include files, and data files of the compiler itself'
-complete -c gcc -o specs -r -d 'Process file after the compiler reads in the standard specs file, in order to override the defaults that the gcc driver program uses when determining what switches to pass to cc1, cc1plus, as, ld, etc'
+complete -c gcc -o Idir -d 'Add dir to the head of the list of directories to be searched for header files'
+complete -c gcc -o iquotedir -d 'Add dir to the head of the list of directories to be searched for header files only for the case of #include "file"'
+complete -c gcc -o L -d 'Add dir to the list of directories to be searched for -l'
+complete -c gcc -o B -d 'Specifies where to find the executables, libraries, include files, and data files of the compiler itself'
+complete -c gcc -o specs -r -d 'Process file after the compiler reads in the standard specs file'
 complete -c gcc -l sysroot -x -a '(__fish_complete_directories)' -d 'Use dir as the logical root directory for headers and libraries'
-complete -c gcc -o I- -d 'This option has been deprecated'
+complete -c gcc -o I- -d 'Deprecated'
 complete -c gcc -s b -d 'The argument machine specifies the target machine for compilation'
 complete -c gcc -s V -d 'The argument version specifies which version of GCC to run'
 complete -c gcc -o EL -d 'Compile code for little endian mode'
@@ -523,7 +523,7 @@ complete -c gcc -o msoft-float -d 'Generate output containing library calls for
 complete -c gcc -o mfloat-abi -d 'Specifies which ABI to use for floating point values' -x
 complete -c gcc -o mlittle-endian -d 'Generate code for a processor running in little-endian mode'
 complete -c gcc -o mbig-endian -d 'Generate code for a processor running in big-endian mode; the default is to compile code for a little-endian processor'
-complete -c gcc -o mwords-little-endian -d 'This option only applies when generating code for big-endian processors'
+complete -c gcc -o mwords-little-endian -d 'Only applies when generating code for big-endian processors'
 complete -c gcc -o mcpu -d 'This specifies the name of the target ARM processor' -x
 complete -c gcc -o mtune -d 'Tune output for this cpu without restricting the instructions to it'
 complete -c gcc -o march -d 'This specifies the name of the target ARM architecture' -x
@@ -532,8 +532,8 @@ complete -c gcc -o mfpe -x -d 'This specifies what floating point hardware (or h
 complete -c gcc -o mfp -x -d 'This specifies what floating point hardware (or hardware emulation) is available on the target'
 complete -c gcc -o mstructure-size-boundary -x -d 'The size of all structures and unions will be rounded up to a multiple of the number of bits set by this option'
 complete -c gcc -o mabort-on-noreturn -d 'Generate a call to the function "abort" at the end of a "noreturn" function'
-complete -c gcc -o mlong-calls -d 'Tells the compiler to perform function calls by first loading the address of the function into a register and then performing a subroutine call on this register'
-complete -c gcc -o mno-long-calls -d 'Tells the compiler to perform function calls by first loading the address of the function into a register and then performing a subroutine call on this register'
+complete -c gcc -o mlong-calls -d 'Perform function calls by first loading the address of the function into a register and then performing a subroutine call on it'
+complete -c gcc -o mno-long-calls -d 'Do not perform function calls by first loading the address of the function into a register and then performing a subroutine call on it'
 complete -c gcc -o mnop-fun-dllimport -d 'Disable support for the "dllimport" attribute'
 complete -c gcc -o msingle-pic-base -d 'Treat the register used for PIC addressing as read-only, rather than loading it in the prologue for each function'
 complete -c gcc -o mpic-register -x -d 'Specify the register to be used for PIC addressing'
@@ -543,7 +543,7 @@ complete -c gcc -o mthumb -d 'Generate code for the 16-bit Thumb instruction set
 complete -c gcc -o mtpcs-frame -d 'Generate a stack frame that is compliant with the Thumb Procedure Call Standard for all non-leaf functions'
 complete -c gcc -o mtpcs-leaf-frame -d 'Generate a stack frame that is compliant with the Thumb Procedure Call Standard for all leaf functions'
 complete -c gcc -o mcallee-super-interworking -d 'Gives all externally visible functions in the file being compiled an ARM instruction set header which switches to Thumb mode before executing the rest of the function'
-complete -c gcc -o mcaller-super-interworking -d 'Allows calls via function pointers (including virtual functions) to execute correctly regardless of whether the target code has been compiled for interworking or not'
+complete -c gcc -o mcaller-super-interworking -d 'Allow calls via function pointers (including virtual functions) to execute correctly regardless of whether the target code has been compiled for interworking'
 complete -c gcc -o mtp -x -d 'Specify the access model for the thread local storage pointer'
 complete -c gcc -o mmcu -x -d 'Specify ATMEL AVR instruction set or MCU type'
 complete -c gcc -o msize -d 'Output instruction sizes to the asm file'
@@ -556,15 +556,15 @@ complete -c gcc -o mint8 -d 'Assume int to be 8 bit integer'
 complete -c gcc -o momit-leaf-frame-pointer -d 'Don’t keep the frame pointer in a register for leaf functions'
 complete -c gcc -o mspecld-anomaly -d 'When enabled, the compiler will ensure that the generated code does not contain speculative loads after jump instructions'
 complete -c gcc -o mno-specld-anomaly -d 'Don’t generate extra code to prevent speculative loads from occurring'
-complete -c gcc -o mcsync-anomaly -d 'When enabled, the compiler will ensure that the generated code does not contain CSYNC or SSYNC instructions too soon after conditional branches'
+complete -c gcc -o mcsync-anomaly -d 'Ensure that the generated code does not contain CSYNC or SSYNC instructions too soon after conditional branches'
 complete -c gcc -o mno-csync-anomaly -d 'Don’t generate extra code to prevent CSYNC or SSYNC instructions from occurring too soon after a conditional branch'
-complete -c gcc -o mlow-64k -d 'When enabled, the compiler is free to take advantage of the knowledge that the entire program fits into the low 64k of memory'
+complete -c gcc -o mlow-64k -d 'Compiler is free to take advantage of the knowledge that the entire program fits into the low 64k of memory'
 complete -c gcc -o mno-low-64k -d 'Assume that the program is arbitrarily large'
 complete -c gcc -o mid-shared-library -d 'Generate code that supports shared libraries via the library ID method'
 complete -c gcc -o mno-id-shared-library -d 'Generate code that doesn’t assume ID based shared libraries are being used'
 complete -c gcc -o mshared-library-id -x -d 'Specified the identification number of the ID based shared library being compiled'
-complete -c gcc -o mlong-calls -d 'Tells the compiler to perform function calls by first loading the address of the function into a register and then performing a subroutine call on this register'
-complete -c gcc -o mno-long-calls -d 'Tells the compiler to perform function calls by first loading the address of the function into a register and then performing a subroutine call on this register'
+complete -c gcc -o mlong-calls -d 'Perform function calls by first loading the address of the function into a register and then performing a subroutine call on it'
+complete -c gcc -o mno-long-calls -d 'Does not perform function calls by first loading the address of the function into a register and then performing a subroutine call on it'
 complete -c gcc -o march -d 'Generate code for the specified architecture'
 complete -c gcc -o mcpu -d 'Generate code for the specified architecture'
 complete -c gcc -o type -d 'Generate code for the specified architecture'
@@ -572,35 +572,35 @@ complete -c gcc -o mtune -d 'Tune to architecture-type everything applicable abo
 complete -c gcc -o type -d 'Tune to architecture-type everything applicable about the generated code, except for the ABI and the set of available instructions'
 complete -c gcc -o mmax-stack-frame -d '=n Warn when the stack frame of a function exceeds n bytes'
 complete -c gcc -o melinux-stacksize -d '=n Only available with the cris-axis-aout target'
-complete -c gcc -o metrax4 -d 'The options -metrax4 and -metrax100 are synonyms for -march=v3 and -march=v8 respectively'
-complete -c gcc -o metrax100 -d 'The options -metrax4 and -metrax100 are synonyms for -march=v3 and -march=v8 respectively'
+complete -c gcc -o metrax4 -d 'Synonym for -march=v3'
+complete -c gcc -o metrax100 -d 'Synonym for -march=v8'
 complete -c gcc -o mmul-bug-workaround -d 'Work around a bug in the "muls" and "mulu" instructions for CPU models where it applies'
 complete -c gcc -o mno-mul-bug-workaround -d 'Work around a bug in the "muls" and "mulu" instructions for CPU models where it applies'
 complete -c gcc -o mpdebug -d 'Enable CRIS-specific verbose debug-related information in the assembly code'
 complete -c gcc -o mcc-init -d 'Do not use condition-code results from previous instruction; always emit compare and test instructions before use of condition codes'
 complete -c gcc -o mno-side-effects -d 'Do not emit instructions with side-effects in addressing modes other than post-increment'
-complete -c gcc -o mstack-align -d 'These options (no-options) arranges (eliminate arrangements) for the stack-frame, individual data and constants to be aligned for the maximum single data access size for the chosen CPU model'
-complete -c gcc -o mno-stack-align -d 'These options (no-options) arranges (eliminate arrangements) for the stack-frame, individual data and constants to be aligned for the maximum single data access size for the chosen CPU model'
-complete -c gcc -o mdata-align -d 'These options (no-options) arranges (eliminate arrangements) for the stack-frame, individual data and constants to be aligned for the maximum single data access size for the chosen CPU model'
-complete -c gcc -o mno-data-align -d 'These options (no-options) arranges (eliminate arrangements) for the stack-frame, individual data and constants to be aligned for the maximum single data access size for the chosen CPU model'
-complete -c gcc -o mconst-align -d 'These options (no-options) arranges (eliminate arrangements) for the stack-frame, individual data and constants to be aligned for the maximum single data access size for the chosen CPU model'
-complete -c gcc -o mno-const-align -d 'These options (no-options) arranges (eliminate arrangements) for the stack-frame, individual data and constants to be aligned for the maximum single data access size for the chosen CPU model'
-complete -c gcc -o m32-bit -d 'Similar to the stack- data- and const-align options above, these options arrange for stack-frame, writable data and constants to all be 32-bit, 16-bit or 8-bit aligned'
-complete -c gcc -o m16-bit -d 'Similar to the stack- data- and const-align options above, these options arrange for stack-frame, writable data and constants to all be 32-bit, 16-bit or 8-bit aligned'
-complete -c gcc -o m8-bit -d 'Similar to the stack- data- and const-align options above, these options arrange for stack-frame, writable data and constants to all be 32-bit, 16-bit or 8-bit aligned'
+complete -c gcc -o mstack-align -d 'Arranges for the stack-frame to be aligned for the maximum single data access size for the chosen CPU model'
+complete -c gcc -o mno-stack-align -d 'Eliminate arrangements for the stack-frame to be aligned for the maximum single data access size for the chosen CPU model'
+complete -c gcc -o mdata-align -d 'Arranges for the individual data to be aligned for the maximum single data access size for the chosen CPU model'
+complete -c gcc -o mno-data-align -d 'Eliminate arrangements for the individual data to be aligned for the maximum single data access size for the chosen CPU model'
+complete -c gcc -o mconst-align -d 'Arranges for the constants to be aligned for the maximum single data access size for the chosen CPU model'
+complete -c gcc -o mno-const-align -d 'Eliminate arrangements for the constants to be aligned for the maximum single data access size for the chosen CPU model'
+complete -c gcc -o m32-bit -d 'Arrange for stack-frame, writable data and constants to all be 32-bit, 16-bit or 8-bit aligned'
+complete -c gcc -o m16-bit -d 'Arrange for stack-frame, writable data and constants to all be 32-bit, 16-bit or 8-bit aligned'
+complete -c gcc -o m8-bit -d 'Arrange for stack-frame, writable data and constants to all be 32-bit, 16-bit or 8-bit aligned'
 complete -c gcc -o mno-prologue-epilogue -d 'With -mno-prologue-epilogue, the normal function prologue and epilogue that sets up the stack-frame are omitted and no return instructions or return sequences are generated in the code'
 complete -c gcc -o mprologue-epilogue -d 'With -mno-prologue-epilogue, the normal function prologue and epilogue that sets up the stack-frame are omitted and no return instructions or return sequences are generated in the code'
-complete -c gcc -o mno-gotplt -d 'With -fpic and -fPIC, don’t generate (do generate) instruction sequences that load addresses for functions from the PLT part of the GOT rather than (traditional on other architectures) calls to the PLT'
-complete -c gcc -o mgotplt -d 'With -fpic and -fPIC, don’t generate (do generate) instruction sequences that load addresses for functions from the PLT part of the GOT rather than (traditional on other architectures) calls to the PLT'
-complete -c gcc -o maout -d 'Legacy no-op option only recognized with the cris-axis-aout target'
-complete -c gcc -o melf -d 'Legacy no-op option only recognized with the cris-axis-elf and cris-axis-linux-gnu targets'
+complete -c gcc -o mno-gotplt -d 'With -fpic and -fPIC, don’t generate instruction sequences that load addresses for functions from the PLT part of the GOT rather than (traditional on other architectures) calls to the PLT'
+complete -c gcc -o mgotplt -d 'With -fpic and -fPIC, generate instruction sequences that load addresses for functions from the PLT part of the GOT rather than (traditional on other architectures) calls to the PLT'
+complete -c gcc -o maout -d 'Legacy no-op flag only recognized with the cris-axis-aout target'
+complete -c gcc -o melf -d 'Legacy no-op flag only recognized with the cris-axis-elf and cris-axis-linux-gnu targets'
 complete -c gcc -o melinux -d 'Only recognized with the cris-axis-aout target, where it selects a GNU/linux-like multilib, include files and instruction set for -march=v8'
-complete -c gcc -o mlinux -d 'Legacy no-op option only recognized with the cris-axis-linux-gnu target'
-complete -c gcc -o sim -d 'This option, recognized for the cris-axis-aout and cris-axis-elf arranges to link with input-output functions from a simulator library'
+complete -c gcc -o mlinux -d 'Legacy no-op flag only recognized with the cris-axis-linux-gnu target'
+complete -c gcc -o sim -d 'When recognized for the cris-axis-aout and cris-axis-elf arranges to link with input-output functions from a simulator library'
 complete -c gcc -o sim2 -d 'Like -sim, but pass linker options to locate initialized data at 0x40000000 and zero-initialized data at 0x80000000'
 complete -c gcc -o mmac -d 'Enable the use of multiply-accumulate instructions'
 complete -c gcc -o mpush-args -d 'Push instructions will be used to pass outgoing arguments when functions are called'
-complete -c gcc -o Fdir -d 'Add the framework directory dir to the head of the list of directories to be searched for header files'
+complete -c gcc -o Fdir -d 'Add the framework dir to the list of directories to be searched for headers'
 complete -c gcc -o gused -d 'Emit debugging information for symbols that are used'
 complete -c gcc -o gfull -d 'Emit debugging information for all symbols and types'
 complete -c gcc -o mmacosx-version-min -d '=version The earliest version of MacOS X that this executable will run on is version'
@@ -612,8 +612,8 @@ complete -c gcc -o all_load -d 'Loads all members of static archive libraries'
 complete -c gcc -o arch_errors_fatal -d 'Cause the errors having to do with files that have the wrong architecture to be fatal'
 complete -c gcc -o bind_at_load -d 'Causes the output file to be marked such that the dynamic linker will bind all undefined references when the file is loaded or launched'
 complete -c gcc -o bundle -d 'Produce a Mach-o bundle format file'
-complete -c gcc -o bundle_loader -d 'This option specifies the executable that will be loading the build output file being linked'
-complete -c gcc -o dynamiclib -d 'When passed this option, GCC will produce a dynamic library instead of an executable when linking, using the Darwin libtool command'
+complete -c gcc -o bundle_loader -d 'Specifies the executable that will be loading the build output file being linked'
+complete -c gcc -o dynamiclib -d 'When enabled, GCC will produce a dynamic library instead of an executable when linking, using the Darwin libtool command'
 complete -c gcc -o force_cpusubtype_ALL -d 'This causes GCC’s output file to have the ALL subtype, instead of one controlled by the -mcpu or -march option'
 complete -c gcc -o allowable_client -d 'These options are passed to the Darwin linker'
 complete -c gcc -o client_name -d 'These options are passed to the Darwin linker'
@@ -686,7 +686,7 @@ complete -c gcc -o mode -d 'Selects the IEEE rounding mode'
 complete -c gcc -o mtrap-precision -d 'In the Alpha architecture, floating point traps are imprecise'
 complete -c gcc -o precision -d 'In the Alpha architecture, floating point traps are imprecise'
 complete -c gcc -o mieee-conformant -d 'This option marks the generated code as IEEE conformant'
-complete -c gcc -o mbuild-constants -d 'Normally GCC examines a 32- or 64-bit integer constant to see if it can construct it from smaller constants in two or three instructions'
+complete -c gcc -o mbuild-constants -d 'This option require to construct all integer constants using code (maximum is six)'
 complete -c gcc -o malpha-as -d 'Select whether to generate code to be assembled by the vendor-supplied assembler (-malpha-as) or by the GNU assembler -mgas'
 complete -c gcc -o mgas -d 'Select whether to generate code to be assembled by the vendor-supplied assembler (-malpha-as) or by the GNU assembler -mgas'
 complete -c gcc -o mbwx -d 'Indicate whether GCC should generate code to use the optional BWX, CIX, FIX and MAX instruction sets'
@@ -703,8 +703,8 @@ complete -c gcc -o mexplicit-relocs -d 'Older Alpha assemblers provided no way t
 complete -c gcc -o mno-explicit-relocs -d 'Older Alpha assemblers provided no way to generate symbol relocations except via assembler macros'
 complete -c gcc -o msmall-data -d 'When -mexplicit-relocs is in effect, static data is accessed via gp-relative relocations'
 complete -c gcc -o mlarge-data -d 'When -mexplicit-relocs is in effect, static data is accessed via gp-relative relocations'
-complete -c gcc -o msmall-text -d 'When -msmall-text is used, the compiler assumes that the code of the entire program (or shared library) fits in 4MB, and is thus reachable with a branch instruction'
-complete -c gcc -o mlarge-text -d 'When -msmall-text is used, the compiler assumes that the code of the entire program (or shared library) fits in 4MB, and is thus reachable with a branch instruction'
+complete -c gcc -o msmall-text -d 'Assumes that the code of the entire program (or shared library) fits in 4MB, and is thus reachable with a branch instruction'
+complete -c gcc -o mlarge-text -d 'Does not assume that the code of the entire program (or shared library) fits in 4MB, and is thus reachable with a branch instruction'
 complete -c gcc -o mcpu -d '=cpu_type Set the instruction set and instruction scheduling parameters for machine type cpu_type'
 complete -c gcc -o mtune -d '=cpu_type Set only the instruction scheduling parameters for machine type cpu_type'
 complete -c gcc -o mmemory-latency -d '=time Sets the latency the scheduler should assume for typical memory references as seen by the application'
@@ -809,8 +809,8 @@ complete -c gcc -o mno-ieee-fp -d 'Control whether or not the compiler uses IEEE
 complete -c gcc -o msoft-float -d 'Generate output containing library calls for floating point'
 complete -c gcc -o mno-fp-ret-in-387 -d 'Do not use the FPU registers for return values of functions'
 complete -c gcc -o mno-fancy-math-387 -d 'Some 387 emulators do not support the "sin", "cos" and "sqrt" instructions for the 387'
-complete -c gcc -o malign-double -d 'Control whether GCC aligns "double", "long double", and "long long" variables on a two word boundary or a one word boundary'
-complete -c gcc -o mno-align-double -d 'Control whether GCC aligns "double", "long double", and "long long" variables on a two word boundary or a one word boundary'
+complete -c gcc -o malign-double -d 'Aligns "double", "long double", and "long long" variables on a two word boundary'
+complete -c gcc -o mno-align-double -d 'Aligns "double", "long double", and "long long" variables on a one word boundary'
 complete -c gcc -o m96bit-long-double -d 'These switches control the size of "long double" type'
 complete -c gcc -o m128bit-long-double -d 'These switches control the size of "long double" type'
 complete -c gcc -o mmlarge-data-threshold -d '=number When -mcmodel=medium is specified, the data greater than threshold are placed in large data section'
@@ -834,7 +834,7 @@ complete -c gcc -o m3dnow -d 'These switches enable or disable the use of instru
 complete -c gcc -o mno-3dnow -d 'These switches enable or disable the use of instructions in the MMX, SSE, SSE2 or 3DNow! extended instruction sets'
 complete -c gcc -o mpush-args -d 'Use PUSH operations to store outgoing parameters'
 complete -c gcc -o mno-push-args -d 'Use PUSH operations to store outgoing parameters'
-complete -c gcc -o maccumulate-outgoing-args -d 'If enabled, the maximum amount of space required for outgoing arguments will be computed in the function prologue'
+complete -c gcc -o maccumulate-outgoing-args -d 'The maximum amount of space required for outgoing arguments will be computed in the function prologue'
 complete -c gcc -o mthreads -d 'Support thread-safe exception handling on Mingw32'
 complete -c gcc -o mno-align-stringops -d 'Do not align destination of inlined string operations'
 complete -c gcc -o minline-all-stringops -d 'By default GCC inlines string operations only when destination is known to be aligned at least to 4 byte boundary'
@@ -922,8 +922,8 @@ complete -c gcc -o mshort -d 'Consider type "int" to be 16 bits wide, like "shor
 complete -c gcc -o mnobitfield -d 'Do not use the bit-field instructions'
 complete -c gcc -o mbitfield -d 'Do use the bit-field instructions'
 complete -c gcc -o mrtd -d 'Use a different function-calling convention, in which functions that take a fixed number of arguments return with the "rtd" instruction, which pops their arguments while returning'
-complete -c gcc -o malign-int -d 'Control whether GCC aligns "int", "long", "long long", "float", "double", and "long double" variables on a 32-bit boundary (-malign-int) or a 16-bit boundary (-mno-align-int)'
-complete -c gcc -o mno-align-int -d 'Control whether GCC aligns "int", "long", "long long", "float", "double", and "long double" variables on a 32-bit boundary (-malign-int) or a 16-bit boundary (-mno-align-int)'
+complete -c gcc -o malign-int -d 'Make GCC align "int", "long", "long long", "float", "double", and "long double" variables on a 32-bit boundary'
+complete -c gcc -o mno-align-int -d 'Make GCC aligns "int", "long", "long long", "float", "double", and "long double" variables on 16-bit boundary'
 complete -c gcc -o mpcrel -d 'Use the pc-relative addressing mode of the 68000 directly, instead of using a global offset table'
 complete -c gcc -o mno-strict-align -d 'Do not (do) assume that unaligned memory references will be handled by the system'
 complete -c gcc -o mstrict-align -d 'Do not (do) assume that unaligned memory references will be handled by the system'
@@ -965,7 +965,7 @@ complete -c gcc -o m210 -d 'Generate code for the 210 processor'
 complete -c gcc -o m340 -d 'Generate code for the 210 processor'
 complete -c gcc -o EB -d 'Generate big-endian code'
 complete -c gcc -o EL -d 'Generate little-endian code'
-complete -c gcc -o march -d '=arch Generate code that will run on arch, which can be the name of a generic MIPS ISA, or the name of a particular processor'
+complete -c gcc -o march -d '=arch Generate code that will run on arch, which can be the name of a generic MIPS ISA, or the name of the processor'
 complete -c gcc -o mtune -d '=arch Optimize for arch'
 complete -c gcc -o mips1 -d 'Equivalent to -march=mips1'
 complete -c gcc -o mips2 -d 'Equivalent to -march=mips2'
@@ -974,12 +974,8 @@ complete -c gcc -o mips4 -d 'Equivalent to -march=mips4'
 complete -c gcc -o mips32 -d 'Equivalent to -march=mips32'
 complete -c gcc -o mips32r2 -d 'Equivalent to -march=mips32r2'
 complete -c gcc -o mips64 -d 'Equivalent to -march=mips64'
-complete -c gcc -o mips16 -d 'Generate (do not generate) MIPS16 code'
-complete -c gcc -o mno-mips16 -d 'Generate (do not generate) MIPS16 code'
-complete -c gcc -o mabi -d '=eabi Generate code for the given ABI'
-complete -c gcc -o mabi -d '=eabi Generate code for the given ABI'
-complete -c gcc -o mabi -d '=eabi Generate code for the given ABI'
-complete -c gcc -o mabi -d '=eabi Generate code for the given ABI'
+complete -c gcc -o mips16 -d 'Generate MIPS16 code'
+complete -c gcc -o mno-mips16 -d 'Do not generate MIPS16 code'
 complete -c gcc -o mabi -d '=eabi Generate code for the given ABI'
 complete -c gcc -o mabicalls -d 'Generate (do not generate) SVR4-style position-independent code'
 complete -c gcc -o mno-abicalls -d 'Generate (do not generate) SVR4-style position-independent code'
@@ -1001,11 +997,11 @@ complete -c gcc -o mips3d -d 'Use (do not use) the MIPS-3D ASE'
 complete -c gcc -o mno-mips3d -d 'Use (do not use) the MIPS-3D ASE'
 complete -c gcc -o mlong64 -d 'Force "long" types to be 64 bits wide'
 complete -c gcc -o mlong32 -d 'Force "long", "int", and pointer types to be 32 bits wide'
-complete -c gcc -o msym32 -d 'Assume (do not assume) that all symbols have 32-bit values, regardless of the selected ABI'
-complete -c gcc -o mno-sym32 -d 'Assume (do not assume) that all symbols have 32-bit values, regardless of the selected ABI'
-complete -c gcc -s G -d 'Put global and static items less than or equal to num bytes into the small data or bss section instead of the normal data or bss section'
-complete -c gcc -o membedded-data -d 'Allocate variables to the read-only data section first if possible, then next in the small data section if possible, otherwise in data'
-complete -c gcc -o mno-embedded-data -d 'Allocate variables to the read-only data section first if possible, then next in the small data section if possible, otherwise in data'
+complete -c gcc -o msym32 -d 'Assume that all symbols have 32-bit values, regardless of the selected ABI'
+complete -c gcc -o mno-sym32 -d 'Do not assume that all symbols have 32-bit values, regardless of the selected ABI'
+complete -c gcc -s G -d 'Put global and static items less than or equal to num bytes into the small data or bss section instead of the normal one'
+complete -c gcc -o membedded-data -d 'Allocate variables if possible to the read-only data section first, then in the small data section, otherwise in data'
+complete -c gcc -o mno-embedded-data -d 'Does not allocate variables if possible to the read-only data section first, then in the small data section, otherwise in data'
 complete -c gcc -o muninit-const-in-rodata -d 'Put uninitialized "const" variables in the read-only data section'
 complete -c gcc -o mno-uninit-const-in-rodata -d 'Put uninitialized "const" variables in the read-only data section'
 complete -c gcc -o msplit-addresses -d 'Enable (disable) use of the "%hi()" and "%lo()" assembler relocation operators'
@@ -1025,35 +1021,34 @@ complete -c gcc -o mno-mad -d 'Enable (disable) use of the "mad", "madu" and "mu
 complete -c gcc -o mfused-madd -d 'Enable (disable) use of the floating point multiply-accumulate instructions, when they are available'
 complete -c gcc -o mno-fused-madd -d 'Enable (disable) use of the floating point multiply-accumulate instructions, when they are available'
 complete -c gcc -o nocpp -d 'Tell the MIPS assembler to not run its preprocessor over user assembler files (with a '
-complete -c gcc -o mfix-r4000 -d 'Work around certain R4000 CPU errata: - A double-word or a variable shift may give an incorrect result if executed immediately after starting an integer division'
-complete -c gcc -o mno-fix-r4000 -d 'Work around certain R4000 CPU errata: - A double-word or a variable shift may give an incorrect result if executed immediately after starting an integer division'
-complete -c gcc -o mfix-r4400 -d 'Work around certain R4400 CPU errata: - A double-word or a variable shift may give an incorrect result if executed immediately after starting an integer division'
-complete -c gcc -o mno-fix-r4400 -d 'Work around certain R4400 CPU errata: - A double-word or a variable shift may give an incorrect result if executed immediately after starting an integer division'
-complete -c gcc -o mfix-vr4120 -d 'Work around certain VR4120 errata: - "dmultu" does not always produce the correct result'
-complete -c gcc -o mno-fix-vr4120 -d 'Work around certain VR4120 errata: - "dmultu" does not always produce the correct result'
+complete -c gcc -o mfix-r4000 -d 'Work around certain R4000 CPU errata'
+complete -c gcc -o mno-fix-r4000 -d 'Does not work around certain R4000 CPU errata'
+complete -c gcc -o mfix-r4400 -d 'Work around certain R4400 CPU errata'
+complete -c gcc -o mno-fix-r4400 -d 'Does not work around certain R4400 CPU errata'
+complete -c gcc -o mfix-vr4120 -d 'Work around certain VR4120 errata'
+complete -c gcc -o mno-fix-vr4120 -d 'Does not work around certain VR4120 errata'
 complete -c gcc -o mfix-vr4130 -d 'Work around the VR4130 "mflo"/"mfhi" errata'
 complete -c gcc -o mfix-sb1 -d 'Work around certain SB-1 CPU core errata'
-complete -c gcc -o mno-fix-sb1 -d 'Work around certain SB-1 CPU core errata'
-complete -c gcc -o mflush-func -d 'Specifies the function to call to flush the I and D caches, or to not call any such function'
-complete -c gcc -o mno-flush-func -d 'Specifies the function to call to flush the I and D caches, or to not call any such function'
-complete -c gcc -o mbranch-likely -d 'Enable or disable use of Branch Likely instructions, regardless of the default for the selected architecture'
-complete -c gcc -o mno-branch-likely -d 'Enable or disable use of Branch Likely instructions, regardless of the default for the selected architecture'
+complete -c gcc -o mno-fix-sb1 -d 'Does not work around certain SB-1 CPU core errata'
+complete -c gcc -o mflush-func -d 'Specifies the function to call to flush the I and D caches'
+complete -c gcc -o mno-flush-func -d 'Specifies to not call the function to flush the I and D caches'
+complete -c gcc -o mbranch-likely -d 'Enable use of Branch Likely instructions, regardless of the default for the selected architecture'
+complete -c gcc -o mno-branch-likely -d 'Disable use of Branch Likely instructions, regardless of the default for the selected architecture'
 complete -c gcc -o mfp-exceptions -d 'Specifies whether FP exceptions are enabled'
 complete -c gcc -o mno-fp-exceptions -d 'Specifies whether FP exceptions are enabled'
-complete -c gcc -o mvr4130-align -d 'The VR4130 pipeline is two-way superscalar, but can only issue two instructions together if the first one is 8-byte aligned'
-complete -c gcc -o mno-vr4130-align -d 'The VR4130 pipeline is two-way superscalar, but can only issue two instructions together if the first one is 8-byte aligned'
+complete -c gcc -o mvr4130-align -d 'VR4130 pipeline is two-way superscalar, but can only issue two instructions together if the first one is 8-byte aligned'
+complete -c gcc -o mno-vr4130-align -d 'VR4130 pipeline is two-way superscalar, but can only issue two instructions together if the first one is 8-byte aligned'
 complete -c gcc -o mlibfuncs -d 'Specify that intrinsic library functions are being compiled, passing all values in registers, no matter the size'
 complete -c gcc -o mno-libfuncs -d 'Specify that intrinsic library functions are being compiled, passing all values in registers, no matter the size'
 complete -c gcc -o mepsilon -d 'Generate floating-point comparison instructions that compare with respect to the "rE" epsilon register'
 complete -c gcc -o mno-epsilon -d 'Generate floating-point comparison instructions that compare with respect to the "rE" epsilon register'
 complete -c gcc -o mabi -d '=gnu Generate code that passes function parameters and return values that (in the called function) are seen as registers $0 and up, as opposed to the GNU ABI which uses global registers $231 and up'
-complete -c gcc -o mabi -d '=gnu Generate code that passes function parameters and return values that (in the called function) are seen as registers $0 and up, as opposed to the GNU ABI which uses global registers $231 and up'
-complete -c gcc -o mzero-extend -d 'When reading data from memory in sizes shorter than 64 bits, use (do not use) zero-extending load instructions by default, rather than sign-extending ones'
-complete -c gcc -o mno-zero-extend -d 'When reading data from memory in sizes shorter than 64 bits, use (do not use) zero-extending load instructions by default, rather than sign-extending ones'
+complete -c gcc -o mzero-extend -d 'When reading data from memory in sizes shorter than 64 bits, use zero-extending load instructions by default, rather than sign-extending ones'
+complete -c gcc -o mno-zero-extend -d 'When reading data from memory in sizes shorter than 64 bits, do not use zero-extending load instructions by default, rather than sign-extending ones'
 complete -c gcc -o mknuthdiv -d 'Make the result of a division yielding a remainder have the same sign as the divisor'
 complete -c gcc -o mno-knuthdiv -d 'Make the result of a division yielding a remainder have the same sign as the divisor'
-complete -c gcc -o mtoplevel-symbols -d 'Prepend (do not prepend) a : to all global symbols, so the assembly code can be used with the "PREFIX" assembly directive'
-complete -c gcc -o mno-toplevel-symbols -d 'Prepend (do not prepend) a : to all global symbols, so the assembly code can be used with the "PREFIX" assembly directive'
+complete -c gcc -o mtoplevel-symbols -d 'Prepend a : to all global symbols, so the assembly code can be used with the "PREFIX" assembly directive'
+complete -c gcc -o mno-toplevel-symbols -d 'Do not prepend a : to all global symbols, so the assembly code can be used with the "PREFIX" assembly directive'
 complete -c gcc -o melf -d 'Generate an executable in the ELF format, rather than the default mmo format used by the mmix simulator'
 complete -c gcc -o mbranch-predict -d 'Use (do not use) the probable-branch instructions, when static branch prediction indicates a probable branch'
 complete -c gcc -o mno-branch-predict -d 'Use (do not use) the probable-branch instructions, when static branch prediction indicates a probable branch'
@@ -1067,7 +1062,7 @@ complete -c gcc -o mam33 -d 'Generate code which uses features specific to the A
 complete -c gcc -o mno-am33 -d 'Do not generate code which uses features specific to the AM33 processor'
 complete -c gcc -o mreturn-pointer-on-d0 -d 'When generating a function which returns a pointer, return the pointer in both "a0" and "d0"'
 complete -c gcc -o mno-crt0 -d 'Do not link in the C run-time initialization object file'
-complete -c gcc -o mrelax -d 'Indicate to the linker that it should perform a relaxation optimization pass to shorten branches, calls and absolute memory addresses'
+complete -c gcc -o mrelax -d 'Tell the linker it should perform a relaxation optimization to shorten branches, calls and absolute memory addresses'
 complete -c gcc -o march -d 'Generate code that will run on cpu-type, which is the name of a system representing a certain processor type'
 complete -c gcc -o type -d 'Generate code that will run on cpu-type, which is the name of a system representing a certain processor type'
 complete -c gcc -o mbacc -d 'Use byte loads and stores when generating code'
@@ -1121,12 +1116,12 @@ complete -c gcc -o mmfpgpr -d 'GCC supports two related instruction set architec
 complete -c gcc -o mno-mfpgpr -d 'GCC supports two related instruction set architectures for the RS/6000 and PowerPC'
 complete -c gcc -o mnew-mnemonics -d 'Select which mnemonics to use in the generated assembler code'
 complete -c gcc -o mold-mnemonics -d 'Select which mnemonics to use in the generated assembler code'
-complete -c gcc -o mcpu -d '=cpu_type Set architecture type, register usage, choice of mnemonics, and instruction scheduling parameters for machine type cpu_type'
-complete -c gcc -o mtune -d '=cpu_type Set the instruction scheduling parameters for machine type cpu_type, but do not set the architecture type, register usage, or choice of mnemonics, as -mcpu=cpu_type would'
+complete -c gcc -o mcpu -d '=cpu_type Set architecture type, register usage, choice of mnemonics, and instruction scheduling parameters for type cpu_type'
+complete -c gcc -o mtune -d '=cpu_type Set the instruction scheduling parameters for cpu_type, but do not set the architecture type, register usage, or choice of mnemonics, as -mcpu=cpu_type'
 complete -c gcc -o mswdiv -d 'Generate code to compute division as reciprocal estimate and iterative refinement, creating opportunities for increased throughput'
-complete -c gcc -o mno-swdiv -d 'Generate code to compute division as reciprocal estimate and iterative refinement, creating opportunities for increased throughput'
-complete -c gcc -o maltivec -d 'Generate code that uses (does not use) AltiVec instructions, and also enable the use of built-in functions that allow more direct access to the AltiVec instruction set'
-complete -c gcc -o mno-altivec -d 'Generate code that uses (does not use) AltiVec instructions, and also enable the use of built-in functions that allow more direct access to the AltiVec instruction set'
+complete -c gcc -o mno-swdiv -d 'Do not generate code to compute division as reciprocal estimate and iterative refinement, creating opportunities for increased throughput'
+complete -c gcc -o maltivec -d 'Generate code that uses AltiVec instructions, and also enable the use of built-in functions that allow more direct access to the AltiVec instruction set'
+complete -c gcc -o mno-altivec -d 'Generate code that does not use AltiVec instructions, and also enable the use of built-in functions that allow more direct access to the AltiVec instruction set'
 complete -c gcc -o mvrsave -d 'Generate VRSAVE instructions when generating AltiVec code'
 complete -c gcc -o mno-vrsave -d 'Generate VRSAVE instructions when generating AltiVec code'
 complete -c gcc -o msecure-plt -d 'Generate code that allows ld and ld'
@@ -1136,9 +1131,8 @@ complete -c gcc -o mno-isel -d 'This switch enables or disables the generation o
 complete -c gcc -o misel -d '=yes/no This switch has been deprecated'
 complete -c gcc -o mspe -d 'This switch enables or disables the generation of SPE simd instructions'
 complete -c gcc -o mno-isel -d 'This switch enables or disables the generation of SPE simd instructions'
-complete -c gcc -o mspe -d '=yes/no This option has been deprecated'
-complete -c gcc -o mfloat-gprs -d 'This switch enables or disables the generation of floating point operations on the general purpose registers for architectures that support it'
-complete -c gcc -o mfloat-gprs -d 'This switch enables or disables the generation of floating point operations on the general purpose registers for architectures that support it'
+complete -c gcc -o mspe -d '=yes/no Deprecated'
+complete -c gcc -o mfloat-gprs -d 'This switch enables or disables the generation of floating point operations on the general purpose registers'
 complete -c gcc -o m32 -d 'Generate code for 32-bit or 64-bit environments of Darwin and SVR4 targets (including GNU/Linux)'
 complete -c gcc -o m64 -d 'Generate code for 32-bit or 64-bit environments of Darwin and SVR4 targets (including GNU/Linux)'
 complete -c gcc -o mfull-toc -d 'Modify generation of the TOC (Table Of Contents), which is created for every executable file'
@@ -1156,37 +1150,35 @@ complete -c gcc -o msoft-float -d 'Generate code that does not use (uses) the fl
 complete -c gcc -o mhard-float -d 'Generate code that does not use (uses) the floating-point register set'
 complete -c gcc -o mmultiple -d 'Generate code that uses (does not use) the load multiple word instructions and the store multiple word instructions'
 complete -c gcc -o mno-multiple -d 'Generate code that uses (does not use) the load multiple word instructions and the store multiple word instructions'
-complete -c gcc -o mstring -d 'Generate code that uses (does not use) the load string instructions and the store string word instructions to save multiple registers and do small block moves'
-complete -c gcc -o mno-string -d 'Generate code that uses (does not use) the load string instructions and the store string word instructions to save multiple registers and do small block moves'
-complete -c gcc -o mupdate -d 'Generate code that uses (does not use) the load or store instructions that update the base register to the address of the calculated memory location'
-complete -c gcc -o mno-update -d 'Generate code that uses (does not use) the load or store instructions that update the base register to the address of the calculated memory location'
+complete -c gcc -o mstring -d 'Generate code that uses the load string and store string word instructions to save registers and do small block moves'
+complete -c gcc -o mno-string -d 'Generate code that does not use the load string and store string word instructions to save registers and do small block moves'
+complete -c gcc -o mupdate -d 'Generate code that uses the load or store instructions that update the base register to the address of the calculated memory location'
+complete -c gcc -o mno-update -d 'Generate code that does not use the load or store instructions that update the base register to the address of the calculated memory location'
 complete -c gcc -o mfused-madd -d 'Generate code that uses (does not use) the floating point multiply and accumulate instructions'
 complete -c gcc -o mno-fused-madd -d 'Generate code that uses (does not use) the floating point multiply and accumulate instructions'
-complete -c gcc -o mno-bit-align -d 'On System V'
-complete -c gcc -o mbit-align -d 'On System V'
-complete -c gcc -o mno-strict-align -d 'On System V'
-complete -c gcc -o mstrict-align -d 'On System V'
-complete -c gcc -o mrelocatable -d 'On embedded PowerPC systems generate code that allows (does not allow) the program to be relocated to a different address at runtime'
-complete -c gcc -o mno-relocatable -d 'On embedded PowerPC systems generate code that allows (does not allow) the program to be relocated to a different address at runtime'
-complete -c gcc -o mrelocatable-lib -d 'On embedded PowerPC systems generate code that allows (does not allow) the program to be relocated to a different address at runtime'
-complete -c gcc -o mno-relocatable-lib -d 'On embedded PowerPC systems generate code that allows (does not allow) the program to be relocated to a different address at runtime'
-complete -c gcc -o mno-toc -d 'On System V'
-complete -c gcc -o mtoc -d 'On System V'
-complete -c gcc -o mlittle -d 'On System V'
-complete -c gcc -o mlittle-endian -d 'On System V'
-complete -c gcc -o mbig -d 'On System V'
-complete -c gcc -o mbig-endian -d 'On System V'
-complete -c gcc -o mdynamic-no-pic -d 'On Darwin and Mac OS X systems, compile code so that it is not relocatable, but that its external references are relocatable'
-complete -c gcc -o mprioritize-restricted-insns -d '=priority This option controls the priority that is assigned to dispatch-slot restricted instructions during the second scheduling pass'
-complete -c gcc -o msched-costly-dep -d '=dependence_type This option controls which dependences are considered costly by the target during instruction scheduling'
-complete -c gcc -o minsert-sched-nops -d '=scheme This option controls which nop insertion scheme will be used during the second scheduling pass'
-complete -c gcc -o mcall-sysv -d 'On System V'
+complete -c gcc -o mno-bit-align -d 'On System V.4 and embedded PowerPC do not force structures and unions that contain bit-fields to be aligned to the base type of the bit-field.'
+complete -c gcc -o mbit-align -d 'On System V.4 and embedded PowerPC do force structures and unions that contain bit-fields to be aligned to the base type of the bit-field'
+complete -c gcc -o mno-strict-align -d 'On System V.4 and embedded PowerPC do not assume that unaligned memory references are handled by the system'
+complete -c gcc -o mstrict-align -d 'On System V.4 and embedded PowerPC do assume that unaligned memory references are handled by the syste'
+complete -c gcc -o mrelocatable -d 'On embedded PowerPC generate code that allows the program to be relocated to a different address at runtime'
+complete -c gcc -o mno-relocatable -d 'On embedded PowerPC generate code that does not allow the program to be relocated to a different address at runtime'
+complete -c gcc -o mrelocatable-lib -d 'On embedded PowerPC generate code that allows the program to be relocated to a different address at runtime'
+complete -c gcc -o mno-relocatable-lib -d 'On embedded PowerPC generate code that does not allow the program to be relocated to a different address at runtime'
+complete -c gcc -o mno-toc -d 'On System V.4 and embedded PowerPC do not assume that register 2 contains a pointer to a global area pointing to the addresses used in the program'
+complete -c gcc -o mtoc -d 'On System V.4 and embedded PowerPC do assume that register 2 contains a pointer to a global area pointing to the addresses used in the program'
+complete -c gcc -o mlittle -d 'On System V.4 and embedded PowerPC compile code for the processor in little-endian mode'
+complete -c gcc -o mlittle-endian -d 'On System V.4 and embedded PowerPC compile code for the processor in little-endian mode'
+complete -c gcc -o mbig -d 'On System V.4 and embedded PowerPC compile code for the processor in big-endian mode'
+complete -c gcc -o mbig-endian -d 'On System V.4 and embedded PowerPC compile code for the processor in big-endian mode'
+complete -c gcc -o mdynamic-no-pic -d 'On Darwin and Mac OS X, compile code so that it is not relocatable, but that its external references are relocatable'
+complete -c gcc -o mprioritize-restricted-insns -d '=priority Controls the priority that is assigned to dispatch-slot restricted instructions during the second scheduling pass'
+complete -c gcc -o msched-costly-dep -d '=dependence_type Controls which dependences are considered costly by the target during instruction scheduling'
+complete -c gcc -o minsert-sched-nops -d '=scheme Controls which nop insertion scheme will be used during the second scheduling pass'
+complete -c gcc -o mcall-sysv -d 'Specify both -mcall-sysv and -meabi options'
 complete -c gcc -o mcall-sysv-eabi -d 'Specify both -mcall-sysv and -meabi options'
 complete -c gcc -o mcall-sysv-noeabi -d 'Specify both -mcall-sysv and -mno-eabi options'
-complete -c gcc -o mcall-solaris -d 'On System V'
-complete -c gcc -o mcall-linux -d 'On System V'
-complete -c gcc -o mcall-gnu -d 'On System V'
-complete -c gcc -o mcall-netbsd -d 'On System V'
+complete -c gcc -o mcall-linux -d 'On System V.4 and embedded PowerPC compile code for the Linux-based GNU system'
+complete -c gcc -o mcall-netbsd -d 'On System V.4 and embedded PowerPC compile code for the NetBSD operating system'
 complete -c gcc -o maix-struct-return -d 'Return all structures in memory (as specified by the AIX ABI)'
 complete -c gcc -o msvr4-struct-return -d 'Return structures smaller than 8 bytes in registers (as specified by the SVR4 ABI)'
 complete -c gcc -o mabi -d 'Extend the current ABI with a particular extension, or remove such extension'
@@ -1196,27 +1188,26 @@ complete -c gcc -o mabi -d 'Disable Booke SPE ABI extensions for the current ABI
 complete -c gcc -o spe -d 'Disable Booke SPE ABI extensions for the current ABI'
 complete -c gcc -o mabi -d '=ibmlongdouble Change the current ABI to use IBM extended precision long double'
 complete -c gcc -o mabi -d '=ieeelongdouble Change the current ABI to use IEEE extended precision long double'
-complete -c gcc -o mprototype -d 'On System V'
-complete -c gcc -o mno-prototype -d 'On System V'
+complete -c gcc -o mprototype -d 'On System V.4 and embedded PowerPC assume that all calls to variable argument functions are properly prototyped'
+complete -c gcc -o mno-prototype -d 'On System V.4 and embedded PowerPC does not assume that all calls to variable argument functions are properly prototyped'
 complete -c gcc -o msim -d 'On embedded PowerPC systems, assume that the startup module is called sim-crt0'
 complete -c gcc -o mmvme -d 'On embedded PowerPC systems, assume that the startup module is called crt0'
 complete -c gcc -o mads -d 'On embedded PowerPC systems, assume that the startup module is called crt0'
 complete -c gcc -o myellowknife -d 'On embedded PowerPC systems, assume that the startup module is called crt0'
-complete -c gcc -o mvxworks -d 'On System V'
+complete -c gcc -o mvxworks -d 'On System V.4 and embedded PowerPC, specify that you are compiling for a VxWorks system'
 complete -c gcc -o mwindiss -d 'Specify that you are compiling for the WindISS simulation environment'
 complete -c gcc -o memb -d 'On embedded PowerPC systems, set the PPC_EMB bit in the ELF flags header to indicate that eabi extended relocations are used'
-complete -c gcc -o meabi -d 'On System V'
-complete -c gcc -o mno-eabi -d 'On System V'
-complete -c gcc -o msdata -d '=eabi On System V'
-complete -c gcc -o msdata -d '=sysv On System V'
-complete -c gcc -o msdata -d 'On System V'
-complete -c gcc -o msdata -d 'On System V'
-complete -c gcc -o msdata-data -d 'On System V'
-complete -c gcc -o msdata -d 'On embedded PowerPC systems, put all initialized global and static data in the '
-complete -c gcc -o mno-sdata -d 'On embedded PowerPC systems, put all initialized global and static data in the '
-complete -c gcc -s G -d 'On embedded PowerPC systems, put global and static items less than or equal to num bytes into the small data or bss sections instead of the normal data or bss section'
-complete -c gcc -o mregnames -d 'On System V'
-complete -c gcc -o mno-regnames -d 'On System V'
+complete -c gcc -o meabi -d 'On System V.4 and embedded PowerPC do adhere to the Embedded Applications Binary Interface (EABI), which is a set of modifications to the System V.4 specs'
+complete -c gcc -o mno-eabi -d 'On System V.4 and embedded PowerPC do not adhere to the Embedded Applications Binary Interface (EABI), which is a set of modifications to the System V.4 specifications'
+complete -c gcc -o msdata -d '=eabi On System V.4 and embedded PowerPC, put small initialized const global and static data in the .sdata2, which is pointed to by register r2. Put small initialized non-const global and static data in the .sdata, which is pointed to by register r13. Put small uninitialized global and static data in the .sbss, which is adjacent to the .sdata. This option is incompatible with -mrelocatable and sets -memb'
+complete -c gcc -o msdata -d '=sysv On System V.4 and embedded PowerPC, put small global and static data in the .sdata, which is pointed to by register r13. Put small uninitialized global and static data in the .sbss, which is adjacent to the .sdata. This option is incompatible with -mrelocatable'
+complete -c gcc -o msdata -d '=default On System V.4 and embedded PowerPC, if -meabi is used, compile code the same as -msdata=eabi, otherwise same as -msdata=sysv'
+complete -c gcc -o msdata -d '=data On System V.4 and embedded PowerPC, put small global data in the .sdata section. Put small uninitialized global data in the .sbss section. Do not use register r13 to address small data. Default behavior unless other -msdata options are used'
+complete -c gcc -o msdata -d 'Enable optimizations that use the small data section. This may be useful for working around optimizer bugs'
+complete -c gcc -o mno-sdata -d 'Disable optimizations that use the small data section. This may be useful for working around optimizer bugs'
+complete -c gcc -s G -d 'On embedded PowerPC, put global and static items less than or equal to num bytes into the small data or bss sections instead of the normal'
+complete -c gcc -o mregnames -d 'On System V.4 and embedded PowerPC do emit register names in the assembly language output using symbolic forms'
+complete -c gcc -o mno-regnames -d 'On System V.4 and embedded PowerPC do not emit register names in the assembly language output using symbolic forms'
 complete -c gcc -o mlongcall -d 'Default to making all function calls indirectly, using a register, so that functions which reside further than 32 megabytes (33,554,432 bytes) from the current location can be called'
 complete -c gcc -o mno-longcall -d 'Default to making all function calls indirectly, using a register, so that functions which reside further than 32 megabytes (33,554,432 bytes) from the current location can be called'
 complete -c gcc -o pthread -d 'Adds support for multithreading with the pthreads library'
@@ -1277,7 +1268,7 @@ complete -c gcc -o mno-renesas -d 'Comply with the calling conventions defined f
 complete -c gcc -o mnomacsave -d 'Mark the "MAC" register as call-clobbered, even if -mhitachi is given'
 complete -c gcc -o mieee -d 'Increase IEEE-compliance of floating-point code'
 complete -c gcc -o misize -d 'Dump instruction size and location in the assembly code'
-complete -c gcc -o mpadstruct -d 'This option is deprecated'
+complete -c gcc -o mpadstruct -d 'Deprecated'
 complete -c gcc -o mspace -d 'Optimize for space instead of speed'
 complete -c gcc -o mprefergot -d 'When generating position-independent code, emit function calls using the Global Offset Table instead of the Procedure Linkage Table'
 complete -c gcc -o musermode -d 'Generate a library function call to invalidate instruction cache entries, after fixing up a trampoline'
@@ -1289,8 +1280,8 @@ complete -c gcc -o mindexed-addressing -d 'Enable the use of the indexed address
 complete -c gcc -o mgettrcost -d '=number Set the cost assumed for the gettr instruction to number'
 complete -c gcc -o mpt-fixed -d 'Assume pt* instructions won’t trap'
 complete -c gcc -o minvalid-symbols -d 'Assume symbols might be invalid'
-complete -c gcc -o mno-app-regs -d 'Specify -mapp-regs to generate output using the global registers 2 through 4, which the SPARC SVR4 ABI reserves for applications'
-complete -c gcc -o mapp-regs -d 'Specify -mapp-regs to generate output using the global registers 2 through 4, which the SPARC SVR4 ABI reserves for applications'
+complete -c gcc -o mapp-regs -d 'Generate output using the global registers 2 through 4, which the SPARC SVR4 ABI reserves for applications'
+complete -c gcc -o mno-app-regs -d 'Does not generate output using the global registers 2 through 4, which the SPARC SVR4 ABI reserves for applications'
 complete -c gcc -o mfpu -d 'Generate output containing floating point instructions'
 complete -c gcc -o mhard-float -d 'Generate output containing floating point instructions'
 complete -c gcc -o mno-fpu -d 'Generate output containing library calls for floating point'
@@ -1299,11 +1290,11 @@ complete -c gcc -o mhard-quad-float -d 'Generate output containing quad-word (lo
 complete -c gcc -o msoft-quad-float -d 'Generate output containing library calls for quad-word (long double) floating point instructions'
 complete -c gcc -o mno-unaligned-doubles -d 'Assume that doubles have 8 byte alignment'
 complete -c gcc -o munaligned-doubles -d 'Assume that doubles have 8 byte alignment'
-complete -c gcc -o mno-faster-structs -d 'With -mfaster-structs, the compiler assumes that structures should have 8 byte alignment'
-complete -c gcc -o mfaster-structs -d 'With -mfaster-structs, the compiler assumes that structures should have 8 byte alignment'
-complete -c gcc -o mimpure-text -d '-mimpure-text, used in addition to -shared, tells the compiler to not pass -z text to the linker when linking a shared object'
+complete -c gcc -o mfaster-structs -d 'Assumes that structures should have 8 byte alignment'
+complete -c gcc -o mno-faster-structs -d 'Does not assume that structures should have 8 byte alignment'
+complete -c gcc -o mimpure-text -d 'Used in addition to -shared, tells to not pass -z text to the linker when linking a shared object'
 complete -c gcc -o mcpu -d '=cpu_type Set the instruction set, register set, and instruction scheduling parameters for machine type cpu_type'
-complete -c gcc -o mtune -d '=cpu_type Set the instruction scheduling parameters for machine type cpu_type, but do not set the instruction set or register set that the option -mcpu=cpu_type would'
+complete -c gcc -o mtune -d '=cpu_type Set the instruction scheduling parameters for cpu_type, but do not set the instruction set or register set that the option -mcpu=cpu_type would'
 complete -c gcc -o mv8plus -d 'With -mv8plus, GCC generates code for the SPARC-V8+ ABI'
 complete -c gcc -o mno-v8plus -d 'With -mv8plus, GCC generates code for the SPARC-V8+ ABI'
 complete -c gcc -o mvis -d 'With -mvis, GCC generates code that takes advantage of the UltraSPARC Visual Instruction Set extensions'
@@ -1323,7 +1314,7 @@ complete -c gcc -o pthread -d 'This is a synonym for -pthreads'
 complete -c gcc -s G -d 'Create a shared object'
 complete -c gcc -o Qy -d 'Identify the versions of each tool used by the compiler, in a "'
 complete -c gcc -o Qn -d 'Refrain from adding "'
-complete -c gcc -o mcpu -d '=cpu_type Set the instruction set, register set, and instruction scheduling parameters for machine type cpu_type'
+complete -c gcc -o mcpu -d '=cpu_type Set the instruction set, register set, and instruction scheduling parameters for cpu_type'
 complete -c gcc -o mbig-memory -d 'Generates code for the big or small memory model'
 complete -c gcc -o mbig -d 'Generates code for the big or small memory model'
 complete -c gcc -o msmall-memory -d 'Generates code for the big or small memory model'
@@ -1353,8 +1344,8 @@ complete -c gcc -o mparallel-mpy -d 'Allow the generation of MPY││ADD and MP
 complete -c gcc -o mno-parallel-mpy -d 'Allow the generation of MPY││ADD and MPY││SUB parallel instructions, provided -mparallel-insns is also specified'
 complete -c gcc -o mlong-calls -d 'Treat all calls as being far away (near)'
 complete -c gcc -o mno-long-calls -d 'Treat all calls as being far away (near)'
-complete -c gcc -o mno-ep -d 'Do not optimize (do optimize) basic blocks that use the same index pointer 4 or more times to copy pointer into the "ep" register, and use the shorter "sld" and "sst" instructions'
-complete -c gcc -o mep -d 'Do not optimize (do optimize) basic blocks that use the same index pointer 4 or more times to copy pointer into the "ep" register, and use the shorter "sld" and "sst" instructions'
+complete -c gcc -o mep -d 'Optimize basic blocks that use the same index pointer 4 or more times to copy pointer into the "ep" register, and use the shorter "sld" and "sst" instructions'
+complete -c gcc -o mno-ep -d 'Do not optimize basic blocks that use the same index pointer 4 or more times to copy pointer into the "ep" register, and use the shorter "sld" and "sst" instructions'
 complete -c gcc -o mno-prolog-function -d 'Do not use (do use) external functions to save and restore registers at the prologue and epilogue of a function'
 complete -c gcc -o mprolog-function -d 'Do not use (do use) external functions to save and restore registers at the prologue and epilogue of a function'
 complete -c gcc -o mspace -d 'Try to make the code as small as possible'
@@ -1363,12 +1354,12 @@ complete -c gcc -o msda -d '=n Put static or global variables whose size is n by
 complete -c gcc -o mzda -d '=n Put static or global variables whose size is n bytes or less into the first 32 kilobytes of memory'
 complete -c gcc -o mv850 -d 'Specify that the target processor is the V850'
 complete -c gcc -o mbig-switch -d 'Generate code suitable for big switch tables'
-complete -c gcc -o mapp-regs -d 'This option will cause r2 and r5 to be used in the code generated by the compiler'
-complete -c gcc -o mno-app-regs -d 'This option will cause r2 and r5 to be treated as fixed registers'
+complete -c gcc -o mapp-regs -d 'Will cause r2 and r5 to be used in the code generated by the compiler'
+complete -c gcc -o mno-app-regs -d 'Will cause r2 and r5 to be treated as fixed registers'
 complete -c gcc -o mv850e1 -d 'Specify that the target processor is the V850E1'
 complete -c gcc -o mv850e -d 'Specify that the target processor is the V850E'
-complete -c gcc -o mdisable-callt -d 'This option will suppress generation of the CALLT instruction for the v850e and v850e1 flavors of the v850 architecture'
-complete -c gcc -o munix -d 'Do not output certain jump instructions ("aobleq" and so on) that the Unix assembler for the VAX cannot handle across long ranges'
+complete -c gcc -o mdisable-callt -d 'Will suppress generation of the CALLT instruction for the v850e and v850e1 flavors of the v850 architecture'
+complete -c gcc -o munix -d 'Do not output certain jump instructions (i.e. "aobleq") the Unix assembler for the VAX cannot handle across long ranges'
 complete -c gcc -o mgnu -d 'Do output those jump instructions, on the assumption that you will assemble with the GNU assembler'
 complete -c gcc -o mg -d 'Output code for g-format floating point numbers instead of d-format'
 complete -c gcc -o msim -d 'Choose startup files and linker script suitable for the simulator'
@@ -1378,31 +1369,31 @@ complete -c gcc -o mfused-madd -d 'Enable or disable use of fused multiply/add a
 complete -c gcc -o mno-fused-madd -d 'Enable or disable use of fused multiply/add and multiply/subtract instructions in the floating-point option'
 complete -c gcc -o mtext-section-literals -d 'Control the treatment of literal pools'
 complete -c gcc -o mno-text-section-literals -d 'Control the treatment of literal pools'
-complete -c gcc -o mtarget-align -d 'When this option is enabled, GCC instructs the assembler to automatically align instructions to reduce branch penalties at the expense of some code density'
-complete -c gcc -o mno-target-align -d 'When this option is enabled, GCC instructs the assembler to automatically align instructions to reduce branch penalties at the expense of some code density'
-complete -c gcc -o mlongcalls -d 'When this option is enabled, GCC instructs the assembler to translate direct calls to indirect calls unless it can determine that the target of a direct call is in the range allowed by the call instruction'
-complete -c gcc -o mno-longcalls -d 'When this option is enabled, GCC instructs the assembler to translate direct calls to indirect calls unless it can determine that the target of a direct call is in the range allowed by the call instruction'
-complete -c gcc -o fbounds-check -d 'For front-ends that support it, generate additional code to check that indices used to access arrays are within the declared range'
-complete -c gcc -o ftrapv -d 'This option generates traps for signed overflow on addition, subtraction, multiplication operations'
-complete -c gcc -o fwrapv -d 'This option instructs the compiler to assume that signed arithmetic overflow of addition, subtraction and multiplication wraps around using twos-complement representation'
+complete -c gcc -o mtarget-align -d 'Instructs the assembler to automatically align instructions to reduce branch penalties at the expense of some code density'
+complete -c gcc -o mno-target-align -d 'Instructs the assembler to not automatically align instructions to reduce branch penalties at the expense of some code density'
+complete -c gcc -o mlongcalls -d 'Tell assembler to translate direct calls to indirect calls'
+complete -c gcc -o mno-longcalls -d 'Tell assembler to not translate direct calls to indirect calls'
+complete -c gcc -o fbounds-check -d 'Generate additional code to check that indices used to access arrays are within the declared range'
+complete -c gcc -o ftrapv -d 'Generates traps for signed overflow on addition, subtraction, multiplication operations'
+complete -c gcc -o fwrapv -d 'Assume that signed arithmetic overflow of addition, subtraction and multiplication wraps around using twos-complement representation'
 complete -c gcc -o fexceptions -d 'Enable exception handling'
 complete -c gcc -o fnon-call-exceptions -d 'Generate code that allows trapping instructions to throw exceptions'
-complete -c gcc -o funwind-tables -d 'Similar to -fexceptions, except that it will just generate any needed static data, but will not affect the generated code in any other way'
-complete -c gcc -o fasynchronous-unwind-tables -d 'Generate unwind table in dwarf2 format, if supported by target machine'
+complete -c gcc -o funwind-tables -d 'Similar to -fexceptions, except that it will just generate any needed static data, but will not affect in any other way'
+complete -c gcc -o fasynchronous-unwind-tables -d 'Generate unwind table in dwarf2 format'
 complete -c gcc -o fpcc-struct-return -d 'Return "short" "struct" and "union" values in memory like longer ones, rather than in registers'
 complete -c gcc -o freg-struct-return -d 'Return "struct" and "union" values in registers when possible'
 complete -c gcc -o fshort-enums -d 'Allocate to an "enum" type only as many bytes as it needs for the declared range of possible values'
 complete -c gcc -o fshort-double -d 'Use the same size for "double" as for "float"'
 complete -c gcc -o fshort-wchar -d 'Override the underlying type for wchar_t to be short unsigned int instead of the default for the target'
 complete -c gcc -o fshared-data -d 'Requests that the data and non-"const" variables of this compilation be shared data rather than private data'
-complete -c gcc -o fno-common -d 'In C, allocate even uninitialized global variables in the data section of the object file, rather than generating them as common blocks'
+complete -c gcc -o fno-common -d 'In C, allocate even uninitialized global variables in the data section of the object file, rather than as common blocks'
 complete -c gcc -o fno-ident -d 'Ignore the #ident directive'
 complete -c gcc -o finhibit-size-directive -d 'Don’t output a "'
 complete -c gcc -o fverbose-asm -d 'Put extra commentary information in the generated assembly code to make it more readable'
 complete -c gcc -o fpic -d 'Generate position-independent code (PIC) suitable for use in a shared library, if supported for the target machine'
-complete -c gcc -o fPIC -d 'If supported for the target machine, emit position-independent code, suitable for dynamic linking and avoiding any limit on the size of the global offset table'
-complete -c gcc -o fpie -d 'These options are similar to -fpic and -fPIC, but generated position independent code can be only linked into executables'
-complete -c gcc -o fPIE -d 'These options are similar to -fpic and -fPIC, but generated position independent code can be only linked into executables'
+complete -c gcc -o fPIC -d 'Emit position-independent code, suitable for dynamic linking and avoiding any limit on the size of the global offset table'
+complete -c gcc -o fpie -d 'Similar to -fpic and -fPIC, but generated position independent code can be only linked into executables'
+complete -c gcc -o fPIE -d 'Similar to -fpic and -fPIC, but generated position independent code can be only linked into executables'
 complete -c gcc -o fno-jump-tables -d 'Do not use jump tables for switch statements even where it would be more efficient than other code generation strategies'
 complete -c gcc -o ffixed-reg -d 'Treat the register named reg as a fixed register; generated code should never refer to it (except perhaps as a stack pointer, frame pointer or in some other fixed role)'
 complete -c gcc -o fcall-used-reg -d 'Treat the register named reg as an allocable register that is clobbered by function calls'
@@ -1410,13 +1401,13 @@ complete -c gcc -o fcall-saved-reg -d 'Treat the register named reg as an alloca
 complete -c gcc -o fpack-struct -d 'Without a value specified, pack all structure members together without holes' -x
 complete -c gcc -o finstrument-functions -d 'Generate instrumentation calls for entry and exit to functions'
 complete -c gcc -o fstack-check -d 'Generate code to verify that you do not go beyond the boundary of the stack'
-complete -c gcc -o fstack-limit-register -d 'Generate code to ensure that the stack does not grow beyond a certain value, either the value of a register or the address of a symbol'
-complete -c gcc -o fstack-limit-symbol -d 'Generate code to ensure that the stack does not grow beyond a certain value, either the value of a register or the address of a symbol'
-complete -c gcc -o fno-stack-limit -d 'Generate code to ensure that the stack does not grow beyond a certain value, either the value of a register or the address of a symbol'
+complete -c gcc -o fstack-limit-register -d 'Generate code to ensure that the stack does not grow beyond the value of a register'
+complete -c gcc -o fstack-limit-symbol -d 'Generate code to ensure that the stack does not grow beyond the address of a symbol'
+complete -c gcc -o fno-stack-limit -d 'Does not generate code to ensure that the stack does not grow beyond a certain value, either the value of a register or the address of a symbol'
 complete -c gcc -o fargument-alias -d 'Specify the possible relationships among parameters and between parameters and global data'
 complete -c gcc -o fargument-noalias -d 'Specify the possible relationships among parameters and between parameters and global data'
 complete -c gcc -o fargument-noalias-global -d 'Specify the possible relationships among parameters and between parameters and global data'
-complete -c gcc -o fleading-underscore -d 'This option and its counterpart, -fno-leading-underscore, forcibly change the way C symbols are represented in the object file'
+complete -c gcc -o fleading-underscore -d 'This flag and -fno-leading-underscore, forcibly change the way C symbols are represented in the object file'
 complete -c gcc -o ftls-model -d '=model Alter the thread-local storage model to be used'
 complete -c gcc -o fvisibility -a 'default internal hidden protected' -d 'Set the default ELF image symbol visibility'
 complete -c gcc -o fopenmp -d 'Enable handling of OpenMP directives "#pragma omp" in C/C++ and "!$omp" in Fortran'
diff --git a/share/completions/rustup.fish b/share/completions/rustup.fish
index 217ad8ca1..d13e020b8 100644
--- a/share/completions/rustup.fish
+++ b/share/completions/rustup.fish
@@ -133,7 +133,6 @@ function __rustup_triples
         x86_64-unknown-fuchsia \
         x86_64-unknown-haiku \
         x86_64-unknown-linux-gnu \
-        x86_64-unknown-linux-gnu \
         x86_64-unknown-linux-gnux32 \
         x86_64-unknown-linux-musl \
         x86_64-unknown-netbsd \
diff --git a/share/completions/tmux.fish b/share/completions/tmux.fish
index d4b3d143d..51715dfad 100644
--- a/share/completions/tmux.fish
+++ b/share/completions/tmux.fish
@@ -200,7 +200,6 @@ set -l options \
     message-style \
     mouse \
     prefix \
-    prefix \
     renumber-windows \
     repeat-time \
     set-titles \

From c7d5fafc4e84a1f99da65f1e87f57bfc54a56a12 Mon Sep 17 00:00:00 2001
From: Fabian Boehm <FHomborg@gmail.com>
Date: Sat, 9 Sep 2023 08:41:43 +0200
Subject: [PATCH 021/200] Prune Cirrus CI tasks

It's simply too many, especially given we have some tests that need interactivity.
---
 .cirrus.yml | 28 +---------------------------
 1 file changed, 1 insertion(+), 27 deletions(-)

diff --git a/.cirrus.yml b/.cirrus.yml
index 7bd954801..f4086400f 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -8,22 +8,6 @@ linux_task:
           container: &step
               image: ghcr.io/fish-shell/fish-ci/alpine:latest
               memory: 4GB
-        - name: bionic
-          container:
-              <<: *step
-              image: ghcr.io/fish-shell/fish-ci/bionic:latest
-        - name: bionic-asan-clang
-          container:
-              <<: *step
-              image: ghcr.io/fish-shell/fish-ci/bionic-asan-clang:latest
-        - name: bionic-tsan
-          container:
-              <<: *step
-              image: ghcr.io/fish-shell/fish-ci/bionic-tsan:latest
-        - name: bionic-tsan-clang
-          container:
-              <<: *step
-              image: ghcr.io/fish-shell/fish-ci/bionic-tsan-clang:latest
         - name: centos7
           container:
               <<: *step
@@ -36,10 +20,6 @@ linux_task:
           container:
               <<: *step
               image: ghcr.io/fish-shell/fish-ci/focal-32bit:latest
-        - name: xenial
-          container:
-              <<: *step
-              image: ghcr.io/fish-shell/fish-ci/xenial:latest
 
     tests_script:
         # cirrus at times gives us 32 procs and 2 GB of RAM
@@ -78,15 +58,9 @@ linux_arm_task:
 
 freebsd_task:
     matrix:
-        - name: FreeBSD 14
-          freebsd_instance:
-              image_family: freebsd-14-0-snap
         - name: FreeBSD 13
           freebsd_instance:
-              image: freebsd-13-0-release-amd64
-        - name: FreeBSD 12.3
-          freebsd_instance:
-              image: freebsd-12-3-release-amd64
+              image: freebsd-13-2-release-amd64
     tests_script:
         - pkg install -y cmake devel/pcre2 devel/ninja misc/py-pexpect git
         # BSDs have the following behavior: root may open or access files even if

From 045173968ed4ca0f39a5e5a5317c1bd56b7a2fb4 Mon Sep 17 00:00:00 2001
From: Fabian Boehm <FHomborg@gmail.com>
Date: Sat, 9 Sep 2023 09:07:47 +0200
Subject: [PATCH 022/200] cirrus: Remove jammy-armv7-32bit

Gives an "exec format error"???
---
 .cirrus.yml | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/.cirrus.yml b/.cirrus.yml
index f4086400f..560e948a7 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -39,9 +39,6 @@ linux_arm_task:
           arm_container:
               image: ghcr.io/fish-shell/fish-ci/focal-arm64
               only_if: $CIRRUS_REPO_OWNER == 'fish-shell'
-        - name: jammy-armv7-32bit
-          arm_container:
-              image: ghcr.io/fish-shell/fish-ci/jammy-armv7-32bit
 
     tests_script:
         # cirrus at times gives us 32 procs and 2 GB of RAM

From afd1d2a5278da73665336b55321dcc448612c6f1 Mon Sep 17 00:00:00 2001
From: AsukaMinato <asukaminato@nyan.eu.org>
Date: Mon, 10 Apr 2023 18:01:47 +0900
Subject: [PATCH 023/200] add completion for ar (#9720)

* add completion for ar

* clean the function

* update CHANGELOG

(cherry picked from commit 36e4b0ff305e26d65e69744b89bc6d3d2861dca4)
---
 share/completions/ar.fish | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
 create mode 100644 share/completions/ar.fish

diff --git a/share/completions/ar.fish b/share/completions/ar.fish
new file mode 100644
index 000000000..20ef85bee
--- /dev/null
+++ b/share/completions/ar.fish
@@ -0,0 +1,20 @@
+function __single
+    complete -f -c ar -n __fish_use_subcommand -a $argv[1] -d $argv[2] # no dash
+end
+
+__single d "Delete modules from the archive."
+__single m "move members in an archive."
+__single p "Print the specified members of the archive, to the standard output file."
+__single q "Quick append; Historically, add the files member... to the end of archive, without checking for replacement."
+__single r "Insert the files member... into archive (with replacement)."
+__single s "Add an index to the archive, or update it if it already exists."
+__single t "Display a table listing the contents of archive, or those of the files listed in member."
+__single x "Extract members (named member) from the archive."
+
+functions -e __single
+
+# TODO add mod
+# A number of modifiers (mod) may immediately follow the p keyletter, to specify variations on an operation's behavior:
+# add dash
+# command format
+# ar [emulation options] [-]{dmpqrstx}[abcDfilMNoOPsSTuvV] [--plugin <name>] [member-name] [count] archive-file file

From 480e9809f24a330a6d15418f614205a49c142a17 Mon Sep 17 00:00:00 2001
From: AsukaMinato <asukaminato@nyan.eu.org>
Date: Mon, 10 Apr 2023 02:13:57 +0900
Subject: [PATCH 024/200] add qjs completion

(cherry picked from commit 8a0510a2f20684ceb76221541e81eb5cca0f8571)
---
 share/completions/qjs.fish | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
 create mode 100644 share/completions/qjs.fish

diff --git a/share/completions/qjs.fish b/share/completions/qjs.fish
new file mode 100644
index 000000000..3f25f7305
--- /dev/null
+++ b/share/completions/qjs.fish
@@ -0,0 +1,17 @@
+# from qjs --help
+
+complete -c qjs -l help -s h -d "list options"
+complete -c qjs -l eval -s e -r -d "evaluate EXPR"
+complete -c qjs -l interactive -s i -d "go to interactive mode"
+complete -c qjs -l module -s m -d "load as ES6 module (default=autodetect)"
+complete -c qjs -l script -d "load as ES6 module (default=autodetect)"
+complete -c qjs -l include -s I -r -d "include an additional file"
+complete -c qjs -l std -d "make 'std' and 'os' available to the loaded script"
+complete -c qjs -l bignum  -d "enable the bignum extensions (BigFloat, BigDecimal)"
+complete -c qjs -l qjscalc -d "load the QJSCalc runtime (default if invoked as qjscalc)"
+complete -c qjs -l trace -s T -d "trace memory allocation"
+complete -c qjs -l dump -d "dump the memory usage stats"
+complete -c qjs -l memory-limit -r -d "limit the memory usage to 'n' bytes"
+complete -c qjs -l stack-size -r -d "limit the stack size to 'n' bytes"
+complete -c qjs -l unhandled-rejection -d "dump unhandled promise rejections"
+complete -c qjs -l quit -s q -d "just instantiate the interpreter and quit"

From 43c87e13c913d48b49a3b8d30410dc008bf9a33c Mon Sep 17 00:00:00 2001
From: "Eric N. Vander Weele" <ericvw@gmail.com>
Date: Mon, 10 Apr 2023 10:43:44 -0400
Subject: [PATCH 025/200] completions/git: Allow switch to complete remote
 branches

While it is true that `git switch <remote-branch>` errors to disallow a detached
head without the `-d` option, it is valid to use any starting point (commit or
reference) in conjunction with the `-c` option. Additionally, the starting point
can occur before any option.

This enables the following completions:

* `git switch -c <local-name> <any-branch>`
* `git switch <any-branch> -c <local-name>`
* `git switch -d <any-starting-point>`
* `git switch <any-branch> -d`

The trade-off is this does allow for `git switch <remote-branch>` to be
completed with an error.

Note that this logically reverts 7e3d3cc30f61d466f450a61ebee7c7fcd264967f.

(cherry picked from commit fdd4bcf718693b6224404ae2215da7c44f0784ac)
---
 share/completions/git.fish | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/share/completions/git.fish b/share/completions/git.fish
index a733ed073..900081d8d 100644
--- a/share/completions/git.fish
+++ b/share/completions/git.fish
@@ -1958,7 +1958,7 @@ complete -F -c git -n '__fish_git_using_command restore' -n '__fish_git_contains
 # switch options
 complete -f -c git -n __fish_git_needs_command -a switch -d 'Switch to a branch'
 complete -f -c git -n '__fish_git_using_command switch' -ka '(__fish_git_unique_remote_branches)' -d 'Unique Remote Branch'
-complete -f -c git -n '__fish_git_using_command switch' -ka '(__fish_git_local_branches)'
+complete -f -c git -n '__fish_git_using_command switch' -ka '(__fish_git_branches)'
 complete -f -c git -n '__fish_git_using_command switch' -s c -l create -d 'Create a new branch'
 complete -f -c git -n '__fish_git_using_command switch' -s C -l force-create -d 'Force create a new branch'
 complete -f -c git -n '__fish_git_using_command switch' -s d -l detach -d 'Switch to a commit for inspection and discardable experiment' -rka '(__fish_git_refs)'

From 4e731123b525c57a2475775c761e5b8739b5e8fd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pawe=C5=82=20Pi=C4=85tkowski?= <cosi11255@gmail.com>
Date: Wed, 12 Apr 2023 16:12:13 +0200
Subject: [PATCH 026/200] Ansible completion: fix typo in `--limit-hosts`

(cherry picked from commit bda9d57417e956cf4a9c81a834d7b6b4756d4017)
---
 share/completions/ansible.fish | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/share/completions/ansible.fish b/share/completions/ansible.fish
index d34a09b38..a15d34615 100644
--- a/share/completions/ansible.fish
+++ b/share/completions/ansible.fish
@@ -8,7 +8,7 @@ complete -c ansible -s f -l forks -a "(seq 0 100)" -d "Number of parallel proces
 complete -c ansible -s h -l help -d "Shows a help message"
 complete -c ansible -s i -l inventory -r -d "Specify inventory host path or comma separated host list"
 complete -c ansible -s l -l limit -r -d "Further limit selected hosts to an additional pattern"
-complete -c ansible -l limit-hosts -r -d "List all matching hosts"
+complete -c ansible -l list-hosts -r -d "List all matching hosts"
 complete -c ansible -s m -l module-name -r -d "Module name to execute (default=command)"
 complete -c ansible -s M -l module-path -r -d "Specify path(s) to module library (default=None)"
 complete -c ansible -l new-vault-password-file -f -d "New vault password file for rekey"

From 8727a7f9e3c9b0b96066d252b2c83c03edeff20e Mon Sep 17 00:00:00 2001
From: Jan Tojnar <jtojnar@gmail.com>
Date: Wed, 12 Apr 2023 20:45:50 +0200
Subject: [PATCH 027/200] Fix `composer require` completion

When no development dependencies are installed, the completion would crash with:

    KeyError: 'require-dev'

(cherry picked from commit 9e223577aa95ea56b0907035bb50bbba5ae47d24)
---
 share/completions/composer.fish | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/share/completions/composer.fish b/share/completions/composer.fish
index f32703400..22839867d 100644
--- a/share/completions/composer.fish
+++ b/share/completions/composer.fish
@@ -29,7 +29,7 @@ import json
 json_data = open('composer.json')
 data = json.load(json_data)
 json_data.close()
-packages = itertools.chain(data['require'].keys(), data['require-dev'].keys())
+packages = itertools.chain(data.get('require', {}).keys(), data.get('require-dev', {}).keys())
 print(\"\n\".join(packages))
       " | $python -S
 end

From 7c8b309d79b17c05ea0547ff9257a4b0ab52c457 Mon Sep 17 00:00:00 2001
From: Fabian Boehm <FHomborg@gmail.com>
Date: Tue, 18 Apr 2023 20:40:14 +0200
Subject: [PATCH 028/200] completions/git: Escape custom command names

This can be triggered by having a custom git command in e.g.
`/mnt/c/Program Files (x86)/foo/`.

Fixes #9738

(cherry picked from commit db5c9badad6162e79dbf68ec83275de6df061e1d)
---
 share/completions/git.fish | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/share/completions/git.fish b/share/completions/git.fish
index 900081d8d..756e09ed8 100644
--- a/share/completions/git.fish
+++ b/share/completions/git.fish
@@ -2392,7 +2392,7 @@ for file in (path filter -xZ $PATH/git-* | path basename)
     and continue
 
     # Running `git foo` ends up running `git-foo`, so we need to ignore the `git-` here.
-    set -l cmd (string replace -r '^git-' '' -- $file)
+    set -l cmd (string replace -r '^git-' '' -- $file | string escape)
     complete -c git -f -n "__fish_git_using_command $cmd" -a "(__fish_git_complete_custom_command $cmd)"
     set -a __fish_git_custom_commands_completion $file
 end

From d73309255272c57e8489840ea8ecd31a737848aa Mon Sep 17 00:00:00 2001
From: AsukaMinato <asukaminato@nyan.eu.org>
Date: Thu, 20 Apr 2023 02:21:55 +0900
Subject: [PATCH 029/200] add-qjsc-fish (#9731)

* add-qjsc-fish

* fix -o qjsc.fish

(cherry picked from commit f5e063a4626bf2f38612d33265be066ae0fe0e63)
---
 share/completions/qjsc.fish | 44 +++++++++++++++++++++++++++++++++++++
 1 file changed, 44 insertions(+)
 create mode 100644 share/completions/qjsc.fish

diff --git a/share/completions/qjsc.fish b/share/completions/qjsc.fish
new file mode 100644
index 000000000..6d7de8d18
--- /dev/null
+++ b/share/completions/qjsc.fish
@@ -0,0 +1,44 @@
+# Define the completions for the qjsc command
+# QuickJS Compiler version 2021-03-27
+# usage: qjsc [options] [files]
+
+# options are:
+# -c          only output bytecode in a C file
+# -e          output main() and bytecode in a C file (default = executable output)
+# -o output   set the output filename
+# -N cname    set the C name of the generated data
+# -m          compile as Javascript module (default=autodetect)
+# -D module_name         compile a dynamically loaded module or worker
+# -M module_name[,cname] add initialization code for an external C module
+# -x          byte swapped output
+# -p prefix   set the prefix of the generated C names
+# -S n        set the maximum stack size to 'n' bytes (default=262144)
+# -flto       use link time optimization
+# -fbignum    enable bignum extensions
+# -fno-[date|eval|string-normalize|regexp|json|proxy|map|typedarray|promise|module-loader|bigint]
+#             disable selected language features (smaller code size)
+# from https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=quickjs 2021.03.27
+
+complete -c qjsc -s c -d 'Only output bytecode in a C file'
+complete -c qjsc -s e -d 'Output main() and bytecode in a C file (default = executable output)'
+complete -c qjsc -s o -r -d 'Set the output filename'
+complete -c qjsc -s N -r -d 'Set the C name of the generated data'
+complete -c qjsc -s m -d 'Compile as Javascript module (default=autodetect)'
+complete -c qjsc -s D -r -d 'Compile a dynamically loaded module or worker'
+complete -c qjsc -s M -r -d 'Add initialization code for an external C module'
+complete -c qjsc -s x -d 'Byte swapped output'
+complete -c qjsc -s p -r -d 'Set the prefix of the generated C names'
+complete -c qjsc -s S -r -d 'Set the maximum stack size to 'n' bytes (default=262144)'
+complete -c qjsc -o flto -d 'Use link time optimization'
+complete -c qjsc -o fbignum -d 'Enable bignum extensions'
+complete -c qjsc -o fno-date -d 'Disable the date extension'
+complete -c qjsc -o fno-eval -d 'Disable the eval extension'
+complete -c qjsc -o fno-string-normalize -d 'Disable the string normalize extension'
+complete -c qjsc -o fno-regexp -d 'Disable the regexp extension'
+complete -c qjsc -o fno-json -d 'Disable the JSON extension'
+complete -c qjsc -o fno-proxy -d 'Disable the proxy extension'
+complete -c qjsc -o fno-map -d 'Disable the Map extension'
+complete -c qjsc -o fno-typedarray -d 'Disable the Typed Array extension'
+complete -c qjsc -o fno-promise -d 'Disable the Promise extension'
+complete -c qjsc -o fno-module-loader -d 'Disable the module loader extension'
+complete -c qjsc -o fno-bigint -d 'Disable the BigInt extension'

From ee530952712c7e703daec053914d545a5b0ce071 Mon Sep 17 00:00:00 2001
From: Paiusco <unknown>
Date: Mon, 10 Apr 2023 18:42:56 +0200
Subject: [PATCH 030/200] Create fish_[default|vi]_key_bindings documentation

- Create docs file for both vi and default key bindings
- Remove variable mention on `interactive` and point to their own pages

(cherry picked from commit 564039093bc1cb966b7ee53934445d8de1c62716)
---
 doc_src/cmds/fish_default_key_bindings.rst | 27 ++++++++++++++++
 doc_src/cmds/fish_vi_key_bindings.rst      | 36 ++++++++++++++++++++++
 doc_src/interactive.rst                    |  7 ++---
 3 files changed, 66 insertions(+), 4 deletions(-)
 create mode 100644 doc_src/cmds/fish_default_key_bindings.rst
 create mode 100644 doc_src/cmds/fish_vi_key_bindings.rst

diff --git a/doc_src/cmds/fish_default_key_bindings.rst b/doc_src/cmds/fish_default_key_bindings.rst
new file mode 100644
index 000000000..88691893b
--- /dev/null
+++ b/doc_src/cmds/fish_default_key_bindings.rst
@@ -0,0 +1,27 @@
+.. _cmd-fish_default_key_bindings:
+
+fish_default_key_bindings - set emacs key bindings for fish
+===============================================================
+
+Synopsis
+--------
+
+.. synopsis::
+
+    fish_default_key_bindings
+
+Description
+-----------
+
+``fish_default_key_bindings`` sets the emacs key bindings for ``fish`` shell.
+
+Some of the Emacs key bindings are defined :ref:`here <emacs-mode>`.
+
+There are no parameters for ``fish_default_key_bindings``.
+
+Examples
+--------
+
+To start using vi key bindings::
+
+  fish_default_key_bindings
diff --git a/doc_src/cmds/fish_vi_key_bindings.rst b/doc_src/cmds/fish_vi_key_bindings.rst
new file mode 100644
index 000000000..67f4b0a41
--- /dev/null
+++ b/doc_src/cmds/fish_vi_key_bindings.rst
@@ -0,0 +1,36 @@
+.. _cmd-fish_vi_key_bindings:
+
+fish_vi_key_bindings - set vi key bindings for fish
+===============================================================
+
+Synopsis
+--------
+
+.. synopsis::
+
+    fish_vi_key_bindings
+    fish_vi_key_bindings [--no-erase] [INIT_MODE]
+
+Description
+-----------
+
+``fish_vi_key_bindings`` sets the vi key bindings for ``fish`` shell.
+
+If a valid *INIT_MODE* is provided (insert, default, visual), then that mode will become the default
+. If no *INIT_MODE* is given, the mode defaults to insert mode.
+
+The following parameters are available:
+
+**--no-erase**
+    Does not clear previous set bindings
+
+Further information on how to use :ref:`vi-mode <vi-mode>`.
+
+Examples
+--------
+
+To start using vi key bindings::
+
+  fish_vi_key_bindings
+
+or ``set -g fish_key_bindings fish_vi_key_bindings`` in :ref:`config.fish <configuration>`.
diff --git a/doc_src/interactive.rst b/doc_src/interactive.rst
index f13e1ff44..592625857 100644
--- a/doc_src/interactive.rst
+++ b/doc_src/interactive.rst
@@ -270,7 +270,7 @@ Command line editor
 
 The fish editor features copy and paste, a :ref:`searchable history <history-search>` and many editor functions that can be bound to special keyboard shortcuts.
 
-Like bash and other shells, fish includes two sets of keyboard shortcuts (or key bindings): one inspired by the Emacs text editor, and one by the Vi text editor. The default editing mode is Emacs. You can switch to Vi mode by running ``fish_vi_key_bindings`` and switch back with ``fish_default_key_bindings``. You can also make your own key bindings by creating a function and setting the ``fish_key_bindings`` variable to its name. For example::
+Like bash and other shells, fish includes two sets of keyboard shortcuts (or key bindings): one inspired by the Emacs text editor, and one by the Vi text editor. The default editing mode is Emacs. You can switch to Vi mode by running :doc:`fish_vi_key_bindings <cmds/fish_vi_key_bindings>` and switch back with :doc:`fish_default_key_bindings <cmds/fish_default_key_bindings>`. You can also make your own key bindings by creating a function and setting the ``fish_key_bindings`` variable to its name. For example::
 
 
     function fish_hybrid_key_bindings --description \
@@ -346,7 +346,7 @@ Some bindings are common across Emacs and Vi mode, because they aren't text edit
 Emacs mode commands
 ^^^^^^^^^^^^^^^^^^^
 
-To enable emacs mode, use ``fish_default_key_bindings``. This is also the default.
+To enable emacs mode, use :doc:`fish_default_key_bindings <cmds/fish_default_key_bindings>`. This is also the default.
 
 - :kbd:`Home` or :kbd:`Control`\ +\ :kbd:`A` moves the cursor to the beginning of the line.
 
@@ -391,8 +391,7 @@ Vi mode commands
 
 Vi mode allows for the use of Vi-like commands at the prompt. Initially, :ref:`insert mode <vi-mode-insert>` is active. :kbd:`Escape` enters :ref:`command mode <vi-mode-command>`. The commands available in command, insert and visual mode are described below. Vi mode shares :ref:`some bindings <shared-binds>` with :ref:`Emacs mode <emacs-mode>`.
 
-To enable vi mode, use ``fish_vi_key_bindings``.
-
+To enable vi mode, use :doc:`fish_vi_key_bindings <cmds/fish_vi_key_bindings>`.
 It is also possible to add all emacs-mode bindings to vi-mode by using something like::
 
 

From 64a2ed761b97ddd0a4f778c6ac1556c28f590c10 Mon Sep 17 00:00:00 2001
From: may <m4rch3n1ng@gmail.com>
Date: Fri, 21 Apr 2023 03:42:32 +0200
Subject: [PATCH 031/200] add recent commits to completion for git switch
 --detach

(cherry picked from commit beca70458b4413d72712c48a66f16ede66e73bc7)
---
 share/completions/git.fish | 1 +
 1 file changed, 1 insertion(+)

diff --git a/share/completions/git.fish b/share/completions/git.fish
index 756e09ed8..e1e02a6d1 100644
--- a/share/completions/git.fish
+++ b/share/completions/git.fish
@@ -1961,6 +1961,7 @@ complete -f -c git -n '__fish_git_using_command switch' -ka '(__fish_git_unique_
 complete -f -c git -n '__fish_git_using_command switch' -ka '(__fish_git_branches)'
 complete -f -c git -n '__fish_git_using_command switch' -s c -l create -d 'Create a new branch'
 complete -f -c git -n '__fish_git_using_command switch' -s C -l force-create -d 'Force create a new branch'
+complete -f -c git -n '__fish_git_using_command switch' -s d -l detach -rka '(__fish_git_recent_commits --all)'
 complete -f -c git -n '__fish_git_using_command switch' -s d -l detach -d 'Switch to a commit for inspection and discardable experiment' -rka '(__fish_git_refs)'
 complete -f -c git -n '__fish_git_using_command switch' -l guess -d 'Guess branch name from remote branch (default)'
 complete -f -c git -n '__fish_git_using_command switch' -l no-guess -d 'Do not guess branch name from remote branch'

From 11f6b78dad409d711b34531f3b272cdf372c5862 Mon Sep 17 00:00:00 2001
From: exploide <me@exploide.net>
Date: Sat, 22 Apr 2023 15:53:54 +0200
Subject: [PATCH 032/200] completions: added ip neigh completions

(cherry picked from commit 30ae715183734004c3fb90eb6dbc7841ab0a5c47)
---
 share/completions/ip.fish | 81 +++++++++++++++++++++++++++++++++++++--
 1 file changed, 77 insertions(+), 4 deletions(-)

diff --git a/share/completions/ip.fish b/share/completions/ip.fish
index 18655c548..1d03dd030 100644
--- a/share/completions/ip.fish
+++ b/share/completions/ip.fish
@@ -4,11 +4,12 @@
 # Also the manpage and even the grammar it accepts is utter shite (options can only be before commands, some things are only in the BNF, others only in the text)
 # It also quite likes the word "dev", even though it needs it less than the BNF specifies
 
-set -l ip_commands link address addrlabel route rule neigh ntable tunnel tuntap maddr mroute mrule monitor xfrm netns l2tp tcp_metrics
+set -l ip_commands link address addrlabel route rule neighbour ntable tunnel tuntap maddr mroute mrule monitor xfrm netns l2tp tcp_metrics
 set -l ip_addr a ad add addr addre addres address
 set -l ip_link l li lin link
+set -l ip_neigh n ne nei neig neigh neighb neighbo neighbor neighbour
 set -l ip_route r ro rou rout route
-set -l ip_all_commands $ip_commands $ip_addr $ip_link $ip_route
+set -l ip_all_commands $ip_commands $ip_addr $ip_link $ip_neigh $ip_route
 
 function __fish_ip_commandwords
     set -l skip 0
@@ -61,10 +62,10 @@ function __fish_ip_commandwords
                 else
                     echo $word
                 end
-            case n ne nei neig neigh
+            case n ne nei neig neigh neighb neighbo neighbor neighbour
                 if test $have_command = 0
                     set have_command 1
-                    echo neigh
+                    echo neighbour
                 else
                     echo $word
                 end
@@ -239,6 +240,18 @@ function __fish_ip_types
         xfrm "Virtual xfrm interface"
 end
 
+function __fish_ip_neigh_states
+    printf '%s\t%s\n' permanent "entry is valid forever" \
+        noarp "entry is valid without validation" \
+        reachable "entry is valid until timeout" \
+        stale "entry is valid but suspicious" \
+        none "pseudo state" \
+        incomplete "entry has not yet been validated" \
+        delay "entry validation is currently delayed" \
+        probe "neighbor is being probed" \
+        failed "neighbor validation has ultimately failed"
+end
+
 function __fish_complete_ip
     set -l cmd (__fish_ip_commandwords)
     set -l count (count $cmd)
@@ -418,6 +431,66 @@ function __fish_complete_ip
                     case help
                 end
             end
+        case neighbour
+            if not set -q cmd[3]
+                printf '%s\t%s\n' help "Show help" \
+                    add "Add new neighbour entry" \
+                    delete "Delete neighbour entry" \
+                    change "Change neighbour entry" \
+                    replace "Add or change neighbour entry" \
+                    show "List neighbour entries" \
+                    flush "Flush neighbour entries" \
+                    get "Lookup neighbour entry"
+            else
+                switch $cmd[2]
+                    case add del delete change replace
+                        switch $cmd[-2]
+                            case lladdr
+                            case nud
+                                __fish_ip_neigh_states
+                            case proxy
+                            case dev
+                                __fish_ip_device
+                            case '*'
+                                echo lladdr
+                                echo nud
+                                echo proxy
+                                echo dev
+                                echo router
+                                echo use
+                                echo managed
+                                echo extern_learn
+                        end
+                    case show flush
+                        switch $cmd[-2]
+                            case to
+                            case dev
+                                __fish_ip_device
+                            case vrf
+                            case nud
+                                __fish_ip_neigh_states
+                                echo all
+                            case '*'
+                                echo to
+                                echo dev
+                                echo vrf
+                                echo nomaster
+                                echo proxy
+                                echo unused
+                                echo nud
+                        end
+                    case get
+                        switch $cmd[-2]
+                            case to
+                            case dev
+                                __fish_ip_device
+                            case '*'
+                                echo proxy
+                                echo to
+                                echo dev
+                        end
+                end
+            end
         case route
             if not set -q cmd[3]
                 printf '%s\t%s\n' add "Add new route" \

From bdd3733b26d7563df99960b1b67178fee51a4ae1 Mon Sep 17 00:00:00 2001
From: Jannik Vieten <me@exploide.net>
Date: Sun, 23 Apr 2023 19:35:41 +0200
Subject: [PATCH 033/200] Improve jq completions and add gojq completions

* completions: updated jq completions

* completions: added completions for gojq

* Shorten jq completion descriptions

* Update gojq.fish

Capitalize first letter of descriptions to match other completions.

---------

Co-authored-by: Mahmoud Al-Qudsi <mqudsi@neosmart.net>
(cherry picked from commit 480133bcc83358e391d961f3055613856d058ba7)
---
 share/completions/gojq.fish | 28 ++++++++++++++++++++++++++++
 share/completions/jq.fish   | 30 ++++++++++++++++--------------
 2 files changed, 44 insertions(+), 14 deletions(-)
 create mode 100644 share/completions/gojq.fish

diff --git a/share/completions/gojq.fish b/share/completions/gojq.fish
new file mode 100644
index 000000000..5b24b5a82
--- /dev/null
+++ b/share/completions/gojq.fish
@@ -0,0 +1,28 @@
+# Pure Go implementation of jq
+# https://github.com/itchyny/gojq
+
+complete -c gojq -s c -l compact-output -d "Compact output, no pretty-print"
+complete -c gojq -s r -l raw-output -d "Output raw strings without quotes"
+complete -c gojq -s j -l join-output -d "Stop printing a newline after each output"
+complete -c gojq -s 0 -l nul-output -d "Print NUL after each output"
+complete -c gojq -s C -l color-output -d "Colorize output even if piped"
+complete -c gojq -s M -l monochrome-output -d "Stop colorizing output"
+complete -c gojq -l yaml-output -d "Output as YAML"
+complete -c gojq -l indent -x -d "Number of spaces for indentation"
+complete -c gojq -l tab -d "Use tabs for indentation"
+complete -c gojq -s n -l null-input -d "Use null as input value"
+complete -c gojq -s R -l raw-input -d "Read input as raw strings"
+complete -c gojq -s s -l slurp -d "Read all inputs into an array"
+complete -c gojq -l stream -d "Parse input in stream fashion"
+complete -c gojq -l yaml-input -d "Read input as YAML"
+complete -c gojq -s f -l from-file -rF -d "Load query from file"
+complete -c gojq -s L -xa "(__fish_complete_directories)" -d "Directory to search modules from"
+complete -c gojq -l arg -x -d "Set variable to string value"
+complete -c gojq -l argjson -x -d "Set variable to JSON value"
+complete -c gojq -l slurpfile -x -d "Set variable to the JSON contents of the file"
+complete -c gojq -l rawfile -x -d "Set variable to the contents of the file"
+complete -c gojq -l args -d "Consume remaining arguments as positional string values"
+complete -c gojq -l jsonargs -d "Consume remaining arguments as positional JSON values"
+complete -c gojq -s e -l exit-status -d "Exit 1 when the last value is false or null"
+complete -c gojq -s v -l version -d "Print gojq version"
+complete -c gojq -s h -l help -d "Print help"
diff --git a/share/completions/jq.fish b/share/completions/jq.fish
index 30ec151a3..9a84dae1a 100644
--- a/share/completions/jq.fish
+++ b/share/completions/jq.fish
@@ -1,27 +1,29 @@
 # jq is a lightweight and flexible command-line JSON processor.
 # See: https://stedolan.github.io/jq
 
-complete -c jq -l version -d 'Output version and exit'
-complete -c jq -l seq -d 'Use application/json-seq MIME type scheme'
+complete -c jq -l version -d 'Output jq version'
+complete -c jq -l seq -d 'Use application/json-seq MIME type'
 complete -c jq -l stream -d 'Parse input in streaming fasion'
-complete -c jq -l slurp -s s -d 'Run filter just once in large array'
-complete -c jq -l raw-input -s R -d 'Don\'t parse as JSON but as string'
+complete -c jq -l slurp -s s -d 'Read input to array and filter once'
+complete -c jq -l raw-input -s R -d 'Parse input as string (not JSON)'
 complete -c jq -l null-input -s n -d 'Ignore input and treat it as null'
 complete -c jq -l compact-output -s c -d 'Don\'t pretty-print JSON'
-complete -c jq -l tab -d 'Use a tab for indentation instead of 2 spaces'
-complete -c jq -l indent -x -d 'Use given number of spaces for indentation'
+complete -c jq -l tab -d 'Indent w/ tabs instead of spaces'
+complete -c jq -l indent -x -d 'Num of spaces per indent'
 complete -c jq -l color-output -s C -d 'Color output'
 complete -c jq -l monochrome-output -s M -d 'Don\'t color output'
-complete -c jq -l ascii-output -s a -d 'Replace UTF-8 characters with escape sequences'
-complete -c jq -l unbuffered -d 'Flush output after each JSON object is printed'
+complete -c jq -l ascii-output -s a -d 'Replace UTF-8 chars w/ escape sequences'
+complete -c jq -l unbuffered -d 'Flush output after each JSON object'
 complete -c jq -l sort-keys -s S -d 'Sort object keys in output'
-complete -c jq -l raw-output -s r -d 'If output is string output its content directly to stdout'
+complete -c jq -l raw-output -s r -d 'Write string output w/out quotes'
 complete -c jq -l join-output -s j -d 'Raw output without newlines'
 complete -c jq -l from-file -s f -r -d 'Read filter from file'
-complete -c jq -s L -d 'Prepend given directory to search modules'
-complete -c jq -l exit-status -s e -x -d 'Set exit status'
+complete -c jq -s L -d 'Prepend dir to module search list'
+complete -c jq -l exit-status -s e -d 'Set exit status from output'
 complete -c jq -l arg -x -d 'Set variable'
 complete -c jq -l argjson -x -d 'Set JSON-encoded variable'
-complete -c jq -l slurpfile -r -d 'Read JSON in file and bind to given variable'
-complete -c jq -l argfile -r -d 'Read JSON in file and bind to given variable [see man]'
-complete -c jq -l run-tests -r -d 'Run tests in given file'
+complete -c jq -l slurpfile -x -d 'Read JSON in file and bind to given variable'
+complete -c jq -l argfile -x -d 'Read JSON in file and bind to given variable [see man]'
+complete -c jq -l args -d 'Remaining args are positional string args'
+complete -c jq -l jsonargs -d 'Remaining args are positional JSON text args'
+complete -c jq -l run-tests -d 'Run tests in given file'

From 87e0edf9894e64a9e88a7c08e7fcab25dac5ad8f Mon Sep 17 00:00:00 2001
From: Yuntao Zhao <102750122+yuntaz2@users.noreply.github.com>
Date: Sun, 23 Apr 2023 10:55:00 -0700
Subject: [PATCH 034/200] Add rpm-ostree completion (#9669)

* Add rpm-ostree completion

Add basic command completion for rpm-ostree. This should improve the
user experience for fish users using rpm-ostree.

* Shorten rpm-ostree descriptions

---------

Co-authored-by: Mahmoud Al-Qudsi <mqudsi@neosmart.net>
(cherry picked from commit 20b500dce8908ddf69f0dd2ba0f9b71a5a47b8f2)
---
 share/completions/rpm-ostree.fish | 79 +++++++++++++++++++++++++++++++
 1 file changed, 79 insertions(+)
 create mode 100644 share/completions/rpm-ostree.fish

diff --git a/share/completions/rpm-ostree.fish b/share/completions/rpm-ostree.fish
new file mode 100644
index 000000000..4f9e1ae7f
--- /dev/null
+++ b/share/completions/rpm-ostree.fish
@@ -0,0 +1,79 @@
+# Define subcommands for rpm-ostree
+set -l subcommands apply-live compose cancel cleanup db deploy initramfs initramfs-etc install kargs override refresh-md reload rebase reset rollback status uninstall upgrade usroverlay
+
+# File completions also need to be disabled
+complete -c rpm-ostree -f
+
+# Define auto-completion options for rpm-ostree
+complete -c rpm-ostree -n "not __fish_seen_subcommand_from $subcommands" -a "$subcommands"
+
+# deploy
+complete -c rpm-ostree -n '__fish_seen_subcommand_from deploy' -l unchanged-exit-77 -d 'Exit w/ code 77 if system already on specified commit'
+complete -c rpm-ostree -n '__fish_seen_subcommand_from deploy' -s r -l reboot -d 'Reboot after upgrade is prepared'
+complete -c rpm-ostree -n '__fish_seen_subcommand_from deploy' -l preview -d 'Download enough metadata to diff RPM w/out deploying'
+complete -c rpm-ostree -n '__fish_seen_subcommand_from deploy' -s C -l cache-only -d 'Perform operation w/out updating from remotes'
+complete -c rpm-ostree -n '__fish_seen_subcommand_from deploy' -l download-only -d 'Download targeted ostree/layered RPMs w/out deploying'
+
+# install
+complete -c rpm-ostree -n '__fish_seen_subcommand_from install' -l idempotent -d 'Don\'t error if package is already present'
+complete -c rpm-ostree -n '__fish_seen_subcommand_from install' -s r -l reboot -d 'Reboot after deployment is prepared'
+complete -c rpm-ostree -n '__fish_seen_subcommand_from install' -s n -l dry-run -d 'Exit after printing transaction (don\'t download and deploy)'
+complete -c rpm-ostree -n '__fish_seen_subcommand_from install' -l allow-inactive -d 'Allow packages already in base layer'
+complete -c rpm-ostree -n '__fish_seen_subcommand_from install' -s C -l cache-only -d 'Don\'t download latest packages'
+complete -c rpm-ostree -n '__fish_seen_subcommand_from install' -l download-only -d 'Download targeted layered RPMs w/out deploying'
+complete -c rpm-ostree -n '__fish_seen_subcommand_from install' -l apply-live -d 'Apply changes to booted deployment'
+
+# uninstall
+complete -c rpm-ostree -n '__fish_seen_subcommand_from uninstall' -s r -l reboot -d 'Reboot after deployment is prepared'
+complete -c rpm-ostree -n '__fish_seen_subcommand_from uninstall' -s n -l dry-run -d 'Exit after printing transaction (don\'t download and deploy)'
+
+# rebase
+complete -c rpm-ostree -n '__fish_seen_subcommand_from rebase' -l branch -d 'Pick a branch name'
+complete -c rpm-ostree -n '__fish_seen_subcommand_from rebase' -l remote -d 'Pick a remote name'
+complete -c rpm-ostree -n '__fish_seen_subcommand_from rebase' -s C -l cache-only -d 'Perform rebase w/out downloading latest'
+complete -c rpm-ostree -n '__fish_seen_subcommand_from rebase' -l download-only -d 'Download targeted ostree/layered RPMs w/out deploying'
+
+# rollback
+complete -c rpm-ostree -n '__fish_seen_subcommand_from rollback' -s r -l reboot -d 'Reboot after rollback is prepared'
+
+# upgrade
+complete -c rpm-ostree -n '__fish_seen_subcommand_from upgrade' -l allow-downgrade -d 'Permit deployment of older trees'
+complete -c rpm-ostree -n '__fish_seen_subcommand_from upgrade' -l preview -d 'Minimal download in order to do a package-level version diff'
+complete -c rpm-ostree -n '__fish_seen_subcommand_from upgrade' -l check -d 'Check if upgrade is available w/out downloading it'
+complete -c rpm-ostree -n '__fish_seen_subcommand_from upgrade' -s C -l cache-only -d 'Upgrade w/out updating to latest'
+complete -c rpm-ostree -n '__fish_seen_subcommand_from upgrade' -l download-only -d 'Download targeted ostree/layered RPMs w/out deploying'
+complete -c rpm-ostree -n '__fish_seen_subcommand_from upgrade' -s r -l reboot -d 'Reboot after upgrade is prepared'
+complete -c rpm-ostree -n '__fish_seen_subcommand_from upgrade' -l unchanged-exit-77 -d 'Exit w/ code 77 if system is up to date'
+
+# kargs
+complete -c rpm-ostree -n '__fish_seen_subcommand_from kargs' -l editor -d 'Use editor to modify kernel args'
+complete -c rpm-ostree -n '__fish_seen_subcommand_from kargs' -l append -d 'Append kernel arg'
+complete -c rpm-ostree -n '__fish_seen_subcommand_from kargs' -l append-if-missing -d 'Append kernel arg if not present'
+complete -c rpm-ostree -n '__fish_seen_subcommand_from kargs' -l delete -d 'Delete kernel arg'
+complete -c rpm-ostree -n '__fish_seen_subcommand_from kargs' -l delete-if-present -d 'Delete kernel arg if present'
+complete -c rpm-ostree -n '__fish_seen_subcommand_from kargs' -l replace -d 'Replace existing kernel arg'
+complete -c rpm-ostree -n '__fish_seen_subcommand_from kargs' -l unchanged-exit-77 -d 'Exit w/ code 77 if kernel args unchanged'
+complete -c rpm-ostree -n '__fish_seen_subcommand_from kargs' -l deploy-index -d 'Use specified index to modify kernel args'
+complete -c rpm-ostree -n '__fish_seen_subcommand_from kargs' -l import-proc-cmdline -d 'Use booted kernel args to modify kernel args'
+
+# cleanup
+complete -c rpm-ostree -n '__fish_seen_subcommand_from cleanup' -s p -l pending -d 'Remove pending deployment'
+complete -c rpm-ostree -n '__fish_seen_subcommand_from cleanup' -s r -l rollback -d 'Remove default rollback deployment'
+complete -c rpm-ostree -n '__fish_seen_subcommand_from cleanup' -s b -l base -d 'Free used space from interrupted ops'
+complete -c rpm-ostree -n '__fish_seen_subcommand_from cleanup' -s m -l repomd -d 'Clean up cached RPM repodata and partial downloads'
+
+# initramfs
+complete -c rpm-ostree -n '__fish_seen_subcommand_from initramfs' -l enable -d 'Enable client-side initramfs regen'
+complete -c rpm-ostree -n '__fish_seen_subcommand_from initramfs' -l arg -d 'Append custom args to initramfs program'
+complete -c rpm-ostree -n '__fish_seen_subcommand_from initramfs' -l disable -d 'Disable initramfs regen'
+
+# initramfs-etc
+complete -c rpm-ostree -n '__fish_seen_subcommand_from initramfs-etc' -l track -d 'Track specified file'
+complete -c rpm-ostree -n '__fish_seen_subcommand_from initramfs-etc' -l untrack -d 'Stop tracking files'
+complete -c rpm-ostree -n '__fish_seen_subcommand_from initramfs-etc' -l untrack-all -d 'Stop tracking all files'
+complete -c rpm-ostree -n '__fish_seen_subcommand_from initramfs-etc' -l force-sync -d 'Generate a new deployment w/out upgrading'
+
+# apply-live
+complete -c rpm-ostree -n '__fish_seen_subcommand_from apply-live' -l reset -d 'Reset filesystem tree to booted commit'
+complete -c rpm-ostree -n '__fish_seen_subcommand_from apply-live' -l target -d 'Target named OSTree commit'
+complete -c rpm-ostree -n '__fish_seen_subcommand_from apply-live' -l allow-replacement -d 'Enable live update/remove of extant packages'

From 638a29badc99cb0071e0a98d4839fa12648e03d3 Mon Sep 17 00:00:00 2001
From: Kid <44045911+kidonng@users.noreply.github.com>
Date: Tue, 25 Apr 2023 19:01:58 +0800
Subject: [PATCH 035/200] Remove kitty completion in favor of official
 integration

(cherry picked from commit 93dc8485dd05efa873f9822321a4b9aa977c7176)
---
 share/completions/kitty.fish | 7 -------
 1 file changed, 7 deletions(-)
 delete mode 100644 share/completions/kitty.fish

diff --git a/share/completions/kitty.fish b/share/completions/kitty.fish
deleted file mode 100644
index 7734d975f..000000000
--- a/share/completions/kitty.fish
+++ /dev/null
@@ -1,7 +0,0 @@
-function __ksi_completions
-    set --local ct (commandline --current-token)
-    set --local tokens (commandline --tokenize --cut-at-cursor --current-process)
-    printf "%s\n" $tokens $ct | command kitty +complete fish2
-end
-
-complete -f -c kitty -a "(__ksi_completions)"

From fc0e033b821c7d86e57728b41ad71fb6b86ca4cb Mon Sep 17 00:00:00 2001
From: Xiretza <xiretza@xiretza.xyz>
Date: Tue, 25 Apr 2023 20:04:18 +0000
Subject: [PATCH 036/200] complete: fix condition to suppress variable
 autocompletion

(cherry picked from commit b76e6c5637dbc6ee579089dd5387b211924b9e25)
---
 src/complete.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/complete.cpp b/src/complete.cpp
index c90de110c..aaac08145 100644
--- a/src/complete.cpp
+++ b/src/complete.cpp
@@ -1234,7 +1234,7 @@ bool completer_t::try_complete_variable(const wcstring &str) {
     // Now complete if we have a variable start. Note the variable text may be empty; in that case
     // don't generate an autosuggestion, but do allow tab completion.
     bool allow_empty = !this->flags.autosuggestion;
-    bool text_is_empty = (variable_start == len);
+    bool text_is_empty = (variable_start == len - 1);
     bool result = false;
     if (variable_start != wcstring::npos && (allow_empty || !text_is_empty)) {
         result = this->complete_variable(str, variable_start + 1);

From a1ac5290861878c716ef3bc8605167da46987b91 Mon Sep 17 00:00:00 2001
From: Fabian Boehm <FHomborg@gmail.com>
Date: Mon, 8 May 2023 18:33:28 +0200
Subject: [PATCH 037/200] completions/dnf: Use lowercase queryformat

See https://github.com/rpm-software-management/dnf/commit/de9c5c5b597bf97aa03145de129fb579b5a0e953

Fixes #9783

(cherry picked from commit d855725965109536abed5754fa90f9ba5661b244)
---
 share/completions/dnf.fish | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/share/completions/dnf.fish b/share/completions/dnf.fish
index 6fe15bb57..67723adee 100644
--- a/share/completions/dnf.fish
+++ b/share/completions/dnf.fish
@@ -3,7 +3,7 @@
 #
 
 function __dnf_list_installed_packages
-    dnf repoquery --cacheonly "$cur*" --qf "%{NAME}" --installed </dev/null
+    dnf repoquery --cacheonly "$cur*" --qf "%{name}" --installed </dev/null
 end
 
 function __dnf_list_available_packages
@@ -26,7 +26,7 @@ function __dnf_list_available_packages
     else
         # In some cases dnf will ask for input (e.g. to accept gpg keys).
         # Connect it to /dev/null to try to stop it.
-        set results (dnf repoquery --cacheonly "$tok*" --qf "%{NAME}" --available </dev/null 2>/dev/null)
+        set results (dnf repoquery --cacheonly "$tok*" --qf "%{name}" --available </dev/null 2>/dev/null)
     end
     if set -q results[1]
         set results (string match -r -- '.*\\.rpm$' $files) $results

From 158e9b682906747179d3e40bf3d16cf0f51ecbe9 Mon Sep 17 00:00:00 2001
From: Fabian Boehm <FHomborg@gmail.com>
Date: Fri, 12 May 2023 16:35:05 +0200
Subject: [PATCH 038/200] create_manpage_completions: Also clear
 already_output_completions

Prevents issues if we try to read a manpage twice - in which case we
could fall back to another parser, creating different results.

Fixes #9787

(cherry picked from commit 5f672ece84d9583ad75e6fb61a84338057a18d19)
---
 share/tools/create_manpage_completions.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/share/tools/create_manpage_completions.py b/share/tools/create_manpage_completions.py
index 8605a16f0..7093f639d 100755
--- a/share/tools/create_manpage_completions.py
+++ b/share/tools/create_manpage_completions.py
@@ -837,6 +837,8 @@ def parse_manpage_at_path(manpage_path, output_directory):
 
     # Clear the output list
     built_command_output[:] = []
+    global already_output_completions
+    already_output_completions = {}
 
     if DEROFF_ONLY:
         parsers = [TypeDeroffManParser()]

From 40b0a744e972bac97386d4fd1fce6af79e96725e Mon Sep 17 00:00:00 2001
From: Thomas Klausner <wiz@gatalith.at>
Date: Tue, 16 May 2023 22:02:11 +0200
Subject: [PATCH 039/200] When using curses, look for libterminfo as well.
 (#9794)

Supports NetBSD, where libtinfo isn't available but libterminfo is.

(cherry picked from commit 67d1d80f94107e26585d192d194295180cb9f73b)
---
 cmake/ConfigureChecks.cmake | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/cmake/ConfigureChecks.cmake b/cmake/ConfigureChecks.cmake
index b2b47c0d3..59f9b5a5a 100644
--- a/cmake/ConfigureChecks.cmake
+++ b/cmake/ConfigureChecks.cmake
@@ -79,6 +79,12 @@ list(APPEND CMAKE_REQUIRED_INCLUDES ${CURSES_INCLUDE_DIRS})
 find_library(CURSES_TINFO tinfo)
 if (CURSES_TINFO)
     set(CURSES_LIBRARY ${CURSES_LIBRARY} ${CURSES_TINFO})
+else()
+    # on NetBSD, libtinfo has a longer name (libterminfo)
+    find_library(CURSES_TINFO terminfo)
+    if (CURSES_TINFO)
+        set(CURSES_LIBRARY ${CURSES_LIBRARY} ${CURSES_TINFO})
+    endif()
 endif()
 
 # Get threads.

From 513e29f7b678d861e2180bb34d7cc99cdaaaf02c Mon Sep 17 00:00:00 2001
From: Fabian Boehm <FHomborg@gmail.com>
Date: Sun, 21 May 2023 10:02:26 +0200
Subject: [PATCH 040/200] completions/systemctl: Add some missing commands

Fixes #9804

(cherry picked from commit aac30367bf5d6ea497371402c71514ff94709533)
---
 share/completions/systemctl.fish      | 11 ++++++++++-
 share/functions/__fish_systemctl.fish |  4 ++--
 2 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/share/completions/systemctl.fish b/share/completions/systemctl.fish
index 2a1c6467e..833394ffd 100644
--- a/share/completions/systemctl.fish
+++ b/share/completions/systemctl.fish
@@ -4,7 +4,8 @@ set -l commands list-units list-sockets start stop reload restart try-restart re
     reset-failed list-unit-files enable disable is-enabled reenable preset mask unmask link load list-jobs cancel dump \
     list-dependencies snapshot delete daemon-reload daemon-reexec show-environment set-environment unset-environment \
     default rescue emergency halt poweroff reboot kexec exit suspend hibernate hybrid-sleep switch-root list-timers \
-    set-property import-environment
+    set-property import-environment get-default list-automounts is-system-running try-reload-or-restart freeze \
+    thaw mount-image bind clean
 if test $systemd_version -gt 208 2>/dev/null
     set commands $commands cat
     if test $systemd_version -gt 217 2>/dev/null
@@ -30,12 +31,20 @@ complete -f -c systemctl -n "not __fish_seen_subcommand_from $commands" -a "$com
 complete -f -c systemctl -n "not __fish_seen_subcommand_from $commands" -a start -d 'Start one or more units'
 complete -f -c systemctl -n "not __fish_seen_subcommand_from $commands" -a stop -d 'Stop one or more units'
 complete -f -c systemctl -n "not __fish_seen_subcommand_from $commands" -a restart -d 'Restart one or more units'
+complete -f -c systemctl -n "not __fish_seen_subcommand_from $commands" -a reload-or-restart -d 'Reload units if supported or restart them'
+complete -f -c systemctl -n "not __fish_seen_subcommand_from $commands" -a try-reload-or-restart -d 'Reload units if supported or restart them, if running'
 complete -f -c systemctl -n "not __fish_seen_subcommand_from $commands" -a status -d 'Runtime status about one or more units'
 complete -f -c systemctl -n "not __fish_seen_subcommand_from $commands" -a enable -d 'Enable one or more units'
 complete -f -c systemctl -n "not __fish_seen_subcommand_from $commands" -a disable -d 'Disable one or more units'
 complete -f -c systemctl -n "not __fish_seen_subcommand_from $commands" -a isolate -d 'Start a unit and dependencies and disable all others'
 complete -f -c systemctl -n "not __fish_seen_subcommand_from $commands" -a set-default -d 'Set the default target to boot into'
+complete -f -c systemctl -n "not __fish_seen_subcommand_from $commands" -a get-default -d 'Show the default target to boot into'
 complete -f -c systemctl -n "not __fish_seen_subcommand_from $commands" -a set-property -d 'Sets one or more properties of a unit'
+complete -f -c systemctl -n "not __fish_seen_subcommand_from $commands" -a list-automounts -d 'List automount units'
+complete -f -c systemctl -n "not __fish_seen_subcommand_from $commands" -a is-system-running -d 'Return if system is running/starting/degraded'
+complete -f -c systemctl -n "not __fish_seen_subcommand_from $commands" -a freeze -d 'Freeze units with the cgroup freezer'
+complete -f -c systemctl -n "not __fish_seen_subcommand_from $commands" -a thaw -d 'Unfreeze frozen units'
+complete -f -c systemctl -n "not __fish_seen_subcommand_from $commands" -a clean -d 'Remove config/state/logs for the given units'
 
 # Command completion done via argparse.
 complete -c systemctl -a '(__fish_systemctl)' -f
diff --git a/share/functions/__fish_systemctl.fish b/share/functions/__fish_systemctl.fish
index 6d8a05203..ed3f78428 100644
--- a/share/functions/__fish_systemctl.fish
+++ b/share/functions/__fish_systemctl.fish
@@ -30,7 +30,7 @@ function __fish_systemctl --description 'Call systemctl with some options from t
         # These are the normal commands, so just complete all units.
         # For "restart" et al, also complete non-running ones, since it can be used regardless of state.
         case reenable status reload {try-,}{reload-or-,}restart is-{active,enabled,failed} show cat \
-            help reset-failed list-dependencies list-units revert add-{wants,requires} edit
+            help reset-failed list-dependencies list-units revert add-{wants,requires} edit clean thaw
         case enable
             # This will only work for "list-unit-files", but won't print an error for "list-units".
             set -q _flag_state; or set _flag_state disabled
@@ -43,7 +43,7 @@ function __fish_systemctl --description 'Call systemctl with some options from t
             set -q _flag_state; or set _flag_state loaded
         case unmask
             set -q _flag_state; or set _flag_state masked
-        case stop kill
+        case stop kill freeze
             # TODO: Is "kill" useful on other unit types?
             # Running as the catch-all, "mounted" for .mount units, "active" for .target.
             set -q _flag_state; or set _flag_state running,mounted,active

From 66399b9a32e1862116a9bd768c5916650f46b7a2 Mon Sep 17 00:00:00 2001
From: Wenhao Ho <wh.ho@outlook.com>
Date: Tue, 23 May 2023 15:08:05 +0900
Subject: [PATCH 041/200] feat: sync the dracula official theme

Signed-off-by: Wenhao Ho <wh.ho@outlook.com>
(cherry picked from commit 201610151f00d6524aaac4521375631bac4f2f2e)
---
 share/tools/web_config/themes/Dracula.theme | 72 +++++++++++++--------
 1 file changed, 46 insertions(+), 26 deletions(-)

diff --git a/share/tools/web_config/themes/Dracula.theme b/share/tools/web_config/themes/Dracula.theme
index f5a6d7280..f2708cf49 100644
--- a/share/tools/web_config/themes/Dracula.theme
+++ b/share/tools/web_config/themes/Dracula.theme
@@ -1,33 +1,53 @@
 # name: 'Dracula'
 # preferred_background: 282a36
+#
+# Foreground: f8f8f2
+# Selection: 44475a
+# Comment: 6272a4
+# Red: ff5555
+# Orange: ffb86c
+# Yellow: f1fa8c
+# Green: 50fa7b
+# Purple: bd93f9
+# Cyan: 8be9fd
+# Pink: ff79c6
 
-fish_color_normal normal
-fish_color_command F8F8F2
-fish_color_quote F1FA8C
-fish_color_redirection 8BE9FD
-fish_color_end 50FA7B
-fish_color_error FFB86C
-fish_color_param FF79C6
-fish_color_comment 6272A4
+fish_color_normal f8f8f2
+fish_color_command 8be9fd
+fish_color_quote f1fa8c
+fish_color_redirection f8f8f2
+fish_color_end ffb86c
+fish_color_error ff5555
+fish_color_param bd93f9
+fish_color_comment 6272a4
 fish_color_match --background=brblue
-fish_color_selection white --bold --background=brblack
-fish_color_search_match bryellow --background=brblack
+fish_color_selection --background=44475a
+fish_color_search_match --background=44475a
 fish_color_history_current --bold
-fish_color_operator 00a6b2
-fish_color_escape 00a6b2
-fish_color_cwd green
+fish_color_operator 50fa7b
+fish_color_escape ff79c6
+fish_color_cwd 50fa7b
 fish_color_cwd_root red
 fish_color_valid_path --underline
-fish_color_autosuggestion BD93F9
-fish_color_user brgreen
-fish_color_host normal
-fish_color_cancel -r
-fish_pager_color_completion normal
-fish_pager_color_description B3A06D yellow
-fish_pager_color_prefix normal --bold --underline
-fish_pager_color_progress brwhite --background=cyan
-fish_pager_color_selected_background --background=brblack
-fish_color_option FF79C6
-fish_color_keyword F8F8F2
-fish_color_host_remote yellow
-fish_color_status red
+fish_color_autosuggestion 6272a4
+fish_color_user 8be9fd
+fish_color_host bd93f9
+fish_color_cancel ff5555 --reverse
+fish_pager_color_completion f8f8f2
+fish_pager_color_description 6272a4
+fish_pager_color_prefix 8be9fd
+fish_pager_color_progress 6272a4
+fish_pager_color_selected_background --background=44475a
+fish_color_option ffb86c
+fish_color_keyword ff79c6
+fish_color_host_remote bd93f9
+fish_color_status ff5555
+
+fish_pager_color_background
+fish_pager_color_selected_prefix 8be9fd
+fish_pager_color_selected_completion f8f8f2
+fish_pager_color_selected_description 6272a4
+fish_pager_color_secondary_background
+fish_pager_color_secondary_prefix 8be9fd
+fish_pager_color_secondary_completion f8f8f2
+fish_pager_color_secondary_description 6272a4

From 7f8d56da16756f6a2c4e2601376b60d4029f40ad Mon Sep 17 00:00:00 2001
From: David Adam <zanchey@ucc.gu.uwa.edu.au>
Date: Thu, 25 May 2023 21:30:30 +0800
Subject: [PATCH 042/200] Licensing: note MIT licensing status of Dracula theme

(cherry picked from commit 4e13b1b5d503f8f9e2a9a58dfec509f1a678dfd5)
---
 COPYING                                     |   5 +-
 doc_src/license.rst                         | 218 ++++++++++++++++++++
 share/tools/web_config/themes/Dracula.theme |   1 +
 3 files changed, 222 insertions(+), 2 deletions(-)

diff --git a/COPYING b/COPYING
index 6d7be3d85..448c5b46d 100644
--- a/COPYING
+++ b/COPYING
@@ -9,8 +9,9 @@ Most of fish is licensed under the GNU General Public License version 2, and
 you can redistribute it and/or modify it under the terms of the GNU GPL as
 published by the Free Software Foundation.
 
-fish also includes software licensed under the GNU Lesser General Public
-License version 2, the OpenBSD license, the ISC license, and the NetBSD license.
+fish also includes software licensed under the CMake license, the Python
+Software Foundation License version 2, the OpenBSD license, the ISC license,
+the NetBSD license, and the MIT license.
 
 Full licensing information is contained in doc_src/license.rst.
 
diff --git a/doc_src/license.rst b/doc_src/license.rst
index 5e503768f..49b9a00ea 100644
--- a/doc_src/license.rst
+++ b/doc_src/license.rst
@@ -175,3 +175,221 @@ products or services of Licensee, or any third party.
 8. By copying, installing or otherwise using Python, Licensee
 agrees to be bound by the terms and conditions of this License
 Agreement.
+
+----
+
+**License for CMake**
+
+The ``fish`` source code contains files from [CMake](https://cmake.org) to support the build system.
+This code is distributed under the terms of a BSD-style license. Copyright 2000-2017 Kitware, Inc.
+and Contributors.
+
+The BSD license for CMake follows.
+
+CMake - Cross Platform Makefile Generator
+Copyright 2000-2017 Kitware, Inc. and Contributors
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+* Redistributions of source code must retain the above copyright
+  notice, this list of conditions and the following disclaimer.
+
+* Redistributions in binary form must reproduce the above copyright
+  notice, this list of conditions and the following disclaimer in the
+  documentation and/or other materials provided with the distribution.
+
+* Neither the name of Kitware, Inc. nor the names of Contributors
+  may be used to endorse or promote products derived from this
+  software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+----
+
+**License for code derived from tmux**
+
+``fish`` contains code from [tmux](http://tmux.sourceforge.net), copyrighted by Nicholas Marriott <nicm@users.sourceforge.net> (2007), and made available under the OpenBSD license.
+
+The OpenBSD license is included below.
+
+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.
+
+----
+
+**License for UTF8**
+
+``fish`` also contains small amounts of code under the ISC license, namely the UTF-8 conversion functions. This code is copyright © 2007 Alexey Vatchenko \<av@bsdua.org>.
+
+The ISC license agreement follows.
+
+Permission to use, copy, modify, and/or 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.
+
+----
+
+**License for flock**
+
+``fish`` also contains small amounts of code from NetBSD, namely the ``flock`` fallback function. This code is copyright 2001 The NetBSD Foundation, Inc., and derived from software contributed to The NetBSD Foundation by Todd Vierling.
+
+The NetBSD license follows.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
+
+----
+
+**MIT License**
+
+``fish`` includes a copy of AngularJS, which is copyright 2010-2012 Google, Inc. and licensed under the MIT License.
+
+The MIT license follows.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+----
+
+**License for CMake**
+
+The ``fish`` source code contains files from [CMake](https://cmake.org) to support the build system.
+This code is distributed under the terms of a BSD-style license. Copyright 2000-2017 Kitware, Inc.
+and Contributors.
+
+The BSD license for CMake follows.
+
+CMake - Cross Platform Makefile Generator
+Copyright 2000-2017 Kitware, Inc. and Contributors
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+* Redistributions of source code must retain the above copyright
+  notice, this list of conditions and the following disclaimer.
+
+* Redistributions in binary form must reproduce the above copyright
+  notice, this list of conditions and the following disclaimer in the
+  documentation and/or other materials provided with the distribution.
+
+* Neither the name of Kitware, Inc. nor the names of Contributors
+  may be used to endorse or promote products derived from this
+  software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+----
+
+**License for code derived from tmux**
+
+``fish`` contains code from [tmux](http://tmux.sourceforge.net), copyrighted by Nicholas Marriott <nicm@users.sourceforge.net> (2007), and made available under the OpenBSD license.
+
+The OpenBSD license is included below.
+
+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.
+
+----
+
+**License for UTF8**
+
+``fish`` also contains small amounts of code under the ISC license, namely the UTF-8 conversion functions. This code is copyright © 2007 Alexey Vatchenko \<av@bsdua.org>.
+
+The ISC license agreement follows.
+
+Permission to use, copy, modify, and/or 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.
+
+----
+
+**License for flock**
+
+``fish`` also contains small amounts of code from NetBSD, namely the ``flock`` fallback function. This code is copyright 2001 The NetBSD Foundation, Inc., and derived from software contributed to The NetBSD Foundation by Todd Vierling.
+
+The NetBSD license follows.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
+
+----
+
+**MIT License**
+
+``fish`` includes a copy of AngularJS, which is copyright 2010-2012 Google, Inc. and licensed under the MIT License. It also includes the Dracula theme, which is copyright 2018 Dracula Team, and is licensed under the same license.
+
+The MIT license follows.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/share/tools/web_config/themes/Dracula.theme b/share/tools/web_config/themes/Dracula.theme
index f2708cf49..ad6fd6d44 100644
--- a/share/tools/web_config/themes/Dracula.theme
+++ b/share/tools/web_config/themes/Dracula.theme
@@ -1,4 +1,5 @@
 # name: 'Dracula'
+# license: 'MIT'
 # preferred_background: 282a36
 #
 # Foreground: f8f8f2

From 2316676019a9d82e05be0ea199dfe0e45c434f99 Mon Sep 17 00:00:00 2001
From: Fabian Boehm <FHomborg@gmail.com>
Date: Fri, 26 May 2023 14:01:52 +0200
Subject: [PATCH 043/200] create_manpage_completions: Use raw strings for
 backslashes

python 3.12 emits a SyntaxWarning for invalid escape sequences.

Fixes #9814

(cherry picked from commit 2eba6845c2fad889693ce94cd3222380e0989a9d)
---
 share/tools/create_manpage_completions.py | 51 ++++++++++++-----------
 1 file changed, 26 insertions(+), 25 deletions(-)

diff --git a/share/tools/create_manpage_completions.py b/share/tools/create_manpage_completions.py
index 7093f639d..b3c620288 100755
--- a/share/tools/create_manpage_completions.py
+++ b/share/tools/create_manpage_completions.py
@@ -245,7 +245,7 @@ def remove_groff_formatting(data):
     data = data.replace("\\fB", "")
     data = data.replace("\\fR", "")
     data = data.replace("\\e", "")
-    data = re.sub(".PD( \d+)", "", data)
+    data = re.sub(r".PD( \d+)", "", data)
     data = data.replace(".BI", "")
     data = data.replace(".BR", "")
     data = data.replace("0.5i", "")
@@ -253,14 +253,14 @@ def remove_groff_formatting(data):
     data = data.replace("\\^", "")
     data = data.replace("{ ", "")
     data = data.replace(" }", "")
-    data = data.replace("\ ", "")
-    data = data.replace("\-", "-")
-    data = data.replace("\&", "")
+    data = data.replace(r"\ ", "")
+    data = data.replace(r"\-", "-")
+    data = data.replace(r"\&", "")
     data = data.replace(".B", "")
-    data = data.replace("\-", "-")
+    data = data.replace(r"\-", "-")
     data = data.replace(".I", "")
     data = data.replace("\f", "")
-    data = data.replace("\(cq", "'")
+    data = data.replace(r"\(cq", "'")
     return data
 
 
@@ -274,13 +274,13 @@ class ManParser(object):
 
 class Type1ManParser(ManParser):
     def is_my_type(self, manpage):
-        return compile_and_search('\.SH "OPTIONS"(.*?)', manpage) is not None
+        return compile_and_search(r'\.SH "OPTIONS"(.*?)', manpage) is not None
 
     def parse_man_page(self, manpage):
-        options_section_regex = re.compile('\.SH "OPTIONS"(.*?)(\.SH|\Z)', re.DOTALL)
+        options_section_regex = re.compile(r'\.SH "OPTIONS"(.*?)(\.SH|\Z)', re.DOTALL)
         options_section = re.search(options_section_regex, manpage).group(1)
 
-        options_parts_regex = re.compile("\.PP(.*?)\.RE", re.DOTALL)
+        options_parts_regex = re.compile(r"\.PP(.*?)\.RE", re.DOTALL)
         options_matched = re.search(options_parts_regex, options_section)
         add_diagnostic("Command is %r" % CMDNAME)
 
@@ -320,7 +320,7 @@ class Type1ManParser(ManParser):
 
     def fallback(self, options_section):
         add_diagnostic("Trying fallback")
-        options_parts_regex = re.compile("\.TP( \d+)?(.*?)\.TP", re.DOTALL)
+        options_parts_regex = re.compile(r"\.TP( \d+)?(.*?)\.TP", re.DOTALL)
         options_matched = re.search(options_parts_regex, options_section)
         if options_matched is None:
             add_diagnostic("Still not found")
@@ -349,9 +349,9 @@ class Type1ManParser(ManParser):
 
     def fallback2(self, options_section):
         add_diagnostic("Trying last chance fallback")
-        ix_remover_regex = re.compile("\.IX.*")
+        ix_remover_regex = re.compile(r"\.IX.*")
         trailing_num_regex = re.compile("\\d+$")
-        options_parts_regex = re.compile("\.IP (.*?)\.IP", re.DOTALL)
+        options_parts_regex = re.compile(r"\.IP (.*?)\.IP", re.DOTALL)
 
         options_section = re.sub(ix_remover_regex, "", options_section)
         options_matched = re.search(options_parts_regex, options_section)
@@ -386,14 +386,14 @@ class Type1ManParser(ManParser):
 
 class Type2ManParser(ManParser):
     def is_my_type(self, manpage):
-        return compile_and_search("\.SH OPTIONS(.*?)", manpage) is not None
+        return compile_and_search(r"\.SH OPTIONS(.*?)", manpage) is not None
 
     def parse_man_page(self, manpage):
-        options_section_regex = re.compile("\.SH OPTIONS(.*?)(\.SH|\Z)", re.DOTALL)
+        options_section_regex = re.compile(r"\.SH OPTIONS(.*?)(\.SH|\Z)", re.DOTALL)
         options_section = re.search(options_section_regex, manpage).group(1)
 
         options_parts_regex = re.compile(
-            "\.[IT]P( \d+(\.\d)?i?)?(.*?)\.([IT]P|UNINDENT|UN|SH)", re.DOTALL
+            r"\.[IT]P( \d+(\.\d)?i?)?(.*?)\.([IT]P|UNINDENT|UN|SH)", re.DOTALL
         )
         options_matched = re.search(options_parts_regex, options_section)
         add_diagnostic("Command is %r" % CMDNAME)
@@ -426,13 +426,13 @@ class Type2ManParser(ManParser):
 
 class Type3ManParser(ManParser):
     def is_my_type(self, manpage):
-        return compile_and_search("\.SH DESCRIPTION(.*?)", manpage) != None
+        return compile_and_search(r"\.SH DESCRIPTION(.*?)", manpage) != None
 
     def parse_man_page(self, manpage):
-        options_section_regex = re.compile("\.SH DESCRIPTION(.*?)(\.SH|\Z)", re.DOTALL)
+        options_section_regex = re.compile(r"\.SH DESCRIPTION(.*?)(\.SH|\Z)", re.DOTALL)
         options_section = re.search(options_section_regex, manpage).group(1)
 
-        options_parts_regex = re.compile("\.TP(.*?)\.TP", re.DOTALL)
+        options_parts_regex = re.compile(r"\.TP(.*?)\.TP", re.DOTALL)
         options_matched = re.search(options_parts_regex, options_section)
         add_diagnostic("Command is %r" % CMDNAME)
 
@@ -467,15 +467,15 @@ class Type3ManParser(ManParser):
 
 class Type4ManParser(ManParser):
     def is_my_type(self, manpage):
-        return compile_and_search("\.SH FUNCTION LETTERS(.*?)", manpage) != None
+        return compile_and_search(r"\.SH FUNCTION LETTERS(.*?)", manpage) != None
 
     def parse_man_page(self, manpage):
         options_section_regex = re.compile(
-            "\.SH FUNCTION LETTERS(.*?)(\.SH|\Z)", re.DOTALL
+            r"\.SH FUNCTION LETTERS(.*?)(\.SH|\Z)", re.DOTALL
         )
         options_section = re.search(options_section_regex, manpage).group(1)
 
-        options_parts_regex = re.compile("\.TP(.*?)\.TP", re.DOTALL)
+        options_parts_regex = re.compile(r"\.TP(.*?)\.TP", re.DOTALL)
         options_matched = re.search(options_parts_regex, options_section)
         add_diagnostic("Command is %r" % CMDNAME)
 
@@ -518,7 +518,7 @@ class TypeScdocManParser(ManParser):
         )
 
     def parse_man_page(self, manpage):
-        options_section_regex = re.compile("\.SH OPTIONS(.*?)\.SH", re.DOTALL)
+        options_section_regex = re.compile(r"\.SH OPTIONS(.*?)\.SH", re.DOTALL)
         options_section_matched = re.search(options_section_regex, manpage)
         if options_section_matched is None:
             return False
@@ -568,14 +568,14 @@ class TypeScdocManParser(ManParser):
 
 class TypeDarwinManParser(ManParser):
     def is_my_type(self, manpage):
-        return compile_and_search("\.S[hH] DESCRIPTION", manpage) is not None
+        return compile_and_search(r"\.S[hH] DESCRIPTION", manpage) is not None
 
     def trim_groff(self, line):
         # Remove initial period
         if line.startswith("."):
             line = line[1:]
         # Skip leading groff crud
-        while re.match("[A-Z][a-z]\s", line):
+        while re.match(r"[A-Z][a-z]\s", line):
             line = line[3:]
 
         # If the line ends with a space and then a period or comma, then erase the space
@@ -600,7 +600,8 @@ class TypeDarwinManParser(ManParser):
     def groff_replace_escapes(self, line):
         line = line.replace(".Nm", CMDNAME)
         line = line.replace("\\ ", " ")
-        line = line.replace("\& ", "")
+        line = line.replace(r"\& ", "")
+        line = line.replace(".Pp", "")
         return line
 
     def is_option(self, line):

From 2292d30a7386222c6cd8125029df4e9e9498e1bf Mon Sep 17 00:00:00 2001
From: "Kevin F. Konrad" <kevin.konrad@skillbyte.de>
Date: Fri, 26 May 2023 11:34:19 +0200
Subject: [PATCH 044/200] implement completion for age and age-keygen

(cherry picked from commit ffb616822153fc77f78c221afd8459638aa0e54e)
---
 share/completions/age-keygen.fish | 3 +++
 share/completions/age.fish        | 9 +++++++++
 2 files changed, 12 insertions(+)
 create mode 100644 share/completions/age-keygen.fish
 create mode 100644 share/completions/age.fish

diff --git a/share/completions/age-keygen.fish b/share/completions/age-keygen.fish
new file mode 100644
index 000000000..49d4707a4
--- /dev/null
+++ b/share/completions/age-keygen.fish
@@ -0,0 +1,3 @@
+complete -c age-keygen -s o -l output -n "not __fish_contains_opt -s o output" -d "output file for secret key"
+complete -c age-keygen -s y -n "not __fish_contains_opt -s y" -d "read identity file, print recipient(s)"
+complete -c age -l version -d "print version number"
diff --git a/share/completions/age.fish b/share/completions/age.fish
new file mode 100644
index 000000000..c5cce228c
--- /dev/null
+++ b/share/completions/age.fish
@@ -0,0 +1,9 @@
+complete -c age -s e -l encrypt -n "not __fish_contains_opt -s d decrypt" -d "encrypt"
+complete -c age -s r -l recipient -n "not __fish_contains_opt -s d decrypt; and not __fish_contains_opt -s p passphrase" -d "public key"
+complete -c age -s R -l recipients-file -n "not __fish_contains_opt -s d decrypt; and not __fish_contains_opt -s p passphrase" -d "file with public key(s)"
+complete -c age -s a -l armor -n "not __fish_contains_opt -s d decrypt" -d "PEM encode ciphertext"
+complete -c age -s p -l passphrase -n "not __fish_contains_opt -s d decrypt; and not __fish_contains_opt -s r recipient -s R recipients-file" -d "passphrase"
+complete -c age -s d -l decrypt -n "not __fish_contains_opt -s e encrypt" -d "decrypt"
+complete -c age -s i -l identity -n "__fish_contains_opt -s e encrypt -s d decrypt" -d "file with private key(s)"
+complete -c age -s j -n "__fish_contains_opt -s e encrypt -s d decrypt" -d "plugin"
+complete -c age -l version -d "print version number"

From 3d4d0e50c609bc528bb7e346c00326a1109e86bc Mon Sep 17 00:00:00 2001
From: may <63159454+m4rch3n1ng@users.noreply.github.com>
Date: Tue, 30 May 2023 11:21:00 +0200
Subject: [PATCH 045/200] add completions for `git update-index` (#9759)

* add git update-index completions

* remove todo

* fix leftover from copying lines

* improve and shorten

(cherry picked from commit 6b1e6dd17920e47b85a1f6d716191fa987742fb0)
---
 share/completions/git.fish | 37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/share/completions/git.fish b/share/completions/git.fish
index e1e02a6d1..ad4251600 100644
--- a/share/completions/git.fish
+++ b/share/completions/git.fish
@@ -2045,6 +2045,42 @@ complete -f -c git -n '__fish_git_using_command tag' -l contains -xka '(__fish_g
 complete -f -c git -n '__fish_git_using_command tag' -n '__fish_git_contains_opt -s d delete -s v verify -s f force' -ka '(__fish_git_tags)' -d Tag
 # TODO options
 
+### update-index
+complete -c git -n __fish_git_needs_command -a update-index -d 'Register file contents in the working tree to the index'
+complete -f -c git -n '__fish_git_using_command update-index' -l add -d 'Add specified files to the index'
+complete -f -c git -n '__fish_git_using_command update-index' -l remove -d 'Remove specified files from the index'
+complete -f -c git -n '__fish_git_using_command update-index' -l refresh -d 'Refresh current index'
+complete -f -c git -n '__fish_git_using_command update-index' -s q -d 'Continue refresh after error'
+complete -f -c git -n '__fish_git_using_command update-index' -l ignore-submodules -d 'Do not try to update submodules'
+complete -f -c git -n '__fish_git_using_command update-index' -l unmerged -d 'Continue on unmerged changes in the index'
+complete -f -c git -n '__fish_git_using_command update-index' -l ignore-missing -d 'Ignores missing files during a refresh'
+complete -f -c git -n '__fish_git_using_command update-index' -l index-info -d 'Read index information from stdin'
+complete -x -c git -n '__fish_git_using_command update-index' -l chmod -a '+x\tAdd\ execute\ permissions -x\tRemove\ execute\ permissions' -d 'Set execute permissions'
+complete -f -c git -n '__fish_git_using_command update-index' -l assume-unchanged -d 'Set the "assume unchanged" bit for the paths'
+complete -f -c git -n '__fish_git_using_command update-index' -l no-assume-unchanged -d 'Unset the "assume unchanged" bit'
+complete -f -c git -n '__fish_git_using_command update-index' -l really-refresh -d 'Refresh but check stat info unconditionally'
+complete -f -c git -n '__fish_git_using_command update-index' -l skip-worktree -d 'Set the "fsmonitor valid" bit'
+complete -f -c git -n '__fish_git_using_command update-index' -l no-skip-worktree -d 'Unset the "fsmonitor valid" bit'
+complete -f -c git -n '__fish_git_using_command update-index' -l fsmonitor-valid -d 'Set the "fsmonitor valid" bit'
+complete -f -c git -n '__fish_git_using_command update-index' -l no-fsmonitor-valid -d 'Unset the "fsmonitor valid" bit'
+complete -f -c git -n '__fish_git_using_command update-index' -s g -l again -d 'Run git update-index on paths with differing index'
+complete -f -c git -n '__fish_git_using_command update-index' -l unresolve -d 'Restores the state of a file during a merge'
+complete -r -c git -n '__fish_git_using_command update-index' -l info-only -d 'Do not create objects in the object database'
+complete -f -c git -n '__fish_git_using_command update-index' -l force-remove -d 'Forcefully remove the file from the index'
+complete -f -c git -n '__fish_git_using_command update-index' -l replace -d 'Replace conflicting entries'
+complete -f -c git -n '__fish_git_using_command update-index' -l stdin -d 'Read list of paths from stdin'
+complete -f -c git -n '__fish_git_using_command update-index' -l verbose -d 'Report changes to index'
+complete -x -c git -n '__fish_git_using_command update-index' -l index-version -a "2\t\t3\t\t4" -d 'Set index-version'
+complete -f -c git -n '__fish_git_using_command update-index' -s z -d 'Seperate paths with NUL instead of LF'
+complete -f -c git -n '__fish_git_using_command update-index' -l split-index -d 'Enable split index mode'
+complete -f -c git -n '__fish_git_using_command update-index' -l no-split-index -d 'Disable split index mode'
+complete -f -c git -n '__fish_git_using_command update-index' -l untracked-cache -d 'Enable untracked cache feature'
+complete -f -c git -n '__fish_git_using_command update-index' -l no-untracked-cache -d 'Disable untracked cache feature'
+complete -f -c git -n '__fish_git_using_command update-index' -l test-untracked-cache -d 'Only perform tests on the working directory'
+complete -f -c git -n '__fish_git_using_command update-index' -l force-untracked-cache -d 'Same as --untracked-cache'
+complete -f -c git -n '__fish_git_using_command update-index' -l fsmonitor -d 'Enable files system monitor feature'
+complete -f -c git -n '__fish_git_using_command update-index' -l no-fsmonitor -d 'Disable files system monitor feature'
+
 ### worktree
 set -l git_worktree_commands add list lock move prune remove unlock
 complete -c git -n __fish_git_needs_command -a worktree -d 'Manage multiple working trees'
@@ -2278,6 +2314,7 @@ complete -f -c git -n '__fish_git_using_command help' -a submodule -d 'Initializ
 complete -f -c git -n '__fish_git_using_command help' -a stripspace -d 'Remove unnecessary whitespace'
 complete -f -c git -n '__fish_git_using_command help' -a switch -d 'Switch to a branch'
 complete -f -c git -n '__fish_git_using_command help' -a tag -d 'Create, list, delete or verify a tag object signed with GPG'
+complete -f -c git -n '__fish_git_using_command help' -a update-index -d 'Register file contents in the working tree to the index'
 complete -f -c git -n '__fish_git_using_command help' -a whatchanged -d 'Show logs with difference each commit introduces'
 complete -f -c git -n '__fish_git_using_command help' -a worktree -d 'Manage multiple working trees'
 

From 47c90bf5cdc0825870653a4fc2f77d3bab782ffc Mon Sep 17 00:00:00 2001
From: Jo <10510431+j178@users.noreply.github.com>
Date: Fri, 2 Jun 2023 11:42:33 +0800
Subject: [PATCH 046/200] Fix a typo in `language.rst`

(cherry picked from commit 272d123431a599e5ce80fdf08ab34def52ebcc7d)
---
 doc_src/language.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc_src/language.rst b/doc_src/language.rst
index cc7bd2203..87427b328 100644
--- a/doc_src/language.rst
+++ b/doc_src/language.rst
@@ -1912,7 +1912,7 @@ To specify a signal handler for the WINCH signal, write::
         echo Got WINCH signal!
     end
 
-Fish already the following named events for the ``--on-event`` switch:
+Fish already has the following named events for the ``--on-event`` switch:
 
 - ``fish_prompt`` is emitted whenever a new fish prompt is about to be displayed.
 

From feccbeeee78c5be33a05e7facec7edd7ffdfa32b Mon Sep 17 00:00:00 2001
From: Zehka <git@zehka.net>
Date: Thu, 1 Jun 2023 17:05:13 +0200
Subject: [PATCH 047/200] added some german translations

(cherry picked from commit b5fae430c0266468ca280d2001914190b375c672)
---
 po/de.po | 163 +++++++++++++++++++++++++++----------------------------
 1 file changed, 79 insertions(+), 84 deletions(-)

diff --git a/po/de.po b/po/de.po
index 82b7cc4c8..cda22c8fb 100644
--- a/po/de.po
+++ b/po/de.po
@@ -4,33 +4,19 @@
 # Hermann J. Beckers <hj.beckers@onlinehome.de>, 2006.
 # Benjamin Weis <benjamin.weis@gmx.com>, 2013
 #
-#: /tmp/fish.i8YroE/implicit/share/completions/exif.fish:1
-#: /tmp/fish.i8YroE/implicit/share/completions/exif.fish:2
-#: /tmp/fish.i8YroE/implicit/share/completions/exif.fish:3
-#: /tmp/fish.i8YroE/implicit/share/completions/exif.fish:4
-#: /tmp/fish.i8YroE/implicit/share/completions/exif.fish:5
-#: /tmp/fish.i8YroE/implicit/share/completions/meson.fish:1
-#: /tmp/fish.i8YroE/implicit/share/completions/meson.fish:2
-#: /tmp/fish.i8YroE/implicit/share/completions/meson.fish:3
-#: /tmp/fish.i8YroE/implicit/share/completions/rustc.fish:3
-#: /tmp/fish.i8YroE/implicit/share/completions/rustc.fish:4
-#: /tmp/fish.i8YroE/implicit/share/completions/rustc.fish:5
-#: /tmp/fish.i8YroE/implicit/share/completions/rustc.fish:6
-#: /tmp/fish.i8YroE/implicit/share/completions/rustc.fish:7
-#: /tmp/fish.i8YroE/implicit/share/completions/rustc.fish:8
 msgid ""
 msgstr ""
 "Project-Id-Version: de\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2022-12-23 11:20+0100\n"
-"PO-Revision-Date: 2013-11-01 18:36+0100\n"
+"PO-Revision-Date: 2023-06-01 16:49+0200\n"
 "Last-Translator: Fabian Homborg\n"
 "Language-Team: deutsch <de@li.org>\n"
-"Language: \n"
+"Language: de\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
-"X-Generator: Lokalize 1.5\n"
+"X-Generator: Poedit 3.3.1\n"
 
 #: src/ast.cpp:685 src/ast.cpp:706
 #, c-format
@@ -164,7 +150,7 @@ msgstr "Die Anzahl Argumente zählen"
 
 #: src/builtin.cpp:376
 msgid "Remove job from job list"
-msgstr ""
+msgstr "Auftrag aus der Auftragsliste entfernen"
 
 #: src/builtin.cpp:377
 msgid "Print arguments"
@@ -176,7 +162,7 @@ msgstr "Werte Block aus, wenn die Bedingung falsch ist"
 
 #: src/builtin.cpp:379
 msgid "Emit an event"
-msgstr ""
+msgstr "Ein Event auslösen"
 
 #: src/builtin.cpp:380
 msgid "End a block of commands"
@@ -184,7 +170,7 @@ msgstr "Befehlsblock beenden"
 
 #: src/builtin.cpp:381
 msgid "Evaluate a string as a statement"
-msgstr ""
+msgstr "Eine Zeichenfolge als Befehl ausführen"
 
 #: src/builtin.cpp:382
 msgid "Run command in current process"
@@ -228,7 +214,7 @@ msgstr "Derzeit laufende Jobs ausgeben"
 
 #: src/builtin.cpp:392
 msgid "Evaluate math expressions"
-msgstr ""
+msgstr "Mathematische Formel ausführen"
 
 #: src/builtin.cpp:393
 msgid "Negate exit status of job"
@@ -240,15 +226,15 @@ msgstr "Befehl ausführen, wenn vorheriger Befehl fehlerhaft war"
 
 #: src/builtin.cpp:395
 msgid "Handle paths"
-msgstr ""
+msgstr "Pfade behandeln"
 
 #: src/builtin.cpp:396
 msgid "Prints formatted text"
-msgstr ""
+msgstr "Formatierten Text ausgeben"
 
 #: src/builtin.cpp:397
 msgid "Print the working directory"
-msgstr ""
+msgstr "Das Arbeitsverzeichnis ausgeben"
 
 #: src/builtin.cpp:398
 msgid "Generate random number"
@@ -260,7 +246,7 @@ msgstr "Eine Eingabezeile in Variablen einlesen"
 
 #: src/builtin.cpp:400
 msgid "Show absolute path sans symlinks"
-msgstr ""
+msgstr "Absoluten Pfad ohne Symlinks anzeigen"
 
 #: src/builtin.cpp:401
 msgid "Stop the currently evaluated function"
@@ -284,11 +270,11 @@ msgstr "Strings manipulieren"
 
 #: src/builtin.cpp:407
 msgid "Conditionally run blocks of code"
-msgstr ""
+msgstr "Anweisungsblock Bedingungsabhängig ausführen"
 
 #: src/builtin.cpp:409
 msgid "Measure how long a command or block takes"
-msgstr ""
+msgstr "Dauer der Ausführung eines Befehls oder Blocks messen"
 
 #: src/builtin.cpp:411
 msgid "Check if a thing is a thing"
@@ -296,11 +282,11 @@ msgstr ""
 
 #: src/builtin.cpp:412
 msgid "Get/set resource usage limits"
-msgstr ""
+msgstr "Ressourcen-Limits abfragen/setzen"
 
 #: src/builtin.cpp:413
 msgid "Wait for background processes completed"
-msgstr ""
+msgstr "Auf den Abschluss von Hintergrundprozessen warten"
 
 #: src/builtin.cpp:414
 msgid "Perform a command multiple times"
@@ -318,53 +304,56 @@ msgstr "Heimordner für %ls"
 #: src/complete.cpp:63
 #, c-format
 msgid "Variable: %ls"
-msgstr ""
+msgstr "Variable: %ls"
 
 #: src/complete.cpp:66
 #, c-format
 msgid "Abbreviation: %ls"
-msgstr ""
+msgstr "Abkürzung: %ls"
 
 #: src/complete.cpp:1514
 msgid "completion reached maximum recursion depth, possible cycle?"
 msgstr ""
+"Vervollständigung hat die maximale Rekursionstiefe erreicht, möglicher Kreis?"
 
 #: src/env.cpp:1340
 msgid ""
 "Could not determine current working directory. Is your locale set correctly?"
 msgstr ""
+"Das aktuelle Arbeitsverzeichnis konnte nicht bestimmt werden. Ist die "
+"Lokalisierung korrekt eingestellt?"
 
 #: src/env_dispatch.cpp:471
 #, c-format
 msgid "Using fallback terminal type '%s'."
-msgstr ""
+msgstr "Nutze Rückfallterminaltyp '%s'."
 
 #: src/env_dispatch.cpp:474
 #, c-format
 msgid "Could not set up terminal using the fallback terminal type '%s'."
-msgstr ""
+msgstr "Konnte mit dem Rückfallterminaltyp '%s' kein Terminal einrichten."
 
 #: src/env_dispatch.cpp:575
 msgid "Could not set up terminal."
-msgstr ""
+msgstr "Konnte das Terminal nicht einrichten"
 
 #: src/env_dispatch.cpp:577
 msgid "TERM environment variable not set."
-msgstr ""
+msgstr "TERM Umgebungsvariable nicht gesetzt."
 
 #: src/env_dispatch.cpp:579
 #, c-format
 msgid "TERM environment variable set to '%ls'."
-msgstr ""
+msgstr "TERM Umgebungsvariable auf '%ls' gesetzt."
 
 #: src/env_dispatch.cpp:581
 msgid "Check that this terminal type is supported on this system."
-msgstr ""
+msgstr "Überprüfe, ob dieser Terminaltyp auf diesem System unterstützt wird."
 
 #: src/env_universal_common.cpp:425
 #, c-format
 msgid "Unable to write to universal variables file '%ls': %s"
-msgstr ""
+msgstr "Die globale Variablen-Datei '%ls' kann nicht geschrieben werden: %s"
 
 #: src/env_universal_common.cpp:441
 #, c-format
@@ -374,7 +363,7 @@ msgstr "Konnte Datei '%ls' nicht zu '%ls' umbenennen: %s"
 #: src/env_universal_common.cpp:485
 #, c-format
 msgid "Unable to open temporary file '%ls': %s"
-msgstr ""
+msgstr "Die temporäre Date '%ls' kann nicht geöffnet werden: %s"
 
 #: src/env_universal_common.cpp:499
 #, c-format
@@ -386,7 +375,7 @@ msgstr ""
 #: src/env_universal_common.cpp:542
 #, c-format
 msgid "Unable to open universal variable file '%s': %s"
-msgstr ""
+msgstr "Die globale Variablen-Datei '%s' kann nicht geöffnet werden: %s"
 
 #: src/env_universal_common.cpp:920
 #, c-format
@@ -411,12 +400,12 @@ msgstr ""
 #: src/env_universal_common.cpp:1134
 #, c-format
 msgid "Unable to make a pipe for universal variables using '%ls': %s"
-msgstr ""
+msgstr "Kann keine Pipe für die globalen Variablen über '%ls' anlegen: %s"
 
 #: src/env_universal_common.cpp:1142
 #, c-format
 msgid "Unable to open a pipe for universal variables using '%ls': %s"
-msgstr ""
+msgstr "Kann keine Pipe für die globalen Variablen über '%ls' öffnen: %s"
 
 #: src/event.cpp:184
 #, c-format
@@ -463,7 +452,7 @@ msgstr ""
 
 #: src/expand.cpp:555
 msgid "Mismatched braces"
-msgstr ""
+msgstr "Unpassende Klammern"
 
 #: src/fish.cpp:395
 #, c-format
@@ -477,12 +466,12 @@ msgstr "Kann den no-execute Modus nicht in einer interaktiven Sitzung nutzen"
 #: src/fish.cpp:581
 #, c-format
 msgid "Error reading script file '%s':"
-msgstr ""
+msgstr "Die Script-Datei '%s' kann nicht gelesen werden:"
 
 #: src/fish.cpp:595
 #, c-format
 msgid "Error while reading file %ls\n"
-msgstr ""
+msgstr "Fehler beim Lesen der Datei %ls\n"
 
 #: src/fish_indent.cpp:932 src/fish_key_reader.cpp:317
 #, c-format
@@ -508,7 +497,7 @@ msgstr "Öffnen von \"%s\" fehlgeschlagen: %s\n"
 #: src/fish_indent.cpp:1072
 #, c-format
 msgid "%s\n"
-msgstr ""
+msgstr "%s\n"
 
 #: src/history.cpp:381
 #, c-format
@@ -518,41 +507,41 @@ msgstr "Sperren der Geschichts-Datei dauerte zu lang (%.3f Sekunden)."
 #: src/history.cpp:887
 #, c-format
 msgid "Error when renaming history file: %s"
-msgstr ""
+msgstr "Fehler beim Umbenennen der History-Datei: %s"
 
 #: src/history.cpp:1285
 #, c-format
 msgid "History session ID '%ls' is not a valid variable name. "
-msgstr ""
+msgstr "History Sitzungs-ID '%ls' ist kein gültiger Variablenname."
 
 #: src/io.cpp:25
 #, c-format
 msgid "An error occurred while redirecting file '%ls'"
-msgstr ""
+msgstr "Bei der Umleitung der Datei '%ls' ist ein Fehler aufgetreten"
 
 #: src/io.cpp:26
 #, c-format
 msgid "The file '%ls' already exists"
-msgstr ""
+msgstr "Die Datei '%ls' existiert bereits"
 
 #: src/io.cpp:254
 #, c-format
 msgid "Path '%ls' is not a directory"
-msgstr ""
+msgstr "Pfad '%ls' ist kein Ordner"
 
 #: src/io.cpp:257
 #, c-format
 msgid "Path '%ls' does not exist"
-msgstr ""
+msgstr "Pfad '%ls' nicht gefunden"
 
 #: src/output.cpp:434
 #, c-format
 msgid "Tried to use terminfo string %s on line %ld of %s, which is "
-msgstr ""
+msgstr "Versucht, terminfo Text %s in Zeile %ld von %s zu nutzen, dieser ist"
 
 #: src/pager.cpp:45
 msgid "search: "
-msgstr ""
+msgstr "suche: "
 
 #: src/pager.cpp:541
 #, c-format
@@ -566,32 +555,35 @@ msgstr "Zeilen %lu bis %lu von %lu"
 
 #: src/pager.cpp:551
 msgid "(no matches)"
-msgstr ""
+msgstr "(keine Treffer)"
 
 #: src/parse_execution.cpp:524
 #, c-format
 msgid "switch: Expected at most one argument, got %lu\n"
-msgstr ""
+msgstr "switch: Erwartet höchstens einen Paramter, aber %lu angegeben\n"
 
 #: src/parse_execution.cpp:740
 #, c-format
 msgid ""
 "Unknown command. A component of '%ls' is not a directory. Check your $PATH."
 msgstr ""
+"Befehl nicht gefunden. Ein Element von '%ls' ist kein Verzeichnis. Überprüfe "
+"einen $PATH"
 
 #: src/parse_execution.cpp:744
 #, c-format
 msgid "Unknown command. A component of '%ls' is not a directory."
-msgstr ""
+msgstr "Befehl nicht gefunden. Ein Element von '%ls' ist kein Verzeichnis."
 
 #: src/parse_execution.cpp:750
 #, c-format
 msgid "Unknown command. '%ls' exists but is not an executable file."
 msgstr ""
+"Befehl nicht gefunden '%ls' existiert, ist aber keine ausführbare Datei"
 
 #: src/parse_execution.cpp:791
 msgid "Unknown command:"
-msgstr ""
+msgstr "Befehl nicht gefunden:"
 
 #: src/parse_execution.cpp:839
 msgid "The expanded command was empty."
@@ -600,38 +592,41 @@ msgstr ""
 #: src/parse_execution.cpp:1005
 #, c-format
 msgid "Invalid redirection: %ls"
-msgstr ""
+msgstr "Ungültige Umleitung: %ls"
 
 #: src/parse_execution.cpp:1016
 #, c-format
 msgid "Invalid redirection target: %ls"
-msgstr ""
+msgstr "Ungültiges Umleitungsziel: %ls"
 
 #: src/parse_execution.cpp:1027
 #, c-format
 msgid "Requested redirection to '%ls', which is not a valid file descriptor"
 msgstr ""
+"Umleitung zu '%ls' angefordert, dies ist aber kein gültiger file descriptor"
 
 #: src/parse_util.cpp:34
 #, c-format
 msgid "The '%ls' command can not be used immediately after a backgrounded job"
 msgstr ""
+"Der Befehl '%ls' kann nicht direkt nach einem Hintergrundjob aufgerufen "
+"werden"
 
 #: src/parse_util.cpp:38
 msgid "Backgrounded commands can not be used as conditionals"
-msgstr ""
+msgstr "Hintergrundbefehle können nicht als Bedingungen benutzt werden"
 
 #: src/parse_util.cpp:41
 msgid "'end' does not take arguments. Did you forget a ';'?"
-msgstr ""
+msgstr "'end' braucht keine Parameter. Fehlendes ';'?"
 
 #: src/parse_util.cpp:44
 msgid "The 'time' command may only be at the beginning of a pipeline"
-msgstr ""
+msgstr "Der 'time' Befehl darf nur am Anfang einer Pipeline stehen"
 
 #: src/parse_util.cpp:1180
 msgid "$status is not valid as a command. See `help conditions`"
-msgstr ""
+msgstr "$status ist kein gültiger Befehl. Siehe `help conditions"
 
 #: src/parser.cpp:166
 #, c-format
@@ -645,35 +640,35 @@ msgstr "Zeit\tSum\tBefehl\n"
 #: src/parser.cpp:220
 #, c-format
 msgid "in function '%ls'"
-msgstr ""
+msgstr "in der Funktion '%ls'"
 
 #: src/parser.cpp:235
 #, c-format
 msgid " with arguments '%ls'"
-msgstr ""
+msgstr "mit den Parametern '%ls'"
 
 #: src/parser.cpp:242
 msgid "in command substitution\n"
-msgstr ""
+msgstr "in der Befehlsersetzung\n"
 
 #: src/parser.cpp:248
 #, c-format
 msgid "from sourcing file %ls\n"
-msgstr ""
+msgstr "aus der Quelldatei %ls\n"
 
 #: src/parser.cpp:256
 #, c-format
 msgid "in event handler: %ls\n"
-msgstr ""
+msgstr "im Ereignis-Handler: %ls\n"
 
 #: src/parser.cpp:276
 #, c-format
 msgid "\tcalled on line %d of file %ls\n"
-msgstr ""
+msgstr "\taufgerufen in Zeile %d der Date %ls\n"
 
 #: src/parser.cpp:279
 msgid "\tcalled during startup\n"
-msgstr ""
+msgstr "\twährend des Starts aufgerufen\n"
 
 #: src/parser.cpp:428
 #, c-format
@@ -682,21 +677,21 @@ msgstr "%ls (Zeile %d): "
 
 #: src/parser.cpp:431
 msgid "Startup"
-msgstr ""
+msgstr "Start"
 
 #: src/parser.cpp:433
 msgid "Standard input"
-msgstr ""
+msgstr "Standardeingabe"
 
 #: src/parser.cpp:647
 #, c-format
 msgid "%ls (line %lu): "
-msgstr ""
+msgstr "%ls (Zeile %lu): "
 
 #: src/parser.cpp:651
 #, c-format
 msgid "%ls: "
-msgstr ""
+msgstr "%ls: "
 
 #: src/path.cpp:291
 #, c-format
@@ -1129,7 +1124,7 @@ msgstr ""
 #: src/parse_constants.h:236
 #, c-format
 msgid "Unknown builtin '%ls'"
-msgstr "unbekannter interner Befehl '%ls'"
+msgstr "Unbekannter interner Befehl '%ls'"
 
 #: src/parse_constants.h:239
 #, c-format
@@ -5692,7 +5687,7 @@ msgstr "Inhalt der Konfigurationsdatei ausgeben"
 
 #: /tmp/fish.i8YroE/implicit/share/completions/apt-extracttemplates.fish:2
 msgid "Set temp dir"
-msgstr "temp-Verzeichnis festlegen"
+msgstr "Temp-Verzeichnis festlegen"
 
 #: /tmp/fish.i8YroE/implicit/share/completions/apt-file.fish:2
 msgid "Resync package contents from source"
@@ -5733,7 +5728,7 @@ msgstr "Architektur festlegen"
 
 #: /tmp/fish.i8YroE/implicit/share/completions/apt-file.fish:13
 msgid "Set sources.list file"
-msgstr "sources.list-Datei angeben"
+msgstr "Sources.list-Datei festlegen"
 
 #: /tmp/fish.i8YroE/implicit/share/completions/apt-file.fish:14
 msgid "Only display package name"
@@ -6058,7 +6053,7 @@ msgstr "Zeitablauf für Zwischenspeicher angeben"
 
 #: /tmp/fish.i8YroE/implicit/share/completions/apt-listbugs.fish:19
 msgid "Specify apt config file"
-msgstr "apt-Konfigurationsdatei angeben"
+msgstr "Apt-Konfigurationsdatei angeben"
 
 #: /tmp/fish.i8YroE/implicit/share/completions/apt-listbugs.fish:21
 msgid "Assume no to all questions"
@@ -6233,7 +6228,7 @@ msgstr "Keine Meldungen auf Standardausgabe"
 
 #: /tmp/fish.i8YroE/implicit/share/completions/apt-proxy-import.fish:5
 msgid "Recurse into subdir"
-msgstr "in Unterverzeichnis verzweigen"
+msgstr "In Unterverzeichnisse absteigen"
 
 #: /tmp/fish.i8YroE/implicit/share/completions/apt-proxy-import.fish:6
 msgid "Dir to import"
@@ -6261,7 +6256,7 @@ msgstr "Status der Abhängigkeiten anzeigen"
 
 #: /tmp/fish.i8YroE/implicit/share/completions/apt-rdepends.fish:5
 msgid "List packages depending on"
-msgstr "Pakete auflisten, die abhängen von "
+msgstr "Pakete auflisten, die abhängen von"
 
 #: /tmp/fish.i8YroE/implicit/share/completions/apt-rdepends.fish:6
 msgid "Comma-separated list of dependency types to follow recursively"
@@ -13475,7 +13470,7 @@ msgstr ""
 #: /tmp/fish.i8YroE/implicit/share/completions/castnow.fish:14
 #: /tmp/fish.i8YroE/implicit/share/completions/mplayer.fish:7
 msgid "Play in random order"
-msgstr "in zufälliger Reihenfolge spielen"
+msgstr "In zufälliger Reihenfolge spielen"
 
 #: /tmp/fish.i8YroE/implicit/share/completions/castnow.fish:15
 msgid "List all files in directories recursively"
@@ -16138,7 +16133,7 @@ msgstr ""
 
 #: /tmp/fish.i8YroE/implicit/share/completions/complete.fish:5
 msgid "Old style long option to complete"
-msgstr "zu vervollständigende lange Option im alten Format"
+msgstr "Zu vervollständigende lange Option im alten Format"
 
 #: /tmp/fish.i8YroE/implicit/share/completions/complete.fish:6
 msgid "Don't use file completion"
@@ -22557,7 +22552,7 @@ msgstr "Änderung in der Anzahl von Worttrennern ignorieren"
 
 #: /tmp/fish.i8YroE/implicit/share/completions/diff.fish:6
 msgid "Ignore all white space"
-msgstr "white space (Worttrenner) ignorieren"
+msgstr "Alle Leerzeichen (Worttrenner) ignorieren"
 
 #: /tmp/fish.i8YroE/implicit/share/completions/diff.fish:7
 #: /tmp/fish.i8YroE/implicit/share/completions/git.fish:36

From 2d97e2400652e430e1a343f26cd93e4f62e71f20 Mon Sep 17 00:00:00 2001
From: Zehka <git@zehka.net>
Date: Fri, 2 Jun 2023 01:34:34 +0200
Subject: [PATCH 048/200] another commit to rectify the chaos i created

(cherry picked from commit 6c6d28193839d8155fd2deafe630e962129997fe)
---
 po/de.po | 116 +++++++++++++++++++++----------------------------------
 1 file changed, 43 insertions(+), 73 deletions(-)

diff --git a/po/de.po b/po/de.po
index cda22c8fb..c064fe556 100644
--- a/po/de.po
+++ b/po/de.po
@@ -9,7 +9,7 @@ msgstr ""
 "Project-Id-Version: de\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2022-12-23 11:20+0100\n"
-"PO-Revision-Date: 2023-06-01 16:49+0200\n"
+"PO-Revision-Date: 2023-06-01 23:33+0200\n"
 "Last-Translator: Fabian Homborg\n"
 "Language-Team: deutsch <de@li.org>\n"
 "Language: de\n"
@@ -150,7 +150,7 @@ msgstr "Die Anzahl Argumente zählen"
 
 #: src/builtin.cpp:376
 msgid "Remove job from job list"
-msgstr "Auftrag aus der Auftragsliste entfernen"
+msgstr "Job aus der Jobliste entfernen"
 
 #: src/builtin.cpp:377
 msgid "Print arguments"
@@ -162,7 +162,7 @@ msgstr "Werte Block aus, wenn die Bedingung falsch ist"
 
 #: src/builtin.cpp:379
 msgid "Emit an event"
-msgstr "Ein Event auslösen"
+msgstr "Ein Ereignis auslösen"
 
 #: src/builtin.cpp:380
 msgid "End a block of commands"
@@ -214,7 +214,7 @@ msgstr "Derzeit laufende Jobs ausgeben"
 
 #: src/builtin.cpp:392
 msgid "Evaluate math expressions"
-msgstr "Mathematische Formel ausführen"
+msgstr "Mathematische Formel berechnen"
 
 #: src/builtin.cpp:393
 msgid "Negate exit status of job"
@@ -246,7 +246,7 @@ msgstr "Eine Eingabezeile in Variablen einlesen"
 
 #: src/builtin.cpp:400
 msgid "Show absolute path sans symlinks"
-msgstr "Absoluten Pfad ohne Symlinks anzeigen"
+msgstr "Absoluten Pfad ohne symbolische Verknüpfungen anzeigen"
 
 #: src/builtin.cpp:401
 msgid "Stop the currently evaluated function"
@@ -270,7 +270,7 @@ msgstr "Strings manipulieren"
 
 #: src/builtin.cpp:407
 msgid "Conditionally run blocks of code"
-msgstr "Anweisungsblock Bedingungsabhängig ausführen"
+msgstr "Anweisungsblock bedingungsabhängig ausführen"
 
 #: src/builtin.cpp:409
 msgid "Measure how long a command or block takes"
@@ -313,15 +313,11 @@ msgstr "Abkürzung: %ls"
 
 #: src/complete.cpp:1514
 msgid "completion reached maximum recursion depth, possible cycle?"
-msgstr ""
-"Vervollständigung hat die maximale Rekursionstiefe erreicht, möglicher Kreis?"
+msgstr "Vervollständigung hat die maximale Rekursionstiefe erreicht, möglicher Kreis?"
 
 #: src/env.cpp:1340
-msgid ""
-"Could not determine current working directory. Is your locale set correctly?"
-msgstr ""
-"Das aktuelle Arbeitsverzeichnis konnte nicht bestimmt werden. Ist die "
-"Lokalisierung korrekt eingestellt?"
+msgid "Could not determine current working directory. Is your locale set correctly?"
+msgstr "Das aktuelle Arbeitsverzeichnis konnte nicht bestimmt werden. Ist die locale korrekt eingestellt?"
 
 #: src/env_dispatch.cpp:471
 #, c-format
@@ -339,12 +335,12 @@ msgstr "Konnte das Terminal nicht einrichten"
 
 #: src/env_dispatch.cpp:577
 msgid "TERM environment variable not set."
-msgstr "TERM Umgebungsvariable nicht gesetzt."
+msgstr "TERM-Umgebungsvariable nicht gesetzt."
 
 #: src/env_dispatch.cpp:579
 #, c-format
 msgid "TERM environment variable set to '%ls'."
-msgstr "TERM Umgebungsvariable auf '%ls' gesetzt."
+msgstr "TERM-Umgebungsvariable auf '%ls' gesetzt."
 
 #: src/env_dispatch.cpp:581
 msgid "Check that this terminal type is supported on this system."
@@ -353,7 +349,7 @@ msgstr "Überprüfe, ob dieser Terminaltyp auf diesem System unterstützt wird."
 #: src/env_universal_common.cpp:425
 #, c-format
 msgid "Unable to write to universal variables file '%ls': %s"
-msgstr "Die globale Variablen-Datei '%ls' kann nicht geschrieben werden: %s"
+msgstr "Die Universal-Variablen-Datei '%ls' kann nicht geschrieben werden: %s"
 
 #: src/env_universal_common.cpp:441
 #, c-format
@@ -368,14 +364,12 @@ msgstr "Die temporäre Date '%ls' kann nicht geöffnet werden: %s"
 #: src/env_universal_common.cpp:499
 #, c-format
 msgid "Locking the universal var file took too long (%.3f seconds)."
-msgstr ""
-"Die Datei für universelle Variablen zu sperren dauerte zu lange (%.3f "
-"Sekunden)"
+msgstr "Die Datei für universelle Variablen zu sperren dauerte zu lange (%.3f Sekunden)"
 
 #: src/env_universal_common.cpp:542
 #, c-format
 msgid "Unable to open universal variable file '%s': %s"
-msgstr "Die globale Variablen-Datei '%s' kann nicht geöffnet werden: %s"
+msgstr "Die Universal-Variablen-Datei '%s' kann nicht geöffnet werden: %s"
 
 #: src/env_universal_common.cpp:920
 #, c-format
@@ -400,12 +394,12 @@ msgstr ""
 #: src/env_universal_common.cpp:1134
 #, c-format
 msgid "Unable to make a pipe for universal variables using '%ls': %s"
-msgstr "Kann keine Pipe für die globalen Variablen über '%ls' anlegen: %s"
+msgstr "Kann keine Pipe für die universalen Variablen über '%ls' anlegen: %s"
 
 #: src/env_universal_common.cpp:1142
 #, c-format
 msgid "Unable to open a pipe for universal variables using '%ls': %s"
-msgstr "Kann keine Pipe für die globalen Variablen über '%ls' öffnen: %s"
+msgstr "Kann keine Pipe für die universalen Variablen über '%ls' öffnen: %s"
 
 #: src/event.cpp:184
 #, c-format
@@ -507,12 +501,12 @@ msgstr "Sperren der Geschichts-Datei dauerte zu lang (%.3f Sekunden)."
 #: src/history.cpp:887
 #, c-format
 msgid "Error when renaming history file: %s"
-msgstr "Fehler beim Umbenennen der History-Datei: %s"
+msgstr "Fehler beim Umbenennen der Verlaufsdatei: %s"
 
 #: src/history.cpp:1285
 #, c-format
 msgid "History session ID '%ls' is not a valid variable name. "
-msgstr "History Sitzungs-ID '%ls' ist kein gültiger Variablenname."
+msgstr "Verlaufssitzungs-ID '%ls' ist kein gültiger Variablenname."
 
 #: src/io.cpp:25
 #, c-format
@@ -535,13 +529,13 @@ msgid "Path '%ls' does not exist"
 msgstr "Pfad '%ls' nicht gefunden"
 
 #: src/output.cpp:434
-#, c-format
+#, fuzzy, c-format
 msgid "Tried to use terminfo string %s on line %ld of %s, which is "
-msgstr "Versucht, terminfo Text %s in Zeile %ld von %s zu nutzen, dieser ist"
+msgstr "Versucht, terminfo Text %s in Zeile %ld von %s zu nutzen, welcher undefiniert ist. Bitte melde diesen Fehler."
 
 #: src/pager.cpp:45
 msgid "search: "
-msgstr "suche: "
+msgstr "Suche: "
 
 #: src/pager.cpp:541
 #, c-format
@@ -560,26 +554,22 @@ msgstr "(keine Treffer)"
 #: src/parse_execution.cpp:524
 #, c-format
 msgid "switch: Expected at most one argument, got %lu\n"
-msgstr "switch: Erwartet höchstens einen Paramter, aber %lu angegeben\n"
+msgstr "switch: Erwartet höchstens einen Parameter, aber %lu angegeben\n"
 
 #: src/parse_execution.cpp:740
 #, c-format
-msgid ""
-"Unknown command. A component of '%ls' is not a directory. Check your $PATH."
-msgstr ""
-"Befehl nicht gefunden. Ein Element von '%ls' ist kein Verzeichnis. Überprüfe "
-"einen $PATH"
+msgid "Unknown command. A component of '%ls' is not a directory. Check your $PATH."
+msgstr "Befehl nicht gefunden. Ein Element von '%ls' ist kein Verzeichnis. Überprüfe deinen $PATH"
 
 #: src/parse_execution.cpp:744
 #, c-format
 msgid "Unknown command. A component of '%ls' is not a directory."
-msgstr "Befehl nicht gefunden. Ein Element von '%ls' ist kein Verzeichnis."
+msgstr "Befehl nicht gefunden. Eine Komponente von '%ls' ist kein Verzeichnis."
 
 #: src/parse_execution.cpp:750
 #, c-format
 msgid "Unknown command. '%ls' exists but is not an executable file."
-msgstr ""
-"Befehl nicht gefunden '%ls' existiert, ist aber keine ausführbare Datei"
+msgstr "Befehl nicht gefunden '%ls' existiert, ist aber keine ausführbare Datei."
 
 #: src/parse_execution.cpp:791
 msgid "Unknown command:"
@@ -602,15 +592,12 @@ msgstr "Ungültiges Umleitungsziel: %ls"
 #: src/parse_execution.cpp:1027
 #, c-format
 msgid "Requested redirection to '%ls', which is not a valid file descriptor"
-msgstr ""
-"Umleitung zu '%ls' angefordert, dies ist aber kein gültiger file descriptor"
+msgstr "Umleitung zu '%ls' angefordert, dies ist aber kein gültiger Dateideskriptor"
 
 #: src/parse_util.cpp:34
 #, c-format
 msgid "The '%ls' command can not be used immediately after a backgrounded job"
-msgstr ""
-"Der Befehl '%ls' kann nicht direkt nach einem Hintergrundjob aufgerufen "
-"werden"
+msgstr "Der Befehl '%ls' kann nicht direkt nach einem Hintergrundjob aufgerufen werden"
 
 #: src/parse_util.cpp:38
 msgid "Backgrounded commands can not be used as conditionals"
@@ -626,7 +613,7 @@ msgstr "Der 'time' Befehl darf nur am Anfang einer Pipeline stehen"
 
 #: src/parse_util.cpp:1180
 msgid "$status is not valid as a command. See `help conditions`"
-msgstr "$status ist kein gültiger Befehl. Siehe `help conditions"
+msgstr "$status ist kein gültiger Befehl. Siehe `help conditions`"
 
 #: src/parser.cpp:166
 #, c-format
@@ -664,7 +651,7 @@ msgstr "im Ereignis-Handler: %ls\n"
 #: src/parser.cpp:276
 #, c-format
 msgid "\tcalled on line %d of file %ls\n"
-msgstr "\taufgerufen in Zeile %d der Date %ls\n"
+msgstr "\taufgerufen in Zeile %d der Datei %ls\n"
 
 #: src/parser.cpp:279
 msgid "\tcalled during startup\n"
@@ -701,8 +688,7 @@ msgstr ""
 #: src/path.cpp:293
 #, c-format
 msgid "Please set the %ls or HOME environment variable before starting fish."
-msgstr ""
-"Bitte setzen sie %ls oder die HOME Umgebungsvariable bevor sie fish starten."
+msgstr "Bitte setzen sie %ls oder die HOME Umgebungsvariable bevor sie fish starten."
 
 #: src/path.cpp:297
 #, c-format
@@ -742,8 +728,7 @@ msgid "A second attempt to exit will terminate them.\n"
 msgstr "Ein zweites 'exit' wird sie beenden.\n"
 
 #: src/proc.cpp:207
-msgid ""
-"Use 'disown PID' to remove jobs from the list without terminating them.\n"
+msgid "Use 'disown PID' to remove jobs from the list without terminating them.\n"
 msgstr ""
 
 #: src/proc.cpp:900
@@ -772,8 +757,7 @@ msgid "No TTY for interactive shell (tcgetpgrp failed)"
 msgstr "Kein TTY für interaktive Shell (tcgetpgrp schlug fehl)"
 
 #: src/reader.cpp:2493
-msgid ""
-"I appear to be an orphaned process, so I am quitting politely. My pid is "
+msgid "I appear to be an orphaned process, so I am quitting politely. My pid is "
 msgstr ""
 
 #: src/reader.cpp:2535
@@ -1108,17 +1092,11 @@ msgstr "Fehler beim Einrichten der Pipe aufgetreten"
 
 #: src/parse_constants.h:229
 #, c-format
-msgid ""
-"The function '%ls' calls itself immediately, which would result in an "
-"infinite loop."
-msgstr ""
-"Die Funktion '%ls' ruft sich sofort selbst auf. Dies wäre eine "
-"Endlosschleife."
+msgid "The function '%ls' calls itself immediately, which would result in an infinite loop."
+msgstr "Die Funktion '%ls' ruft sich sofort selbst auf. Dies wäre eine Endlosschleife."
 
 #: src/parse_constants.h:233
-msgid ""
-"The call stack limit has been exceeded. Do you have an accidental infinite "
-"loop?"
+msgid "The call stack limit has been exceeded. Do you have an accidental infinite loop?"
 msgstr ""
 
 #: src/parse_constants.h:236
@@ -1194,14 +1172,11 @@ msgid "Unsupported use of '='. In fish, please use 'set %ls %ls'."
 msgstr ""
 
 #: src/parse_constants.h:289
-msgid ""
-"'time' is not supported for background jobs. Consider using 'command time'."
+msgid "'time' is not supported for background jobs. Consider using 'command time'."
 msgstr ""
 
 #: src/parse_constants.h:293
-msgid ""
-"'{ ... }' is not supported for grouping commands. Please use 'begin; ...; "
-"end'"
+msgid "'{ ... }' is not supported for grouping commands. Please use 'begin; ...; end'"
 msgstr ""
 
 #: src/parse_tree.h:63
@@ -1311,8 +1286,7 @@ msgid "Select directory by letter or number: "
 msgstr ""
 
 #: /tmp/fish.i8YroE/explicit/share/functions/cdh.fish:6
-msgid ""
-"Error: expected a number between 1 and %d or letter in that range, got \"%s\""
+msgid "Error: expected a number between 1 and %d or letter in that range, got \"%s\""
 msgstr ""
 
 #: /tmp/fish.i8YroE/explicit/share/functions/edit_command_buffer.fish:2
@@ -22552,10 +22526,9 @@ msgstr "Änderung in der Anzahl von Worttrennern ignorieren"
 
 #: /tmp/fish.i8YroE/implicit/share/completions/diff.fish:6
 msgid "Ignore all white space"
-msgstr "Alle Leerzeichen (Worttrenner) ignorieren"
+msgstr "Alle Leerräume (Worttrenner) ignorieren"
 
-#: /tmp/fish.i8YroE/implicit/share/completions/diff.fish:7
-#: /tmp/fish.i8YroE/implicit/share/completions/git.fish:36
+#: /tmp/fish.i8YroE/implicit/share/completions/diff.fish:7 /tmp/fish.i8YroE/implicit/share/completions/git.fish:36
 #: /tmp/fish.i8YroE/implicit/share/completions/git.fish:802
 msgid "Ignore changes whose lines are all blank"
 msgstr "Änderungen ignorieren, deren Zeilen alle leer sind"
@@ -23257,8 +23230,7 @@ msgid "Skip the interactive TUI and validate against CI rules"
 msgstr ""
 
 #: /tmp/fish.i8YroE/implicit/share/completions/dive.fish:2
-msgid ""
-"If CI=true in the environment, use the given yaml to drive validation rules"
+msgid "If CI=true in the environment, use the given yaml to drive validation rules"
 msgstr ""
 
 #: /tmp/fish.i8YroE/implicit/share/completions/dive.fish:3
@@ -23282,9 +23254,7 @@ msgid "Ignore image parsing errors and run the analysis anyway"
 msgstr ""
 
 #: /tmp/fish.i8YroE/implicit/share/completions/dive.fish:8
-msgid ""
-"Skip the interactive TUI and write the layer analysis statistics to a given "
-"file"
+msgid "Skip the interactive TUI and write the layer analysis statistics to a given file"
 msgstr ""
 
 #: /tmp/fish.i8YroE/implicit/share/completions/dive.fish:9

From f5f1db4f5b352381f413e7f7bdc61eaa3d173d0e Mon Sep 17 00:00:00 2001
From: Zehka <git@zehka.net>
Date: Fri, 2 Jun 2023 01:51:13 +0200
Subject: [PATCH 049/200] fixed a few smaller things in my translations

(cherry picked from commit a0a2475ccbd53b00f95676dac3a2ac5859fb17c2)
---
 po/de.po | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/po/de.po b/po/de.po
index c064fe556..dad985003 100644
--- a/po/de.po
+++ b/po/de.po
@@ -359,7 +359,7 @@ msgstr "Konnte Datei '%ls' nicht zu '%ls' umbenennen: %s"
 #: src/env_universal_common.cpp:485
 #, c-format
 msgid "Unable to open temporary file '%ls': %s"
-msgstr "Die temporäre Date '%ls' kann nicht geöffnet werden: %s"
+msgstr "Die temporäre Datei '%ls' kann nicht geöffnet werden: %s"
 
 #: src/env_universal_common.cpp:499
 #, c-format
@@ -569,7 +569,7 @@ msgstr "Befehl nicht gefunden. Eine Komponente von '%ls' ist kein Verzeichnis."
 #: src/parse_execution.cpp:750
 #, c-format
 msgid "Unknown command. '%ls' exists but is not an executable file."
-msgstr "Befehl nicht gefunden '%ls' existiert, ist aber keine ausführbare Datei."
+msgstr "Befehl nicht gefunden. '%ls' existiert, ist aber keine ausführbare Datei."
 
 #: src/parse_execution.cpp:791
 msgid "Unknown command:"

From 0d65d5a4229c74d21894a649619bd41ae3448468 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Simon=20B=C3=B6rjesson?= <simonborje@gmail.com>
Date: Sun, 4 Jun 2023 19:52:18 +0200
Subject: [PATCH 050/200] Redraw pager on new selection when nothing was
 selected previously

(cherry picked from commit 71c320ca3223867ea2918da81a2b6371e72adecd)
---
 src/pager.cpp | 198 +++++++++++++++++++++++++-------------------------
 1 file changed, 100 insertions(+), 98 deletions(-)

diff --git a/src/pager.cpp b/src/pager.cpp
index a5c5ec199..3dae7b358 100644
--- a/src/pager.cpp
+++ b/src/pager.cpp
@@ -664,8 +664,8 @@ bool pager_t::select_next_completion_in_direction(selection_motion_t direction,
         return false;
     }
 
-    // Handle the case of nothing selected yet.
     if (selected_completion_idx == PAGER_SELECTION_NONE) {
+        // Handle the case of nothing selected yet.
         switch (direction) {
             case selection_motion_t::south:
             case selection_motion_t::page_south:
@@ -679,7 +679,7 @@ bool pager_t::select_next_completion_in_direction(selection_motion_t direction,
                 } else {
                     selected_completion_idx = 0;
                 }
-                return true;
+                break;
             }
             case selection_motion_t::page_north:
             case selection_motion_t::east:
@@ -689,120 +689,122 @@ bool pager_t::select_next_completion_in_direction(selection_motion_t direction,
                 return false;
             }
         }
-    }
-
-    // Ok, we had something selected already. Select something different.
-    size_t new_selected_completion_idx;
-    if (!selection_direction_is_cardinal(direction)) {
-        // Next, previous, or deselect, all easy.
-        if (direction == selection_motion_t::deselect) {
-            new_selected_completion_idx = PAGER_SELECTION_NONE;
-        } else if (direction == selection_motion_t::next) {
-            new_selected_completion_idx = selected_completion_idx + 1;
-            if (new_selected_completion_idx >= completion_infos.size()) {
-                new_selected_completion_idx = 0;
-            }
-        } else if (direction == selection_motion_t::prev) {
-            if (selected_completion_idx == 0) {
-                new_selected_completion_idx = completion_infos.size() - 1;
+    } else {
+        // Ok, we had something selected already. Select something different.
+        size_t new_selected_completion_idx;
+        if (!selection_direction_is_cardinal(direction)) {
+            // Next, previous, or deselect, all easy.
+            if (direction == selection_motion_t::deselect) {
+                new_selected_completion_idx = PAGER_SELECTION_NONE;
+            } else if (direction == selection_motion_t::next) {
+                new_selected_completion_idx = selected_completion_idx + 1;
+                if (new_selected_completion_idx >= completion_infos.size()) {
+                    new_selected_completion_idx = 0;
+                }
+            } else if (direction == selection_motion_t::prev) {
+                if (selected_completion_idx == 0) {
+                    new_selected_completion_idx = completion_infos.size() - 1;
+                } else {
+                    new_selected_completion_idx = selected_completion_idx - 1;
+                }
             } else {
-                new_selected_completion_idx = selected_completion_idx - 1;
+                DIE("unknown non-cardinal direction");
             }
         } else {
-            DIE("unknown non-cardinal direction");
-        }
-    } else {
-        // Cardinal directions. We have a completion index; we wish to compute its row and column.
-        size_t current_row = this->get_selected_row(rendering);
-        size_t current_col = this->get_selected_column(rendering);
-        size_t page_height = std::max(rendering.term_height - 1, static_cast<size_t>(1));
+            // Cardinal directions. We have a completion index; we wish to compute its row and
+            // column.
+            size_t current_row = this->get_selected_row(rendering);
+            size_t current_col = this->get_selected_column(rendering);
+            size_t page_height = std::max(rendering.term_height - 1, static_cast<size_t>(1));
 
-        switch (direction) {
-            case selection_motion_t::page_north: {
-                if (current_row > page_height) {
-                    current_row = current_row - page_height;
-                } else {
-                    current_row = 0;
-                }
-                break;
-            }
-            case selection_motion_t::north: {
-                // Go up a whole row. If we cycle, go to the previous column.
-                if (current_row > 0) {
-                    current_row--;
-                } else {
-                    current_row = rendering.rows - 1;
-                    if (current_col > 0) {
-                        current_col--;
+            switch (direction) {
+                case selection_motion_t::page_north: {
+                    if (current_row > page_height) {
+                        current_row = current_row - page_height;
                     } else {
-                        current_col = rendering.cols - 1;
+                        current_row = 0;
                     }
+                    break;
                 }
-                break;
-            }
-            case selection_motion_t::page_south: {
-                if (current_row + page_height < rendering.rows) {
-                    current_row += page_height;
-                } else {
-                    current_row = rendering.rows - 1;
-                    if (current_col * rendering.rows + current_row >= completion_infos.size()) {
-                        current_row = (completion_infos.size() - 1) % rendering.rows;
-                    }
-                }
-                break;
-            }
-            case selection_motion_t::south: {
-                // Go down, unless we are in the last row.
-                // If we go over the last element, wrap to the first.
-                if (current_row + 1 < rendering.rows &&
-                    current_col * rendering.rows + current_row + 1 < completion_infos.size()) {
-                    current_row++;
-                } else {
-                    current_row = 0;
-                    current_col = (current_col + 1) % rendering.cols;
-                }
-                break;
-            }
-            case selection_motion_t::east: {
-                // Go east, wrapping to the next row. There is no "row memory," so if we run off the
-                // end, wrap.
-                if (current_col + 1 < rendering.cols &&
-                    (current_col + 1) * rendering.rows + current_row < completion_infos.size()) {
-                    current_col++;
-                } else {
-                    current_col = 0;
-                    current_row = (current_row + 1) % rendering.rows;
-                }
-                break;
-            }
-            case selection_motion_t::west: {
-                // Go west, wrapping to the previous row.
-                if (current_col > 0) {
-                    current_col--;
-                } else {
-                    current_col = rendering.cols - 1;
+                case selection_motion_t::north: {
+                    // Go up a whole row. If we cycle, go to the previous column.
                     if (current_row > 0) {
                         current_row--;
                     } else {
                         current_row = rendering.rows - 1;
+                        if (current_col > 0) {
+                            current_col--;
+                        } else {
+                            current_col = rendering.cols - 1;
+                        }
                     }
+                    break;
+                }
+                case selection_motion_t::page_south: {
+                    if (current_row + page_height < rendering.rows) {
+                        current_row += page_height;
+                    } else {
+                        current_row = rendering.rows - 1;
+                        if (current_col * rendering.rows + current_row >= completion_infos.size()) {
+                            current_row = (completion_infos.size() - 1) % rendering.rows;
+                        }
+                    }
+                    break;
+                }
+                case selection_motion_t::south: {
+                    // Go down, unless we are in the last row.
+                    // If we go over the last element, wrap to the first.
+                    if (current_row + 1 < rendering.rows &&
+                        current_col * rendering.rows + current_row + 1 < completion_infos.size()) {
+                        current_row++;
+                    } else {
+                        current_row = 0;
+                        current_col = (current_col + 1) % rendering.cols;
+                    }
+                    break;
+                }
+                case selection_motion_t::east: {
+                    // Go east, wrapping to the next row. There is no "row memory," so if we run off
+                    // the end, wrap.
+                    if (current_col + 1 < rendering.cols &&
+                        (current_col + 1) * rendering.rows + current_row <
+                            completion_infos.size()) {
+                        current_col++;
+                    } else {
+                        current_col = 0;
+                        current_row = (current_row + 1) % rendering.rows;
+                    }
+                    break;
+                }
+                case selection_motion_t::west: {
+                    // Go west, wrapping to the previous row.
+                    if (current_col > 0) {
+                        current_col--;
+                    } else {
+                        current_col = rendering.cols - 1;
+                        if (current_row > 0) {
+                            current_row--;
+                        } else {
+                            current_row = rendering.rows - 1;
+                        }
+                    }
+                    break;
+                }
+                default: {
+                    DIE("unknown cardinal direction");
                 }
-                break;
-            }
-            default: {
-                DIE("unknown cardinal direction");
             }
+
+            // Compute the new index based on the changed row.
+            new_selected_completion_idx = current_col * rendering.rows + current_row;
         }
 
-        // Compute the new index based on the changed row.
-        new_selected_completion_idx = current_col * rendering.rows + current_row;
+        if (selected_completion_idx == new_selected_completion_idx) {
+            return false;
+        }
+        selected_completion_idx = new_selected_completion_idx;
     }
 
-    if (selected_completion_idx == new_selected_completion_idx) {
-        return false;
-    }
-    selected_completion_idx = new_selected_completion_idx;
-
     // Update suggested_row_start to ensure the selection is visible. suggested_row_start *
     // rendering.cols is the first suggested visible completion; add the visible completion
     // count to that to get the last one.

From c6c6ac1c69091f0034aa5082889d006c385293e0 Mon Sep 17 00:00:00 2001
From: Amy Grace <zgracem@users.noreply.github.com>
Date: Sun, 28 May 2023 11:14:19 -0600
Subject: [PATCH 051/200] Force use of macOS's builtin `manpath`

Prevent a useless warning msg if Homebrew's `man-db` is installed and configured

(cherry picked from commit 4c9fa511e8b0127874d65a3404bb1982f399babe)
---
 share/functions/__fish_apropos.fish | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/share/functions/__fish_apropos.fish b/share/functions/__fish_apropos.fish
index fcc5f9f9c..0e4d1a697 100644
--- a/share/functions/__fish_apropos.fish
+++ b/share/functions/__fish_apropos.fish
@@ -40,7 +40,7 @@ if test $status -eq 0 -a (count $sysver) -eq 3
 
         if test $age -ge $max_age
             test -d "$dir" || mkdir -m 700 -p $dir
-            /usr/libexec/makewhatis -o "$whatis" (manpath | string split :) >/dev/null 2>&1 </dev/null &
+            /usr/libexec/makewhatis -o "$whatis" (/usr/bin/manpath | string split :) >/dev/null 2>&1 </dev/null &
             disown $last_pid
         end
     end

From 74bea8724427c4f9e3126295961763145ab47006 Mon Sep 17 00:00:00 2001
From: Andre Eckardt <hi@noyron.de>
Date: Fri, 2 Jun 2023 14:07:08 +0200
Subject: [PATCH 052/200] improved print CSS for fish_config

This commit introduces a fishconfig_print.css that contains special CSS styles that only apply when printing the fishconfig page. This is especially useful when the user wants to print out the key bindings.

(cherry picked from commit cbf9a3bbbd2e6c0aa86011dc3249f4243710d704)
---
 share/tools/web_config/fishconfig.css         |  4 +++
 share/tools/web_config/fishconfig_print.css   | 30 +++++++++++++++++++
 share/tools/web_config/index.html             |  3 +-
 share/tools/web_config/partials/bindings.html |  2 +-
 share/tools/web_config/partials/history.html  |  2 +-
 .../tools/web_config/partials/variables.html  |  2 +-
 6 files changed, 39 insertions(+), 4 deletions(-)
 create mode 100644 share/tools/web_config/fishconfig_print.css

diff --git a/share/tools/web_config/fishconfig.css b/share/tools/web_config/fishconfig.css
index 195bf52b4..934fb50cb 100644
--- a/share/tools/web_config/fishconfig.css
+++ b/share/tools/web_config/fishconfig.css
@@ -664,3 +664,7 @@ img.delete_icon {
         color: #AAA;
     }
 }
+
+.print_only {
+    display: none;
+}
diff --git a/share/tools/web_config/fishconfig_print.css b/share/tools/web_config/fishconfig_print.css
new file mode 100644
index 000000000..ec2e3386e
--- /dev/null
+++ b/share/tools/web_config/fishconfig_print.css
@@ -0,0 +1,30 @@
+body {
+    background: white;
+    font-size: 8pt;
+}
+
+.tab, .print_hidden {
+    display: none;
+}
+
+.tab.selected_tab {
+    background: white;
+    display: block;
+    font-size: 22pt;
+    font-weight: bold;
+    padding-left: 14pt;
+    text-align: left;
+}
+
+.print_only {
+    display: initial;
+}
+
+.data_table_cell {
+    border-bottom: #dbdbdb 1pt solid;
+}
+
+#ancestor {
+    width: 100%;
+    box-shadow: none;
+}
diff --git a/share/tools/web_config/index.html b/share/tools/web_config/index.html
index 64169c83b..affb61032 100644
--- a/share/tools/web_config/index.html
+++ b/share/tools/web_config/index.html
@@ -6,6 +6,7 @@
     <title>fish shell configuration</title>
     <link rel="icon" type="image/png" href="favicon.png"/>
     <link rel="stylesheet" type="text/css" href="fishconfig.css"/>
+    <link rel="stylesheet" type="text/css" media="print" href="fishconfig_print.css">
     <script type="text/javascript" src="js/angular.js"></script>
     <script type="text/javascript" src="js/angular-route.js"></script>
     <script type="text/javascript" src="js/angular-sanitize.js"></script>
@@ -26,7 +27,7 @@
             <div ng-class="{'tab': true, 'selected_tab': currentTab == 'functions'}" id="tab_functions" ng-click="changeView('functions')">functions</div>
             <div ng-class="{'tab': true, 'selected_tab': currentTab == 'variables'}" id="tab_variables" ng-click="changeView('variables')">variables</div>
             <div ng-class="{'tab': true, 'selected_tab': currentTab == 'history'}" id="tab_history" ng-click="changeView('history')">history</div>
-            <div ng-class="{'tab': true, 'selected_tab': currentTab == 'bindings'}" id="tab_bindings" ng-click="changeView('bindings')">bindings</div>
+            <div ng-class="{'tab': true, 'selected_tab': currentTab == 'bindings'}" id="tab_bindings" ng-click="changeView('bindings')"><span class="print_only">fish shell </span>bindings</div>
         </div>
         <div id="tab_contents">
         <ng-view></ng-view>
diff --git a/share/tools/web_config/partials/bindings.html b/share/tools/web_config/partials/bindings.html
index 5c53fd9c7..f5d25e227 100644
--- a/share/tools/web_config/partials/bindings.html
+++ b/share/tools/web_config/partials/bindings.html
@@ -1,5 +1,5 @@
 <div id="table_filter_container" style="display: block;">
-    <input id="table_filter_text_box" class="filter_text_box text_box_transient" placeholder="Filter" ng-model="query">
+    <input id="table_filter_text_box" class="filter_text_box text_box_transient print_hidden" placeholder="Filter" ng-model="query">
 </div>
 
 <table class="data_table">
diff --git a/share/tools/web_config/partials/history.html b/share/tools/web_config/partials/history.html
index 32469b603..f0856ef97 100644
--- a/share/tools/web_config/partials/history.html
+++ b/share/tools/web_config/partials/history.html
@@ -14,7 +14,7 @@
     </table>
 
     <span ng-show="loadingText.length > 0"> {{ loadingText }} </span>
-    <input id="table_filter_text_box" class="filter_text_box text_box_transient" placeholder="Filter" ng-model="queryInput">
+    <input id="table_filter_text_box" class="filter_text_box text_box_transient print_hidden" placeholder="Filter" ng-model="queryInput">
 </div>
 <table class="data_table">
     <tbody>
diff --git a/share/tools/web_config/partials/variables.html b/share/tools/web_config/partials/variables.html
index 04b223881..84836739c 100644
--- a/share/tools/web_config/partials/variables.html
+++ b/share/tools/web_config/partials/variables.html
@@ -1,5 +1,5 @@
 <div id="table_filter_container">
-    <input id="table_filter_text_box" class="filter_text_box text_box_transient" placeholder="Filter" ng-model="query">
+    <input id="table_filter_text_box" class="filter_text_box text_box_transient print_hidden" placeholder="Filter" ng-model="query">
 </div>
 
 <table class="data_table">

From 8525844961b0af514194f2347177b23f1a8e89a8 Mon Sep 17 00:00:00 2001
From: Fabian Boehm <FHomborg@gmail.com>
Date: Sat, 17 Jun 2023 07:46:07 +0200
Subject: [PATCH 053/200] alias: Escape the function name when replacing

Fixes #8720

(cherry picked from commit 38ac21ba5e20e88763dc33261a9f201776661fc9)
---
 share/functions/alias.fish | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/share/functions/alias.fish b/share/functions/alias.fish
index 5fe783cab..6588156b5 100644
--- a/share/functions/alias.fish
+++ b/share/functions/alias.fish
@@ -17,7 +17,7 @@ function alias --description 'Creates a function wrapping a command'
         for func in (functions -n)
             set -l output (functions $func | string match -r -- "^function .* --description (?:'alias (.*)'|alias\\\\ (.*))\$")
             if set -q output[2]
-                set output (string replace -r -- '^'$func'[= ]' '' $output[2])
+                set output (string replace -r -- '^'(string escape --style=regex -- $func)'[= ]' '' $output[2])
                 echo alias $func (string escape -- $output[1])
             end
         end

From 5699e7857a446d041bf4ae58a6adb9f4b7ab6465 Mon Sep 17 00:00:00 2001
From: AsukaMinato <i@asukaminato.eu.org>
Date: Mon, 19 Jun 2023 04:04:43 +0900
Subject: [PATCH 054/200] Add i o for unzip (#9850)

* add -I -O for unzip

* for different distroes.

* avoid grep

(cherry picked from commit bab8fb9517b9359beb50b6a7f8f4734cb17a1931)
---
 share/completions/unzip.fish | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/share/completions/unzip.fish b/share/completions/unzip.fish
index df52452c0..e258294c5 100644
--- a/share/completions/unzip.fish
+++ b/share/completions/unzip.fish
@@ -23,6 +23,13 @@ complete -c unzip -s X -d "restore UID/GID info"
 complete -c unzip -s V -d "retain VMS version numbers"
 complete -c unzip -s K -d "keep setuid/setgid/tacky permissions"
 complete -c unzip -s M -d "pipe through `more` pager"
+# Some distro has -O and -I, some hasn't.
+if unzip --help | string match -rq -- -O
+    complete -c unzip -s O -d "specify a character encoding for DOS, Windows and OS/2 archives" -x -a "(__fish_print_encodings)"
+end
+if unzip --help | string match -rq -- -I
+    complete -c unzip -s I -d "specify a character encoding for UNIX and other archives" -x -a "(__fish_print_encodings)"
+end
 
 # Debian version of unzip
 if unzip -v 2>/dev/null | string match -eq Debian

From d1b7a2e2e78bae233734593778232a802da7930e Mon Sep 17 00:00:00 2001
From: may <m4rch3n1ng@gmail.com>
Date: Tue, 4 Jul 2023 04:51:26 +0200
Subject: [PATCH 055/200] add stash completions to git show and git diff

(cherry picked from commit e3e7ab77ade306db8449fa0467891c3d4b1b9a52)
---
 share/completions/git.fish | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/share/completions/git.fish b/share/completions/git.fish
index ad4251600..0a66248eb 100644
--- a/share/completions/git.fish
+++ b/share/completions/git.fish
@@ -1042,6 +1042,7 @@ complete -f -c git -n __fish_git_needs_command -a show -d 'Show the last commit
 complete -f -c git -n '__fish_git_using_command show' -n 'not contains -- -- (commandline -opc)' -ka '(__fish_git_branches)'
 complete -f -c git -n '__fish_git_using_command show' -n 'not contains -- -- (commandline -opc)' -ka '(__fish_git_tags)' -d Tag
 complete -f -c git -n '__fish_git_using_command show' -n 'not contains -- -- (commandline -opc)' -ka '(__fish_git_commits)'
+complete -f -c git -n '__fish_git_using_command show' -n 'not contains -- -- (commandline -opc)' -ka '(__fish_git_complete_stashes)'
 complete -f -c git -n __fish_git_needs_rev_files -n 'not contains -- -- (commandline -opc)' -xa '(__fish_git_complete_rev_files)'
 complete -F -c git -n '__fish_git_using_command show' -n 'contains -- -- (commandline -opc)'
 complete -f -c git -n '__fish_git_using_command show' -l format -d 'Pretty-print the contents of the commit logs in a given format' -a '(__fish_git_show_opt format)'
@@ -1371,6 +1372,7 @@ complete -f -c git -n '__fish_git_using_command describe' -l first-parent -d 'Fo
 ### diff
 complete -c git -n __fish_git_needs_command -a diff -d 'Show changes between commits and working tree'
 complete -c git -n '__fish_git_using_command diff' -n 'not contains -- -- (commandline -opc)' -ka '(__fish_git_ranges)'
+complete -c git -n '__fish_git_using_command diff' -n 'not contains -- -- (commandline -opc)' -ka '(__fish_git_complete_stashes)'
 complete -c git -n '__fish_git_using_command diff' -l cached -d 'Show diff of changes in the index'
 complete -c git -n '__fish_git_using_command diff' -l staged -d 'Show diff of changes in the index'
 complete -c git -n '__fish_git_using_command diff' -l no-index -d 'Compare two paths on the filesystem'

From 330942cc30ecd61c9b91e7726289cd63af968ad9 Mon Sep 17 00:00:00 2001
From: pd <42084500+raxpd@users.noreply.github.com>
Date: Sat, 8 Jul 2023 00:28:14 +0530
Subject: [PATCH 056/200] Fix rclone autocompletion script sourcing issue in
 fish shell

(cherry picked from commit ac2810e9ef258bfa1c7bb24cdedcfed9db238bb2)
---
 share/completions/rclone.fish | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/share/completions/rclone.fish b/share/completions/rclone.fish
index d155ae7b7..9a2fb6122 100644
--- a/share/completions/rclone.fish
+++ b/share/completions/rclone.fish
@@ -1 +1 @@
-rclone completion fish 2>/dev/null | source
+rclone completion fish - | source

From 7b9dafb9e4d10a68eb5df99398e6a0c0e6209dd5 Mon Sep 17 00:00:00 2001
From: Fabian Boehm <FHomborg@gmail.com>
Date: Sat, 15 Jul 2023 14:24:35 +0200
Subject: [PATCH 057/200] completions/rclone: Add version parsing

This had a weird, unnecessary and terrible backwards-incompatibility
in how you get the completions out.

I do not like it but I am in a good enough mood to work around it.

See #9878.

(cherry picked from commit bfd97adbda451a5acc1c4d1c39a335dd00475f5d)
---
 share/completions/rclone.fish | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/share/completions/rclone.fish b/share/completions/rclone.fish
index 9a2fb6122..744bb7051 100644
--- a/share/completions/rclone.fish
+++ b/share/completions/rclone.fish
@@ -1 +1,10 @@
-rclone completion fish - | source
+set -l rclone_version (rclone version | string match -rg 'rclone v(.*)' | string split .)
+or return
+
+# Yes, rclone's parsing here has changed, now they *require* a `-` argument
+# where previously they required *not* having it.
+if test "$rclone_version[1]" -gt 1; or test "$rclone_version[2]" -gt 62
+    rclone completion fish - 2>/dev/null | source
+else
+    rclone completion fish 2>/dev/null | source
+end

From 8a7a2f67ca719f2b46d6061a26ede3ff8ed2dc0a Mon Sep 17 00:00:00 2001
From: "Adam J. Stewart" <ajstewart426@gmail.com>
Date: Sat, 8 Jul 2023 21:55:12 -0500
Subject: [PATCH 058/200] Fix grammar in completion docs

(cherry picked from commit e31c0ebb0548ee633106597e4705a595632a4347)
---
 doc_src/cmds/complete.rst |  6 +--
 doc_src/completions.rst   | 86 +++++++++++++++++++++++++++++++++++++--
 2 files changed, 86 insertions(+), 6 deletions(-)

diff --git a/doc_src/cmds/complete.rst b/doc_src/cmds/complete.rst
index 0a79ffd4e..4d69dce90 100644
--- a/doc_src/cmds/complete.rst
+++ b/doc_src/cmds/complete.rst
@@ -1,6 +1,6 @@
 .. _cmd-complete:
 
-complete - edit command specific tab-completions
+complete - edit command-specific tab-completions
 ================================================
 
 Synopsis
@@ -8,7 +8,7 @@ Synopsis
 
 .. synopsis::
 
-    complete ((-c | --command) | (-p | --path)) COMMAND [OPTIONS] 
+    complete ((-c | --command) | (-p | --path)) COMMAND [OPTIONS]
     complete (-C | --do-complete) [--escape] STRING
 
 Description
@@ -72,7 +72,7 @@ The following options are available:
 **-h** or **--help**
     Displays help about using this command.
 
-Command specific tab-completions in ``fish`` are based on the notion of options and arguments. An option is a parameter which begins with a hyphen, such as ``-h``, ``-help`` or ``--help``. Arguments are parameters that do not begin with a hyphen. Fish recognizes three styles of options, the same styles as the GNU getopt library. These styles are:
+Command-specific tab-completions in ``fish`` are based on the notion of options and arguments. An option is a parameter which begins with a hyphen, such as ``-h``, ``-help`` or ``--help``. Arguments are parameters that do not begin with a hyphen. Fish recognizes three styles of options, the same styles as the GNU getopt library. These styles are:
 
 - Short options, like ``-a``. Short options are a single character long, are preceded by a single hyphen and can be grouped together (like ``-la``, which is equivalent to ``-l -a``). Option arguments may be specified by appending the option with the value (``-w32``), or, if ``--require-parameter`` is given, in the following parameter (``-w 32``).
 
diff --git a/doc_src/completions.rst b/doc_src/completions.rst
index 86501aa00..3a9ddb36f 100644
--- a/doc_src/completions.rst
+++ b/doc_src/completions.rst
@@ -12,7 +12,87 @@ To provide a list of possible completions for myprog, use the ``-a`` switch. If
   complete -c myprog -s o -l output -a "yes no"
 
 
-There are also special switches for specifying that a switch requires an argument, to disable filename completion, to create completions that are only available in some combinations, etc..  For a complete description of the various switches accepted by the ``complete`` command, see the documentation for the :doc:`complete <cmds/complete>` builtin, or write ``complete --help`` inside the ``fish`` shell.
+In the complete call above, the ``-a`` arguments apply when the option -o/--output has been given, so this offers them for::
+
+  > myprog -o<TAB>
+  > myprog --output=<TAB>
+
+By default, option arguments are *optional*, so the candidates are only offered directly attached like that, so they aren't given in this case::
+
+  > myprog -o <TAB>
+
+Usually options *require* a parameter, so you would give ``--require-parameter`` / ``-r``::
+  
+  complete -c myprog -s o -l output -ra "yes no"
+
+which offers yes/no in these cases::
+
+  > myprog -o<TAB>
+  > myprog --output=<TAB>
+  > myprog -o <TAB>
+  > myprog --output <TAB>
+
+In the latter two cases, files will also be offered because file completion is enabled by default.
+
+You would either inhibit file completion for a single option::
+
+  complete -c myprog -s o -l output --no-files -ra "yes no"
+
+or with a specific condition::
+
+  complete -c myprog -f --condition '__fish_seen_subcommand_from somesubcommand'
+
+or you can disable file completions globally for the command::
+
+  complete -c myprog -f
+
+If you have disabled them globally, you can enable them just for a specific condition or option with the ``--force-files`` / ``-F`` option::
+
+  # Disable files by default
+  complete -c myprog -f
+  # but reenable them for --config-file
+  complete -c myprog -l config-file --force-files -r
+
+In the complete call above, the ``-a`` arguments apply when the option -o/--output has been given, so this offers them for::
+
+  > myprog -o<TAB>
+  > myprog --output=<TAB>
+
+By default, option arguments are *optional*, so the candidates are only offered directly attached like that, so they aren't given in this case::
+
+  > myprog -o <TAB>
+
+Usually options *require* a parameter, so you would give ``--require-parameter`` / ``-r``::
+
+  complete -c myprog -s o -l output -ra "yes no"
+
+which offers yes/no in these cases::
+
+  > myprog -o<TAB>
+  > myprog --output=<TAB>
+  > myprog -o <TAB>
+  > myprog --output <TAB>
+
+In the latter two cases, files will also be offered because file completion is enabled by default.
+
+You would either inhibit file completion for a single option::
+
+  complete -c myprog -s o -l output --no-files -ra "yes no"
+
+or with a specific condition::
+
+  complete -c myprog -f --condition '__fish_seen_subcommand_from somesubcommand'
+
+or you can disable file completions globally for the command::
+
+  complete -c myprog -f
+
+If you have disabled them globally, you can enable them just for a specific condition or option with the ``--force-files`` / ``-F`` option::
+
+  # Disable files by default
+  complete -c myprog -f
+  # but reenable them for --config-file
+  complete -c myprog -l config-file --force-files -r
 
 As a more comprehensive example, here's a commented excerpt of the completions for systemd's ``timedatectl``::
 
@@ -76,7 +156,7 @@ For examples of how to write your own complex completions, study the completions
 Useful functions for writing 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.
+``fish`` ships with several functions that may be useful when writing command-specific completions. Most of these function names begin with the string ``__fish_``. Such functions are internal to ``fish`` and their name and interface may change in future fish versions. A few of these functions are described here.
 
 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.
 
@@ -120,7 +200,7 @@ These paths are controlled by parameters set at build, install, or run time, and
 
 This wide search may be confusing. If you are unsure, your completions probably belong in ``~/.config/fish/completions``.
 
-If you have written new completions for a common Unix command, please consider sharing your work by submitting it via the instructions in :ref:`Further help and development <more-help>`
+If you have written new completions for a common Unix command, please consider sharing your work by submitting it via the instructions in :ref:`Further help and development <more-help>`.
 
 If you are developing another program and would like to ship completions with your program, install them to the "vendor" completions directory. As this path may vary from system to system, the ``pkgconfig`` framework should be used to discover this path with the output of ``pkg-config --variable completionsdir fish``.
 

From 4ba7855699d152d760b0cff6f861c8b35154f328 Mon Sep 17 00:00:00 2001
From: "Adam J. Stewart" <ajstewart426@gmail.com>
Date: Sun, 9 Jul 2023 21:16:16 -0500
Subject: [PATCH 059/200] Docs: fix code block

(cherry picked from commit 72de1dc2012f249d09eb4994835ef8b92169e4cf)
---
 doc_src/language.rst | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/doc_src/language.rst b/doc_src/language.rst
index 87427b328..d1b148a0b 100644
--- a/doc_src/language.rst
+++ b/doc_src/language.rst
@@ -90,7 +90,8 @@ More examples::
 searches for lines ending in ``enabled)`` in ``foo.txt`` (the ``$`` is special to ``grep``: it matches the end of the line).
 
 ::
-   apt install "postgres-*"
+
+    apt install "postgres-*"
 
 installs all packages with a name starting with "postgres-", instead of looking through the current directory for files named "postgres-something".
 
@@ -264,7 +265,7 @@ Now let's see a few cases::
 
   # Show the "out" on stderr, silence the "err"
   print >&2 2>/dev/null
-  
+
   # Silence both
   print >/dev/null 2>&1
 

From 72edd888f1f06bc23fa349054fa137e281fcc602 Mon Sep 17 00:00:00 2001
From: Fabian Boehm <FHomborg@gmail.com>
Date: Wed, 12 Jul 2023 17:59:43 +0200
Subject: [PATCH 060/200] Return a falsey status if the last `-c` command has a
 parse error

This makes `fish -c begin` fail with a status of 127 - it already
printed a syntax error so that was weird. (127 was the status for
syntax errors when piping to fish, so we stay consistent with that)

We allow multiple `-c` commands, and this will return the regular
status if the last `-c` succeeded.

This is fundamentally an extremely weird situation but this is the
simple targeted fix - we did nothing, unsuccessfully, so we should
fail.

Things to consider in future:

1. Return something better than 127 - that's the status for "unknown
command"!
2. Fail after a `-c` failed, potentially even checking all of them
before executing the first?

Fixes #9888

(cherry picked from commit a6c36a014c4a55d96c395ccfa418d6c761bd32da)
---
 src/fish.cpp            |  6 +++++-
 tests/checks/basic.fish | 22 ++++++++++++++++++++++
 2 files changed, 27 insertions(+), 1 deletion(-)

diff --git a/src/fish.cpp b/src/fish.cpp
index 56dba892e..1e2aa7dc5 100644
--- a/src/fish.cpp
+++ b/src/fish.cpp
@@ -258,6 +258,7 @@ static void read_init(parser_t &parser, const struct config_paths_t &paths) {
 
 static int run_command_list(parser_t &parser, const std::vector<std::string> &cmds,
                             const io_chain_t &io) {
+    int retval = STATUS_CMD_OK;
     for (const auto &cmd : cmds) {
         wcstring cmd_wcs = str2wcstring(cmd);
         // Parse into an ast and detect errors.
@@ -273,14 +274,17 @@ static int run_command_list(parser_t &parser, const std::vector<std::string> &cm
             parsed_source_ref_t ps =
                 std::make_shared<parsed_source_t>(std::move(cmd_wcs), std::move(ast));
             parser.eval(ps, io);
+            retval = STATUS_CMD_OK;
         } else {
             wcstring sb;
             parser.get_backtrace(cmd_wcs, errors, sb);
             std::fwprintf(stderr, L"%ls", sb.c_str());
+            // XXX: Why is this the return for "unknown command"?
+            retval = STATUS_CMD_UNKNOWN;
         }
     }
 
-    return 0;
+    return retval;
 }
 
 /// Parse the argument list, return the index of the first non-flag arguments.
diff --git a/tests/checks/basic.fish b/tests/checks/basic.fish
index 60a4e18a2..f85280e29 100644
--- a/tests/checks/basic.fish
+++ b/tests/checks/basic.fish
@@ -569,24 +569,46 @@ $fish -c 'echo \utest'
 # CHECKERR: echo \utest
 # CHECKERR:      ^~~~~^
 
+echo $status
+# CHECK: 127
+
 $fish -c 'echo \c'
 # CHECKERR: fish: Incomplete escape sequence '\c'
 # CHECKERR: echo \c
 # CHECKERR:      ^^
 
+echo $status
+# CHECK: 127
+
 $fish -c 'echo \C'
 # CHECK: C
+echo $status
+# CHECK: 0
 
 $fish -c 'echo \U'
 # CHECKERR: fish: Incomplete escape sequence '\U'
 # CHECKERR: echo \U
 # CHECKERR:      ^^
 
+echo $status
+# CHECK: 127
+
 $fish -c 'echo \x'
 # CHECKERR: fish: Incomplete escape sequence '\x'
 # CHECKERR: echo \x
 # CHECKERR:      ^^
 
+echo $status
+# CHECK: 127
+
+$fish -c begin
+# CHECKERR: fish: Missing end to balance this begin
+# CHECKERR: begin
+# CHECKERR: ^~~~^
+
+echo $status
+# CHECK: 127
+
 printf '%s\n' "#!/bin/sh" 'echo $0' > $tmpdir/argv0.sh
 chmod +x $tmpdir/argv0.sh
 cd $tmpdir

From 9892ce3a5a889faf62c41e9f889c59b8e79da0ad Mon Sep 17 00:00:00 2001
From: Fabian Boehm <FHomborg@gmail.com>
Date: Fri, 14 Jul 2023 20:17:19 +0200
Subject: [PATCH 061/200] wildcard: Remove useless access() call for trailing
 slash

This confirmed that a file existed via access(file, F_OK).

But we already *know* that it does because this is the expansion for
the "trailing slash" - by definition all wildcard components up to
here have already been checked.

And it's not checking for directoryness either because it does F_OK.

This will remove one `access()` per result, which will cut the number
of syscalls needed for a glob that ends in a "/" in half.

This brings us on-par with e.g. `ls` (which uses statx while we use
newfstatat, but that should have about the same results)

Fixes #9891.

(cherry picked from commit 6823f5e3374f00f43e9d20a4db12d63e0bc5da84)
---
 src/wildcard.cpp | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/src/wildcard.cpp b/src/wildcard.cpp
index d11229d58..5d9d65543 100644
--- a/src/wildcard.cpp
+++ b/src/wildcard.cpp
@@ -676,11 +676,8 @@ void wildcard_expander_t::expand_trailing_slash(const wcstring &base_dir, const
     }
 
     if (!(flags & expand_flag::for_completions)) {
-        // Trailing slash and not accepting incomplete, e.g. `echo /xyz/`. Insert this file if it
-        // exists.
-        if (waccess(base_dir, F_OK) == 0) {
-            this->add_expansion_result(wcstring{base_dir});
-        }
+        // Trailing slash and not accepting incomplete, e.g. `echo /xyz/`. Insert this file, we already know it exists!
+        this->add_expansion_result(wcstring{base_dir});
     } else {
         // Trailing slashes and accepting incomplete, e.g. `echo /xyz/<tab>`. Everything is added.
         dir_iter_t dir = open_dir(base_dir);

From a573d13cf04a711c51ab3b40647b7d33ad5d8bb9 Mon Sep 17 00:00:00 2001
From: Fabian Boehm <FHomborg@gmail.com>
Date: Sun, 18 Jun 2023 21:27:29 +0200
Subject: [PATCH 062/200] completions/unzip: Dangit FreeBSD

No "--help" and the man page doesn't mention "-h".

(cherry picked from commit 0cfdc9055132f2842007da95bf105a8d122141c3)
---
 share/completions/unzip.fish | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/share/completions/unzip.fish b/share/completions/unzip.fish
index e258294c5..68864d1a1 100644
--- a/share/completions/unzip.fish
+++ b/share/completions/unzip.fish
@@ -23,11 +23,12 @@ complete -c unzip -s X -d "restore UID/GID info"
 complete -c unzip -s V -d "retain VMS version numbers"
 complete -c unzip -s K -d "keep setuid/setgid/tacky permissions"
 complete -c unzip -s M -d "pipe through `more` pager"
-# Some distro has -O and -I, some hasn't.
-if unzip --help | string match -rq -- -O
+# Some distros have -O and -I, some don't.
+# Even "-h" might not be available.
+if unzip -h 2>/dev/null | string match -rq -- -O
     complete -c unzip -s O -d "specify a character encoding for DOS, Windows and OS/2 archives" -x -a "(__fish_print_encodings)"
 end
-if unzip --help | string match -rq -- -I
+if unzip -h 2>/dev/null | string match -rq -- -I
     complete -c unzip -s I -d "specify a character encoding for UNIX and other archives" -x -a "(__fish_print_encodings)"
 end
 

From a7c8e0cdfba08eff7b118985a1261aa0ac23999a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Henrik=20H=C3=B8rl=C3=BCck=20Berg?=
 <36937807+henrikhorluck@users.noreply.github.com>
Date: Mon, 17 Jul 2023 14:53:03 +0200
Subject: [PATCH 063/200] Fix #9899 integer overflow in string repeat

We could end up overflowing if we print out something that's a multiple of the
chunk size, which would then finish printing in the chunk-printing, but not
break out early.

(cherry picked from commit 6325b3662de122b571e33b7121cfc9d172d483bc)
---
 src/builtins/string.cpp  | 5 ++++-
 tests/checks/string.fish | 4 ++++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/builtins/string.cpp b/src/builtins/string.cpp
index 0b1cf8df1..33c131a86 100644
--- a/src/builtins/string.cpp
+++ b/src/builtins/string.cpp
@@ -1541,7 +1541,7 @@ static int string_repeat(parser_t &parser, io_streams_t &streams, int argc, cons
         wcstring chunk;
         chunk.reserve(std::min(chunk_size + w.length(), max));
 
-        for (size_t i = max; i > 0; i -= w.length()) {
+        for (size_t i = max; i > 0;) {
             // Build up the chunk.
             if (i >= w.length()) {
                 chunk.append(w);
@@ -1549,6 +1549,9 @@ static int string_repeat(parser_t &parser, io_streams_t &streams, int argc, cons
                 chunk.append(w.substr(0, i));
                 break;
             }
+
+            i -= w.length();
+
             if (chunk.length() >= chunk_size) {
                 // We hit the chunk size, write it repeatedly until we can't anymore.
                 streams.out.append(chunk);
diff --git a/tests/checks/string.fish b/tests/checks/string.fish
index 52dcec924..8ffeef150 100644
--- a/tests/checks/string.fish
+++ b/tests/checks/string.fish
@@ -530,6 +530,10 @@ string repeat -n 17 a | string length
 string repeat -m 5 (string repeat -n 500000 aaaaaaaaaaaaaaaaaa) | string length
 # CHECK: 5
 
+# might cause integer overflow
+string repeat -n 2999 \n | count
+# CHECK: 3000
+
 # Test equivalent matches with/without the --entire, --regex, and --invert flags.
 string match -e x abc dxf xyz jkx x z
 or echo exit 1

From f95b8470a2cfe1312750fd28b8b5bd9419ce8903 Mon Sep 17 00:00:00 2001
From: EmilySeville7cfg <EmilySeville7cfg@gmail.com>
Date: Fri, 21 Jul 2023 04:52:49 +1000
Subject: [PATCH 064/200] feat(completions): gimp support

(cherry picked from commit 2bc605625e974e0adbc05603b77446a63d6fae7b)
---
 share/completions/gimp.fish | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)
 create mode 100644 share/completions/gimp.fish

diff --git a/share/completions/gimp.fish b/share/completions/gimp.fish
new file mode 100644
index 000000000..fcbaace37
--- /dev/null
+++ b/share/completions/gimp.fish
@@ -0,0 +1,29 @@
+complete -c gimp -s h -l help -d 'show help'
+complete -c gimp -l help-all -d 'show help with advanced options'
+complete -c gimp -l help-gtk -d 'show help with GTK+ options'
+complete -c gimp -l help-gegl -d 'show help with GEGL options'
+complete -c gimp -s v -l version -d 'show version'
+complete -c gimp -l license -d 'show licence'
+
+complete -c gimp -l verbose -d 'show verbosely'
+complete -c gimp -s n -l new-instance -d 'open new instance'
+complete -c gimp -s a -l as-new -d 'open with new images'
+
+complete -c gimp -s i -l no-interface -d 'hide UI'
+complete -c gimp -s d -l no-data -d 'do not load patterns, gradients, palettes, and brushes'
+complete -c gimp -s f -l no-fonts -d 'do not load fonts'
+complete -c gimp -s s -l no-splash -d 'hide splash screen'
+complete -c gimp -l no-shm -d 'do not use shared memory'
+complete -c gimp -l no-cpu-accel -d 'do not use CPU acceleration'
+
+complete -c gimp -l display -d 'open with X display' -r
+complete -c gimp -l session -d 'open with alternative sessionrc' -r
+complete -c gimp -s g -l gimprc -d 'open with alternative gimprc' -r
+complete -c gimp -l system-gimprc -d 'open with alternative system gimprc' -r
+complete -c gimp -l dump-gimprc -d 'show gimprc'
+complete -c gimp -l console-messages -d 'show messages on the console'
+complete -c gimp -l debug-handlers -d 'enable debug handlers'
+complete -c gimp -l stack-trace-mode -d 'whether generate stack-trace in case of fatal signals' -a 'never query always' -x
+complete -c gimp -l pdb-compat-mode -d 'whether PDB provides aliases for deprecated functions' -a 'off on warn' -x
+complete -c gimp -l batch-interpreter -d 'run procedure to use to process batch events' -r
+complete -c gimp -s b -l batch -d 'run command non-interactively' -a '-' -r

From 7c44f78490e095f5b9b3550b910b40584ae5eaac Mon Sep 17 00:00:00 2001
From: Pavel savchenko <asfaltboy@gmail.com>
Date: Wed, 26 Jul 2023 08:03:18 +0100
Subject: [PATCH 065/200] Docs: correct small grammatical error in read.rst

(cherry picked from commit c56f9e198174cd740eed200deac677e322cce1ce)
---
 doc_src/cmds/read.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc_src/cmds/read.rst b/doc_src/cmds/read.rst
index b26f92a81..ab19e063a 100644
--- a/doc_src/cmds/read.rst
+++ b/doc_src/cmds/read.rst
@@ -106,7 +106,7 @@ The following code stores the value 'hello' in the shell variable :envvar:`foo`.
 
     echo hello|read foo
 
-While this is a neat way to handle command output line-by-line::
+The :doc:`while <while>` command is a neat way to handle command output line-by-line::
 
     printf '%s\n' line1 line2 line3 line4 | while read -l foo
                       echo "This is another line: $foo"

From 8430afbeadc072720e92e72950e6613aedf587b7 Mon Sep 17 00:00:00 2001
From: Emily Grace Seville <EmilySeville7cfg@gmail.com>
Date: Fri, 28 Jul 2023 01:42:55 +1000
Subject: [PATCH 066/200] Add Blender completions (#9905)

(cherry picked from commit 8d3885b9cbeaaac40b26e0510d23a5eac98683b7)
---
 share/completions/blender.fish | 125 +++++++++++++++++++++++++++++++++
 1 file changed, 125 insertions(+)
 create mode 100644 share/completions/blender.fish

diff --git a/share/completions/blender.fish b/share/completions/blender.fish
new file mode 100644
index 000000000..ada9942a5
--- /dev/null
+++ b/share/completions/blender.fish
@@ -0,0 +1,125 @@
+function __blender_list_scenes -a file
+    blender --background $file --python-expr 'import bpy
+
+for name in [scene.name for scene in list(bpy.data.scenes)]:
+    print(f"\t{name}")' |
+        string replace -r -f '^\s+' ''
+end
+
+function __blender_list_addons
+    path basename /usr/share/blender/scripts/addons/*.py |
+        path change-extension ''
+end
+
+function __blender_list_engines
+    blender --background --engine help | string replace -r -f '^\s+' ''
+end
+
+function __blender_echo_input_file_name
+    echo $argv |
+        string split -n ' ' |
+        string match -r -v '^-' |
+        head --lines=1
+end
+
+function __blender_complete_addon_list
+    set -l previous_token (commandline -oc)[-1]
+    set -l current_token (commandline -t)
+
+    if test "$previous_token" = --addons
+        __blender_list_addons |
+            string replace -r '^' $current_token |
+            string replace -r '$' ','
+    end
+end
+
+complete -c blender -s h -l help -d 'show help'
+complete -c blender -s v -l version -d 'show version'
+
+complete -c blender -s b -l background -d 'hide UI'
+complete -c blender -s a -l render-anim -d 'specify render frames' -r
+complete -c blender -s S -l scene -a '(__blender_list_scenes (commandline -poc))' -n 'test -n (__blender_echo_input_file_name (commandline -poc))' -d 'specify scene' -x
+complete -c blender -s s -l frame-start -d 'specify start frame' -x
+complete -c blender -s e -l end-start -d 'specify end frame' -x
+complete -c blender -s j -l frame-jump -d 'skip frame count' -x
+complete -c blender -s o -l render-output -d 'specify render output' -r
+complete -c blender -s E -l engine -a '(__blender_list_engines)' -d 'render engine' -x
+complete -c blender -s t -l threads -d 'specify thread count'
+
+complete -c blender -s F -l render-format -a 'TGA RAWTGA JPEG IRIS IRIZ AVIRAW AVIJPEG PNG BMP' -d 'specify render format' -x
+complete -c blender -s x -l use-extension -a 'true false' -d 'whether add a file extension to an end of a file' -x
+
+complete -c blender -s a -d 'animation playback options' -x
+
+complete -c blender -s w -l window-border -d 'show window borders'
+complete -c blender -s W -l window-fullscreen -d 'show in fullscreen'
+complete -c blender -s p -l window-geometry -d 'specify position and size' -x
+complete -c blender -s M -l window-maximized -d 'maximize window'
+complete -c blender -o con -l start-console -d 'open console'
+complete -c blender -l no-native-pixels -d 'do not use native pixel size'
+complete -c blender -l no-native-pixels -d 'open unfocused'
+
+complete -c blender -s y -l enable-autoexec -d 'enable Python scripts automatic execution'
+complete -c blender -s Y -l disable-autoexec -d 'disable Python scripts automatic execution'
+complete -c blender -s P -l python -d 'specify Python script' -r
+complete -c blender -l python-text -d 'specify Python text block' -x
+complete -c blender -l python-expr -d 'specify Python expression' -x
+complete -c blender -l python-console -d 'open interactive console'
+complete -c blender -l python-exit-code -d 'specify Python exit code on exception'
+complete -c blender -l addons -a '(__blender_complete_addon_list)' -d 'specify addons' -x
+
+complete -c blender -l log -d 'enable logging categories' -x
+complete -c blender -l log-level -d 'specify log level' -x
+complete -c blender -l log-show-basename -d 'hide file leading path'
+complete -c blender -l log-show-backtrace -d 'show backtrace'
+complete -c blender -l log-show-timestamp -d 'show timestamp'
+complete -c blender -l log-file -d 'specify log file' -r
+
+complete -c blender -s d -l debug -d 'enable debugging'
+complete -c blender -l debug-value -d 'specify debug value'
+complete -c blender -l debug-events -d 'enable debug messages'
+complete -c blender -l debug-ffmpeg -d 'enable debug messages from FFmpeg library'
+complete -c blender -l debug-handlers -d 'enable debug messages for event handling'
+complete -c blender -l debug-libmv -d 'enable debug messages for libmv library'
+complete -c blender -l debug-cycles -d 'enable debug messages for Cycles'
+complete -c blender -l debug-memory -d 'enable fully guarded memory allocation and debugging'
+complete -c blender -l debug-jobs -d 'enable time profiling for background jobs'
+complete -c blender -l debug-python -d 'enable debug messages for Python'
+complete -c blender -l debug-depsgraph -d 'enable all debug messages for dependency graph'
+complete -c blender -l debug-depsgraph-evel -d 'enable debug messages for dependency graph related on evalution'
+complete -c blender -l debug-depsgraph-build -d 'enable debug messages for dependency graph related on its construction'
+complete -c blender -l debug-depsgraph-tag -d 'enable debug messages for dependency graph related on tagging'
+complete -c blender -l debug-depsgraph-no-threads -d 'enable single treaded evaluation for dependency graph'
+complete -c blender -l debug-depsgraph-time -d 'enable debug messages for dependency graph related on timing'
+complete -c blender -l debug-depsgraph-time -d 'enable colors for dependency graph debug messages'
+complete -c blender -l debug-depsgraph-uuid -d 'enable virefication for dependency graph session-wide identifiers'
+complete -c blender -l debug-ghost -d 'enable debug messages for Ghost'
+complete -c blender -l debug-wintab -d 'enable debug messages for Wintab'
+complete -c blender -l debug-gpu -d 'enable GPU debug context and infromation for OpenGL'
+complete -c blender -l debug-gpu-force-workarounds -d 'enable workarounds for typical GPU issues'
+complete -c blender -l debug-gpu-disable-ssbo -d 'disable shader storage buffer objects'
+complete -c blender -l debug-gpu-renderdoc -d 'enable Renderdoc integration'
+complete -c blender -l debug-wm -d 'enable debug messages for window manager'
+complete -c blender -l debug-xr -d 'enable debug messages for virtual reality contexts'
+complete -c blender -l debug-xr-time -d 'enable debug messages for virtual reality frame rendering times'
+complete -c blender -l debug-all -d 'enable all debug messages'
+complete -c blender -l debug-io -d 'enable debug for I/O'
+complete -c blender -l debug-exit-on-error -d 'whether exit on internal error'
+complete -c blender -l disable-crash-handler -d 'disable crash handler'
+complete -c blender -l disable-abort-handler -d 'disable abort handler'
+complete -c blender -l verbose -d 'specify logging verbosity level' -x
+
+complete -c blender -l gpu-backend -a 'vulkan metal opengl' -d 'specify GPI backend' -x
+
+complete -c blender -l open-last -d 'open the most recent .blend file'
+complete -c blender -l open-last -a 'default' -d 'specify app template' -r
+complete -c blender -l factory-startup -d 'do not read startup.blend'
+complete -c blender -l enable-event-simulate -d 'enable event simulation'
+complete -c blender -l env-system-datafiles -d 'set BLENDER_SYSTEM_DATAFILES variable'
+complete -c blender -l env-system-scripts -d 'set BLENDER_SYSTEM_SCRIPTS variable'
+complete -c blender -l env-system-python -d 'set BLENDER_SYSTEM_PYTHON variable'
+complete -c blender -o noaudio -d 'disable sound'
+complete -c blender -o setaudio -a 'None SDL OpenAL CoreAudio JACK PulseAudio WASAPI' -d 'specify sound device' -x
+complete -c blender -s R -d 'register .blend extension'
+complete -c blender -s r -d 'silently register .blend extension'
+

From cc72a88ba0fa6da1024c2122822a7a8514ac68ab Mon Sep 17 00:00:00 2001
From: Emily Grace Seville <EmilySeville7cfg@gmail.com>
Date: Fri, 28 Jul 2023 01:43:51 +1000
Subject: [PATCH 067/200] Add Krita completions (#9903)

* feat(completions): support Krita

* feat(completions): support summary options for Krita

* feat(completions): support remaining options for Krita

* feat(completions): remove debug instructions

* feat(completions): hide completions for sizes for Krita

* feat(completions): fix Krita

* feat(changelog): mention new completion

* fix(completions): refactor Krita

* fix(completion): reformat

* feat(completion): dynamically generate workspace list

* fix(completion): refactor

* fix(completion): krita

* fix(completions): use printf

(cherry picked from commit 6ce2ffbbb0ec74f5ff57210215cb3629a453d370)
---
 share/completions/krita.fish | 43 ++++++++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)
 create mode 100644 share/completions/krita.fish

diff --git a/share/completions/krita.fish b/share/completions/krita.fish
new file mode 100644
index 000000000..ec348544a
--- /dev/null
+++ b/share/completions/krita.fish
@@ -0,0 +1,43 @@
+function __krita_complete_image_format
+    set -l previous_token (commandline -oc)[-1]
+    set -l current_token (commandline -t)
+
+    if test "$previous_token" = --new-image
+        switch $current_token
+            case '*,*,*'
+                # nothing is completed as arbitrary width and height are expected
+            case '*,'
+                printf '%s,\n' U8 U16 F16 F32 |
+                    string replace -r '^' $current_token
+            case '*'
+                printf '%s,\n' RGBA XYZA LABA CMYKA GRAY YCbCrA
+        end
+    end
+end
+
+function __krita_list_workspaces
+    path basename ~/.local/share/krita/workspaces/*.kws |
+        path change-extension ''
+end
+
+complete -c krita -s h -l help -d 'show help'
+complete -c krita -l help-all -d 'show help with Qt options'
+complete -c krita -s v -l version -d 'show version'
+
+complete -c krita -l export -d 'export file as image'
+complete -c krita -l export-pdf -d 'export file as PDF'
+complete -c krita -l export-sequence -d 'export animation as sequence'
+
+complete -c krita -l export-filename -d 'exported filename' -n '__fish_seen_subcommand_from --export --export-pdf --export-sequence' -r
+
+complete -c krita -l template -d 'open template' -r
+
+complete -c krita -l nosplash -d 'hide splash screen'
+complete -c krita -l canvasonly -d 'open with canvasonly mode'
+complete -c krita -l fullscreen -d 'open with fullscreen mode'
+complete -c krita -l workspace -d 'open with workspace' -a '(__krita_list_workspaces)' -x
+complete -c krita -l file-layer -d 'open with file-layer' -r
+complete -c krita -l resource-location -d 'open with resource' -r
+
+complete -c krita -l new-image -d 'open with new image'
+complete -c krita -a '(__krita_complete_image_format)' -x

From f2d8112136157ad158e8f76ba01c2063db4b54cd Mon Sep 17 00:00:00 2001
From: AsukaMinato <i@asukaminato.eu.org>
Date: Wed, 26 Jul 2023 06:23:08 +0900
Subject: [PATCH 068/200] more gcc -O completion

https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html
(cherry picked from commit 2110b364268d1f765e693e3a6ba6c5ae65afec10)
---
 share/completions/gcc.fish | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/share/completions/gcc.fish b/share/completions/gcc.fish
index 512a0d23f..f7032cf6a 100644
--- a/share/completions/gcc.fish
+++ b/share/completions/gcc.fish
@@ -264,10 +264,15 @@ complete -c gcc -o dumpmachine -d 'Print the compiler’s target machine (for ex
 complete -c gcc -o dumpversion -d 'Print the compiler version (for example, 3.0,6.3 or 7)---and don’t do anything else'
 complete -c gcc -o dumpspecs -d 'Print the compiler’s built-in specs---and don’t do anything else'
 complete -c gcc -o feliminate-unused-debug-types -d 'Normally, when producing DWARF2 output, GCC will emit debugging information for all types declared in a compilation unit, regardless of whether or not they are actually used in that compilation unit'
+complete -c gcc -o O -d 'Optimize'
+complete -c gcc -o O1 -d 'Optimize'
 complete -c gcc -o O2 -d 'Optimize even more'
 complete -c gcc -o O3 -d 'Optimize yet more'
 complete -c gcc -o O0 -d 'Do not optimize'
 complete -c gcc -o Os -d 'Optimize for size'
+complete -c gcc -o Ofast -d 'Disregard strict standards compliance'
+complete -c gcc -o Og -d 'Optimize debugging experience'
+complete -c gcc -o Oz -d 'Optimize aggressively for size rather than speed'
 complete -c gcc -o fno-default-inline -d 'Do not make member functions inline by default merely because they are defined inside the class scope (C++ only)'
 complete -c gcc -o fno-defer-pop -d 'Always pop the arguments to each function call as soon as that function returns'
 complete -c gcc -o fforce-mem -d 'Force memory operands to be copied into registers before doing arithmetic on them'

From 7e75fe3d37e1d5e8ed090b39343e848e77f78206 Mon Sep 17 00:00:00 2001
From: AsukaMinato <i@asukaminato.eu.org>
Date: Sat, 29 Jul 2023 11:52:23 +0900
Subject: [PATCH 069/200] add gcc completion lm lz lrt (#9919)

add some gcc completion options

(cherry picked from commit 9a9e133b184601ff838ef6bae825709adc227d19)
---
 share/completions/gcc.fish | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/share/completions/gcc.fish b/share/completions/gcc.fish
index f7032cf6a..2cbdd06b2 100644
--- a/share/completions/gcc.fish
+++ b/share/completions/gcc.fish
@@ -491,6 +491,9 @@ complete -c gcc -s S -d 'Stop after the stage of compilation proper; do not asse
 complete -c gcc -s E -d 'Stop after the preprocessing stage; do not run the compiler proper'
 complete -c gcc -o llibrary -d 'Search the library named library when linking'
 complete -c gcc -s l -d 'Search the library named library when linking'
+complete -c gcc -o lm -d 'Search the math library when linking'
+complete -c gcc -o lz -d 'Search the zlib library when linking'
+complete -c gcc -o lrt -d 'Search the realtime extensions library when linking'
 complete -c gcc -o lobjc -d 'You need this special case of the -l option in order to link an Objective-C or Objective-C++ program'
 complete -c gcc -o nostartfiles -d 'Do not use the standard system startup files when linking'
 complete -c gcc -o nodefaultlibs -d 'Do not use the standard system libraries when linking'

From d1f3058c6d8e33e980a6c89db20fb1ea4fc8f2d0 Mon Sep 17 00:00:00 2001
From: Fabian Boehm <FHomborg@gmail.com>
Date: Thu, 3 Aug 2023 17:44:54 +0200
Subject: [PATCH 070/200] Remove a waccess call when completing executables

We have already run waccess with X_OK. We already *know* the file is
executable.

There is no reason to check again.

Restores some of the speedup from the fast_waccess hack that was
removed to fix #9699.

(cherry picked from commit ee75b4568723c5c260394a42cc41ab999ffd5b71)
---
 src/wildcard.cpp | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/src/wildcard.cpp b/src/wildcard.cpp
index 5d9d65543..f5404650a 100644
--- a/src/wildcard.cpp
+++ b/src/wildcard.cpp
@@ -337,7 +337,7 @@ wildcard_result_t wildcard_complete(const wcstring &str, const wchar_t *wc,
 /// \param err The errno value after a failed stat call on the file.
 static const wchar_t *file_get_desc(const wcstring &filename, int lstat_res,
                                     const struct stat &lbuf, int stat_res, const struct stat &buf,
-                                    int err) {
+                                    int err, bool definitely_executable) {
     if (lstat_res) {
         return COMPLETE_FILE_DESC;
     }
@@ -347,10 +347,12 @@ static const wchar_t *file_get_desc(const wcstring &filename, int lstat_res,
             if (S_ISDIR(buf.st_mode)) {
                 return COMPLETE_DIRECTORY_SYMLINK_DESC;
             }
-            if (buf.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH) && waccess(filename, X_OK) == 0) {
+            if (definitely_executable || (buf.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH) && waccess(filename, X_OK) == 0)) {
                 // Weird group permissions and other such issues make it non-trivial to find out if
                 // we can actually execute a file using the result from stat. It is much safer to
                 // use the access function, since it tells us exactly what we want to know.
+                //
+                // We skip this check in case the caller tells us the file is definitely executable.
                 return COMPLETE_EXEC_LINK_DESC;
             }
 
@@ -371,10 +373,12 @@ static const wchar_t *file_get_desc(const wcstring &filename, int lstat_res,
         return COMPLETE_SOCKET_DESC;
     } else if (S_ISDIR(buf.st_mode)) {
         return COMPLETE_DIRECTORY_DESC;
-    } else if (buf.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH) && waccess(filename, X_OK) == 0) {
+    } else if (definitely_executable || (buf.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH) && waccess(filename, X_OK) == 0)) {
         // Weird group permissions and other such issues make it non-trivial to find out if we can
         // actually execute a file using the result from stat. It is much safer to use the access
         // function, since it tells us exactly what we want to know.
+        //
+        // We skip this check in case the caller tells us the file is definitely executable.
         return COMPLETE_EXEC_DESC;
     }
 
@@ -441,7 +445,9 @@ static bool wildcard_test_flags_then_complete(const wcstring &filepath, const wc
     // Compute the description.
     wcstring desc;
     if (expand_flags & expand_flag::gen_descriptions) {
-        desc = file_get_desc(filepath, lstat_res, lstat_buf, stat_res, stat_buf, stat_errno);
+        // If we have executables_only, we already checked waccess above,
+        // so we tell file_get_desc that this file is definitely executable so it can skip the check.
+        desc = file_get_desc(filepath, lstat_res, lstat_buf, stat_res, stat_buf, stat_errno, executables_only);
 
         if (!is_directory && !is_executable && file_size >= 0) {
             if (!desc.empty()) desc.append(L", ");

From 7a60613b79240968e1de1baefef2de7e94333abc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gabriel=20G=C3=B3rski?= <glaeqen@gmail.com>
Date: Wed, 9 Aug 2023 17:28:01 +0200
Subject: [PATCH 071/200] Simplify and fix `__fish_is_zfs_feature_enabled`
 (#9939)

* Simplify and fix `__fish_is_zfs_feature_enabled`

Previously `__fish_is_zfs_feature_enabled` was doing
`<whitespace>$queried_feature<whitespace>` pattern matching which
was skipping the state part expected in the follow-up checking code.

Passing the dataset/snapshot in a `target` argument is pointless. As
none of the existing code attempts to do this plus it is also a
private function (`__` prefix), rename of the argument and removal
of extra text replacement should not be considered a breaking change.

* Changed the `&& \` into `|| return`

* Run `fish_indent`

(cherry picked from commit 21ddfabb8d2ff8180419230c7fac462604843ed5)
---
 .../__fish_is_zfs_feature_enabled.fish        | 22 +++++--------------
 1 file changed, 6 insertions(+), 16 deletions(-)

diff --git a/share/functions/__fish_is_zfs_feature_enabled.fish b/share/functions/__fish_is_zfs_feature_enabled.fish
index 66a4bca8f..8949ce41e 100644
--- a/share/functions/__fish_is_zfs_feature_enabled.fish
+++ b/share/functions/__fish_is_zfs_feature_enabled.fish
@@ -1,17 +1,7 @@
-function __fish_is_zfs_feature_enabled -a feature target -d "Returns 0 if the given ZFS feature is available or enabled for the given full-path target (zpool or dataset), or any target if none given"
-    type -q zpool
-    or return
-    set -l pool (string replace -r '/.*' '' -- $target)
-    set -l feature_name ""
-    if test -z "$pool"
-        set feature_name (zpool get -H all 2>/dev/null | string match -r "\s$feature\s")
-    else
-        set feature_name (zpool get -H all $pool 2>/dev/null | string match -r "$pool\s$feature\s")
-    end
-    if test $status -ne 0 # No such feature
-        return 1
-    end
-    set -l state (echo $feature_name | cut -f3)
-    string match -qr '(active|enabled)' -- $state
-    return $status
+function __fish_is_zfs_feature_enabled \
+    -a feature pool \
+    -d "Returns 0 if the given ZFS pool feature is active or enabled for the given pool or for any pool if none specified"
+
+    type -q zpool || return
+    zpool get -H -o value $feature $pool 2>/dev/null | string match -rq '^(enabled|active)$'
 end

From c8177bdd3061bb23027f369153d16a0b1e3591c3 Mon Sep 17 00:00:00 2001
From: Emily Grace Seville <EmilySeville7cfg@gmail.com>
Date: Thu, 10 Aug 2023 01:30:34 +1000
Subject: [PATCH 072/200] Add horcrux completion (#9922)

* feat(completions): horcrux

* feat(changelog): mention completion

* fix(completion): condition for -n

(cherry picked from commit f9d21cc21d6559891fe44f0bc325c25d291a7253)
---
 share/completions/horcrux.fish | 8 ++++++++
 1 file changed, 8 insertions(+)
 create mode 100644 share/completions/horcrux.fish

diff --git a/share/completions/horcrux.fish b/share/completions/horcrux.fish
new file mode 100644
index 000000000..aa05e2d71
--- /dev/null
+++ b/share/completions/horcrux.fish
@@ -0,0 +1,8 @@
+set -l subcommands 'bind split'
+set -l subcommand_show_condition "not __fish_seen_subcommand_from $subcommands"
+set -l split_option_show_condition "__fish_seen_subcommand_from split"
+
+complete -c horcrux -a bind -n "$subcommand_show_condition" -f -d 'Bind directory'
+complete -c horcrux -a split -n "$subcommand_show_condition" -f -d 'Split file'
+complete -c horcrux -s n -r -n "$split_option_show_condition" -d 'Count of horcruxes to make'
+complete -c horcrux -s t -r -n "$split_option_show_condition" -d 'Count of horcruxes required to resurrect the original file'

From 4e63cc23a4b5502df5fb915351a87a85c2f6d156 Mon Sep 17 00:00:00 2001
From: Roland Fredenhagen <dev@modprog.de>
Date: Fri, 11 Aug 2023 00:35:27 +0700
Subject: [PATCH 073/200] Add iwctl completions (#9932)

* Add iwctl completions

* review-comments

* options

(cherry picked from commit 408ab860906fbf6e08f314bea982220fdee3428e)
---
 share/completions/iwctl.fish | 147 +++++++++++++++++++++++++++++++++++
 1 file changed, 147 insertions(+)
 create mode 100644 share/completions/iwctl.fish

diff --git a/share/completions/iwctl.fish b/share/completions/iwctl.fish
new file mode 100644
index 000000000..96fe79e63
--- /dev/null
+++ b/share/completions/iwctl.fish
@@ -0,0 +1,147 @@
+# Execute an `iwctl ... list` command and parse output
+function __iwctl_filter
+    # set results "iwctl $cmd list | tail -n +5"
+    # if test -n "$empty"
+    #     set -a results "| string match --invert '*$empty*'"
+    # end
+    # eval "$results" | awk '{print $2}'
+    # awk does not work on multiline entries, therefor we use string match,
+    # which has the added benefit of filtering out the `No devices in ...` lines
+
+    # remove color escape sequences
+    set -l results (iwctl $argv | string replace -ra '\e\[[\d;]+m' '')
+    # calculate column widths
+    set -l headers $results[3]
+    set -l header_spaces (string match -a -r "  +" $headers | string length)
+    set -l first_column_label (string match -r "[^ ]+" $headers | string length)
+
+    # only take lines starting with `  `, i.e., no `No devices ...`
+    # then take the first column as substring
+    string match "  *" $results[5..] | string sub -s $header_spaces[1] -l (math $first_column_label + $header_spaces[2]) | string trim
+    # string match -rg "  .{$(math $header_spaces[1] - 2)}(.{$(math $first_column_label + $header_spaces[2])})" $results[5..] | string trim
+end
+
+function __iwctl_match_subcoms
+    set -l match (string split --no-empty " " $argv)
+
+    set argv (commandline -poc)
+    # iwctl allows to specify arguments for username, password, passphrase and dont-ask regardless of any following commands
+    argparse -i 'u/username=' 'p/password=' 'P/passphrase=' 'v/dont-ask' -- $argv
+    set argv $argv[2..]
+
+    if test (count $argv) != (count $match)
+        return 1
+    end
+
+    while set -q argv[1]
+        string match -q -- $match[1] $argv[1]
+        or return 1
+        set -e match[1] argv[1]
+    end
+end
+
+function __iwctl_connect
+    set argv (commandline -poc)
+    # remove all options
+    argparse -i 'u/username=' 'p/password=' 'P/passphrase=' 'v/dont-ask' -- $argv
+    # station name should now be the third argument (`iwctl station <wlan>`)
+    __iwctl_filter station $argv[3] get-networks
+end
+
+# The `empty` messages in case we want to go back to using those
+# set ad_hoc '(__iwctl_filter ad-hoc "No devices in Ad-Hoc mode available.")'
+# set adpater '(__iwctl_filter adapter)'
+# set ap '(__iwctl_filter ap "No devices in access point mode available.")'
+# set device '(__iwctl_filter device)'
+# set dpp '(__iwctl_filter dpp "No DPP-capable devices available")'
+# set known_networks '(__iwctl_filter known-networks)'
+# set station '(__iwctl_filter station "No devices in Station mode available.")'
+# set wsc '(__iwctl_filter wsc "No WSC-capable devices available")'
+
+complete -f iwctl
+
+# Options
+complete -c iwctl -s h -l help
+complete -c iwctl -s p -l password -rf
+complete -c iwctl -s u -l username -rf
+complete -c iwctl -s P -l passphrase -rf
+complete -c iwctl -s v -l dont-ask -d "Don't ask for missing credentials"
+
+# Subcommand
+complete -c iwctl -n '__iwctl_match_subcoms' \
+    -a "ad-hoc adapter ap debug device dpp exit help known-networks quit station version wsc"
+
+# ad-hoc
+complete -c iwctl -n '__iwctl_match_subcoms ad-hoc' -a list -d "List devices in Ad-Hoc mode"
+complete -c iwctl -n '__iwctl_match_subcoms ad-hoc' -a "(__iwctl_filter ad-hoc list)"
+complete -c iwctl -n '__iwctl_match_subcoms "ad-hoc *"' -n 'not __iwctl_match_subcoms ad-hoc list' -a start -d "Start or join an Ad-Hoc network"
+complete -c iwctl -n '__iwctl_match_subcoms "ad-hoc *"' -n 'not __iwctl_match_subcoms ad-hoc list' -a start_open -d "Start of join an open Ad-Hoc network"
+complete -c iwctl -n '__iwctl_match_subcoms "ad-hoc *"' -n 'not __iwctl_match_subcoms ad-hoc list' -a stop -d "Leave an Ad-Hoc network"
+
+# adapter
+complete -c iwctl -n '__iwctl_match_subcoms adapter' -a "list" -d "List adapters"
+complete -c iwctl -n '__iwctl_match_subcoms adapter' -a "(__iwctl_filter adapter list)"
+complete -c iwctl -n '__iwctl_match_subcoms "adapter *"' -n 'not __iwctl_match_subcoms adapter list' -a "show" -d "Show adapter info"
+complete -c iwctl -n '__iwctl_match_subcoms "adapter *"' -n 'not __iwctl_match_subcoms adapter list' -a "set-property" -d "Set property"
+# TODO implement completions for `properties`, i.e. all rows with `*` in first column
+
+# ap
+complete -c iwctl -n '__iwctl_match_subcoms ap' -a "list" -d "List devices in AP mode"
+complete -c iwctl -n '__iwctl_match_subcoms ap' -a "(__iwctl_filter ap list)"
+complete -c iwctl -n '__iwctl_match_subcoms "ap *"' -n 'not __iwctl_match_subcoms ap list' -a start -d "Start an access point"
+complete -c iwctl -n '__iwctl_match_subcoms "ap *"' -n 'not __iwctl_match_subcoms ap list' -a start-profile -d "Start an access point based on a disk profile"
+complete -c iwctl -n '__iwctl_match_subcoms "ap *"' -n 'not __iwctl_match_subcoms ap list' -a stop -d "Stop a started access point"
+complete -c iwctl -n '__iwctl_match_subcoms "ap *"' -n 'not __iwctl_match_subcoms ap list' -a show -d "Show AP info"
+complete -c iwctl -n '__iwctl_match_subcoms "ap *"' -n 'not __iwctl_match_subcoms ap list' -a get-networks -d "Get network list after scanning"
+
+# debug
+complete -c iwctl -n '__iwctl_match_subcoms "debug *"' -a connect -d "Connect to a specific BSS"
+complete -c iwctl -n '__iwctl_match_subcoms "debug *"' -a roam -d "Roam to a BSS"
+complete -c iwctl -n '__iwctl_match_subcoms "debug *"' -a get-networks -d "Get networks"
+complete -c iwctl -n '__iwctl_match_subcoms "debug *"' -a autoconnect -d "Set autoconnect property"
+complete -c iwctl -n '__iwctl_match_subcoms "debug * autoconnect"' -a "on off" -d "Set autoconnect property"
+
+# device
+complete -c iwctl -n '__iwctl_match_subcoms device' -a "list" -d "List devices"
+complete -c iwctl -n '__iwctl_match_subcoms device' -a "(__iwctl_filter device list)"
+complete -c iwctl -n '__iwctl_match_subcoms "device *"' -n 'not __iwctl_match_subcoms device list' -a "show" -d "Show device info"
+complete -c iwctl -n '__iwctl_match_subcoms "device *"' -n 'not __iwctl_match_subcoms device list' -a "set-property" -d "Set property"
+# TODO implement completions for `properties`, i.e. all rows with `*` in first column
+
+# dpp
+complete -c iwctl -n '__iwctl_match_subcoms dpp' -a "list" -d "List DPP-capable devices"
+complete -c iwctl -n '__iwctl_match_subcoms dpp' -a "(__iwctl_filter dpp list)"
+complete -c iwctl -n '__iwctl_match_subcoms "dpp *"' -n 'not __iwctl_match_subcoms dpp list' -a start-enrollee -d "Starts a DPP Enrollee"
+complete -c iwctl -n '__iwctl_match_subcoms "dpp *"' -n 'not __iwctl_match_subcoms dpp list' -a start-configurator -d "Starts a DPP Configurator"
+complete -c iwctl -n '__iwctl_match_subcoms "dpp *"' -n 'not __iwctl_match_subcoms dpp list' -a stop -d "Aborts a DPP operations"
+complete -c iwctl -n '__iwctl_match_subcoms "dpp *"' -n 'not __iwctl_match_subcoms dpp list' -a show -d "Show the DPP state"
+
+# known-networks
+# TODO Does not support SSIDs ending/starting on whitespace. Not sure how to fix.
+complete -c iwctl -n '__iwctl_match_subcoms known-networks' -a "list" -d "List known networks"
+complete -c iwctl -n '__iwctl_match_subcoms known-networks' -a "(__iwctl_filter known-networks list)"
+complete -c iwctl -n '__iwctl_match_subcoms "known-networks *"' -n 'not __iwctl_match_subcoms known-networks list' -a forget -d "Forget a known network"
+complete -c iwctl -n '__iwctl_match_subcoms "known-networks *"' -n 'not __iwctl_match_subcoms known-networks list' -a show -d "Show nown network"
+complete -c iwctl -n '__iwctl_match_subcoms "known-networks *"' -n 'not __iwctl_match_subcoms known-networks list' -a set-property -d "Set property"
+
+# station
+complete -c iwctl -n '__iwctl_match_subcoms station' -a "list" -d "List devices in Station mode"
+complete -c iwctl -n '__iwctl_match_subcoms station' -a "(__iwctl_filter station list)"
+complete -c iwctl -n '__iwctl_match_subcoms "station *"' -n 'not __iwctl_match_subcoms station list' -a connect -d "Connect to network"
+complete -c iwctl -n '__iwctl_match_subcoms "station * connect"' -a "(__iwctl_connect)" -d "Connect to network"
+complete -c iwctl -n '__iwctl_match_subcoms "station *"' -n 'not __iwctl_match_subcoms station list' -a connect-hidden -d "Connect to hidden network"
+complete -c iwctl -n '__iwctl_match_subcoms "station *"' -n 'not __iwctl_match_subcoms station list' -a disconnect -d "Disconnect"
+complete -c iwctl -n '__iwctl_match_subcoms "station *"' -n 'not __iwctl_match_subcoms station list' -a get-networks -d "Get networks"
+complete -c iwctl -n '__iwctl_match_subcoms "station * get-networks"' -a "rssi-dbms rssi-bars"
+complete -c iwctl -n '__iwctl_match_subcoms "station *"' -n 'not __iwctl_match_subcoms station list' -a get-hidden-access-points -d "Get hidden APs"
+complete -c iwctl -n '__iwctl_match_subcoms "station * get-hidden-access-points"' -a "rssi-dbms"
+complete -c iwctl -n '__iwctl_match_subcoms "station *"' -n 'not __iwctl_match_subcoms station list' -a scan -d "Scan for networks"
+complete -c iwctl -n '__iwctl_match_subcoms "station *"' -n 'not __iwctl_match_subcoms station list' -a show -d "Show station info"
+
+# wsc
+complete -c iwctl -n '__iwctl_match_subcoms wsc' -a "list" -d "List WSC-capable devices"
+complete -c iwctl -n '__iwctl_match_subcoms wsc' -a "(__iwctl_filter wsc list)"
+complete -c iwctl -n '__iwctl_match_subcoms "wsc *"' -n 'not __iwctl_match_subcoms wsc list' -a push-button -d "PushButton Mode"
+complete -c iwctl -n '__iwctl_match_subcoms "wsc *"' -n 'not __iwctl_match_subcoms wsc list' -a start-user-pin -d "PIN mode"
+complete -c iwctl -n '__iwctl_match_subcoms "wsc *"' -n 'not __iwctl_match_subcoms wsc list' -a start-pin -d "PIN mode with generated PIN"
+complete -c iwctl -n '__iwctl_match_subcoms "wsc *"' -n 'not __iwctl_match_subcoms wsc list' -a cancel -d "Aborts WSC operations"

From c5490893c280039045983a1462edb9f610546190 Mon Sep 17 00:00:00 2001
From: Gregory Anders <greg@gpanders.com>
Date: Mon, 14 Aug 2023 09:27:06 -0500
Subject: [PATCH 074/200] Enable PWD reporting for iTerm2

(cherry picked from commit 69ef51f417cf30d396c33fce1c7cf0f05c5d5b4c)
---
 share/functions/__fish_config_interactive.fish | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/share/functions/__fish_config_interactive.fish b/share/functions/__fish_config_interactive.fish
index 97557a6a8..a0872ac5b 100644
--- a/share/functions/__fish_config_interactive.fish
+++ b/share/functions/__fish_config_interactive.fish
@@ -261,7 +261,7 @@ end" >$__fish_config_dir/config.fish
     end
 
     # Notify terminals when $PWD changes (issue #906).
-    # VTE based terminals, Terminal.app, iTerm.app (TODO), foot, and kitty support this.
+    # VTE based terminals, Terminal.app, iTerm.app, foot, and kitty support this.
     if not set -q FISH_UNIT_TESTS_RUNNING
         and begin
             string match -q -- 'foot*' $TERM
@@ -269,6 +269,7 @@ end" >$__fish_config_dir/config.fish
             or test 0"$VTE_VERSION" -ge 3405
             or test "$TERM_PROGRAM" = Apple_Terminal && test (string match -r '\d+' 0"$TERM_PROGRAM_VERSION") -ge 309
             or test "$TERM_PROGRAM" = WezTerm
+            or test "$TERM_PROGRAM" = iTerm.app
         end
         function __update_cwd_osc --on-variable PWD --description 'Notify capable terminals when $PWD changes'
             if status --is-command-substitution || set -q INSIDE_EMACS

From 7bf704fe87f72f8b9b0bc80c3fbfc50e3544ea4e Mon Sep 17 00:00:00 2001
From: Fabian Boehm <FHomborg@gmail.com>
Date: Tue, 15 Aug 2023 19:11:03 +0200
Subject: [PATCH 075/200] docs: Mention fish_cursor_replace

Fixes #9956

(cherry picked from commit c07136e8d3c07fb763d16f54502dcb934ac365c0)
---
 doc_src/interactive.rst | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/doc_src/interactive.rst b/doc_src/interactive.rst
index 592625857..19553ed12 100644
--- a/doc_src/interactive.rst
+++ b/doc_src/interactive.rst
@@ -418,8 +418,9 @@ The ``fish_vi_cursor`` function will be used to change the cursor's shape depend
    set fish_cursor_default block
    # Set the insert mode cursor to a line
    set fish_cursor_insert line
-   # Set the replace mode cursor to an underscore
+   # Set the replace mode cursors to an underscore
    set fish_cursor_replace_one underscore
+   set fish_cursor_replace underscore
    # The following variable can be used to configure cursor shape in
    # visual mode, but due to fish_cursor_default, is redundant here
    set fish_cursor_visual block

From cf955c07fcb38d3e1270a66728d9026ff8e8a294 Mon Sep 17 00:00:00 2001
From: Axlefublr <101342105+Axlefublr@users.noreply.github.com>
Date: Thu, 17 Aug 2023 04:05:59 +0800
Subject: [PATCH 076/200] fix __fish_list_current_token not recognizing ~ as
 $HOME (#9954)

* fix __fish_list_current_token not recognizing ~ as $HOME

* right. it was supposed to be $HOME. lol.

(cherry picked from commit fd68aca6eabe3762baaa227640d0c9341e694527)
---
 share/functions/__fish_list_current_token.fish | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/share/functions/__fish_list_current_token.fish b/share/functions/__fish_list_current_token.fish
index 1bfabd92f..59db6697f 100644
--- a/share/functions/__fish_list_current_token.fish
+++ b/share/functions/__fish_list_current_token.fish
@@ -2,7 +2,7 @@
 # of the directory under the cursor.
 
 function __fish_list_current_token -d "List contents of token under the cursor if it is a directory, otherwise list the contents of the current directory"
-    set -l val (commandline -t)
+    set -l val (commandline -t | string replace -r '^~' "$HOME")
     printf "\n"
     if test -d $val
         ls $val

From 85267199c7ebe2f61a075bedb05ce9a47a163d19 Mon Sep 17 00:00:00 2001
From: Roland Fredenhagen <dev@modprog.de>
Date: Sat, 19 Aug 2023 22:08:54 +0700
Subject: [PATCH 077/200] completions/iwctl: Show network details in completion
 (#9960)

* completions/iwctl: Show network details in completion

* apply review comments

(cherry picked from commit 556bee6893a1cfd5af909aaaff2221999ce759fa)
---
 share/completions/iwctl.fish | 47 +++++++++++++++++++++++++++++-------
 1 file changed, 38 insertions(+), 9 deletions(-)

diff --git a/share/completions/iwctl.fish b/share/completions/iwctl.fish
index 96fe79e63..5384d686c 100644
--- a/share/completions/iwctl.fish
+++ b/share/completions/iwctl.fish
@@ -1,5 +1,5 @@
 # Execute an `iwctl ... list` command and parse output
-function __iwctl_filter
+function __iwctl_filter -w iwctl
     # set results "iwctl $cmd list | tail -n +5"
     # if test -n "$empty"
     #     set -a results "| string match --invert '*$empty*'"
@@ -8,21 +8,34 @@ function __iwctl_filter
     # awk does not work on multiline entries, therefor we use string match,
     # which has the added benefit of filtering out the `No devices in ...` lines
 
+    argparse -i all-columns -- $argv
+
     # remove color escape sequences
     set -l results (iwctl $argv | string replace -ra '\e\[[\d;]+m' '')
     # calculate column widths
     set -l headers $results[3]
-    set -l header_spaces (string match -a -r "  +" $headers | string length)
-    set -l first_column_label (string match -r "[^ ]+" $headers | string length)
+    # We exploit the fact that all colum labels will have >2 space to the left, and inside column labels there is always only one space.
+    set -l leading_ws (string match -r "^ *" -- $headers | string length)
+    set -l column_widths (string match -a -r '(?<=  )\S.*?(?:  (?=\S)|$)' -- $headers | string length)
 
-    # only take lines starting with `  `, i.e., no `No devices ...`
-    # then take the first column as substring
-    string match "  *" $results[5..] | string sub -s $header_spaces[1] -l (math $first_column_label + $header_spaces[2]) | string trim
+    if set -ql _flag_all_columns
+        for line in (string match "  *" -- $results[5..] | string sub -s (math $leading_ws + 1))
+            for column_width in $column_widths
+                printf %s\t (string sub -l $column_width -- $line | string trim -r)
+                set line (string sub -s (math $column_width + 1) -- $line)
+            end
+            printf "\n"
+        end
+    else
+        # only take lines starting with `  `, i.e., no `No devices ...`
+        # then take the first column as substring
+        string match "  *" $results[5..] | string sub -s (math $leading_ws + 1) -l $column_widths[1] | string trim -r
+    end
     # string match -rg "  .{$(math $header_spaces[1] - 2)}(.{$(math $first_column_label + $header_spaces[2])})" $results[5..] | string trim
 end
 
 function __iwctl_match_subcoms
-    set -l match (string split --no-empty " " $argv)
+    set -l match (string split --no-empty " " -- $argv)
 
     set argv (commandline -poc)
     # iwctl allows to specify arguments for username, password, passphrase and dont-ask regardless of any following commands
@@ -45,7 +58,23 @@ function __iwctl_connect
     # remove all options
     argparse -i 'u/username=' 'p/password=' 'P/passphrase=' 'v/dont-ask' -- $argv
     # station name should now be the third argument (`iwctl station <wlan>`)
-    __iwctl_filter station $argv[3] get-networks
+    for network in (__iwctl_filter station $argv[3] get-networks rssi-dbms --all-columns)
+        set network (string split \t -- $network)
+        set -l strength "$network[3]"
+        # This follows iwctls display of * to ****
+        # https://git.kernel.org/pub/scm/network/wireless/iwd.git/tree/client/station.c?id=4a0a97379008489daa108c9bc0a4204c1ae9c6a8#n380
+        if test $strength -ge -6000
+            set strength 4
+        else if test $strength -ge -6700
+            set strength 3
+        else if test $strength -ge -7500
+            set strength 2
+        else
+            set strength 1
+        end
+
+        printf "%s\t[%s] - %s\n" "$network[1]" (string repeat -n $strength '*' | string pad -rw 4 -c -) "$network[2]"
+    end
 end
 
 # The `empty` messages in case we want to go back to using those
@@ -128,7 +157,7 @@ complete -c iwctl -n '__iwctl_match_subcoms "known-networks *"' -n 'not __iwctl_
 complete -c iwctl -n '__iwctl_match_subcoms station' -a "list" -d "List devices in Station mode"
 complete -c iwctl -n '__iwctl_match_subcoms station' -a "(__iwctl_filter station list)"
 complete -c iwctl -n '__iwctl_match_subcoms "station *"' -n 'not __iwctl_match_subcoms station list' -a connect -d "Connect to network"
-complete -c iwctl -n '__iwctl_match_subcoms "station * connect"' -a "(__iwctl_connect)" -d "Connect to network"
+complete -c iwctl -n '__iwctl_match_subcoms "station * connect"' -a "(__iwctl_connect)" -d "Connect to network" --keep-order
 complete -c iwctl -n '__iwctl_match_subcoms "station *"' -n 'not __iwctl_match_subcoms station list' -a connect-hidden -d "Connect to hidden network"
 complete -c iwctl -n '__iwctl_match_subcoms "station *"' -n 'not __iwctl_match_subcoms station list' -a disconnect -d "Disconnect"
 complete -c iwctl -n '__iwctl_match_subcoms "station *"' -n 'not __iwctl_match_subcoms station list' -a get-networks -d "Get networks"

From 5354fe111994214bd5fcb13f32aea3a78495a48b Mon Sep 17 00:00:00 2001
From: ysthakur <45539777+ysthakur@users.noreply.github.com>
Date: Sat, 19 Aug 2023 11:10:22 -0400
Subject: [PATCH 078/200] Replace more escapes with quotes in man parser
 (#9961)

* Replace \(aq with "'" in man parser

* Also replace oq, dq, lq, and rq

(cherry picked from commit 0f19d7118b10ee4354317888963c7291334e0173)
---
 share/tools/create_manpage_completions.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/share/tools/create_manpage_completions.py b/share/tools/create_manpage_completions.py
index b3c620288..e55df6e32 100755
--- a/share/tools/create_manpage_completions.py
+++ b/share/tools/create_manpage_completions.py
@@ -260,7 +260,12 @@ def remove_groff_formatting(data):
     data = data.replace(r"\-", "-")
     data = data.replace(".I", "")
     data = data.replace("\f", "")
+    data = data.replace(r"\(oq", "'")
     data = data.replace(r"\(cq", "'")
+    data = data.replace(r"\(aq", "'")
+    data = data.replace(r"\(dq", '"')
+    data = data.replace(r"\(lq", '"')
+    data = data.replace(r"\(rq", '"')
     return data
 
 

From 9dc0d3a6e84dc0f6f356ddfe4b83f012437d0c51 Mon Sep 17 00:00:00 2001
From: Kevin Cali <20154415+kevincali@users.noreply.github.com>
Date: Mon, 21 Aug 2023 11:33:54 +0200
Subject: [PATCH 079/200] docs: correct insert mode key

(cherry picked from commit 716001789b7789e71280868524fe860ae15daa0c)
---
 doc_src/interactive.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc_src/interactive.rst b/doc_src/interactive.rst
index 19553ed12..2adea7925 100644
--- a/doc_src/interactive.rst
+++ b/doc_src/interactive.rst
@@ -446,7 +446,7 @@ Command mode is also known as normal mode.
 
 - :kbd:`i` enters :ref:`insert mode <vi-mode-insert>` at the current cursor position.
 
-- :kbd:`Shift`\ +\ :kbd:`R` enters :ref:`insert mode <vi-mode-insert>` at the beginning of the line.
+- :kbd:`Shift`\ +\ :kbd:`I` enters :ref:`insert mode <vi-mode-insert>` at the beginning of the line.
 
 - :kbd:`v` enters :ref:`visual mode <vi-mode-visual>` at the current cursor position.
 

From ab45e4abf2927dbdba08e2fb31cae1da7f6a7c57 Mon Sep 17 00:00:00 2001
From: figurantpp <figurantpp@protonmail.com>
Date: Fri, 18 Aug 2023 21:50:44 -0300
Subject: [PATCH 080/200] Shortens rsync completion description

(cherry picked from commit 6473a9c763c867cd15ed022742e5081ad4cfaf88)
---
 share/completions/rsync.fish | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/share/completions/rsync.fish b/share/completions/rsync.fish
index 6d860099b..a7a977801 100644
--- a/share/completions/rsync.fish
+++ b/share/completions/rsync.fish
@@ -106,7 +106,7 @@ complete -c rsync -l modify-window -xa '(seq 0 10)' -d "Compare NUM mod-times wi
 complete -c rsync -s T -l temp-dir -xa '(__fish_complete_directories)' -d "Create temporary files in directory DIR"
 complete -c rsync -s y -l fuzzy -d "Find similar file for basis if no dest file"
 complete -c rsync -l compare-dest -xa '(__fish_complete_directories)' -d "Also compare received files relative to DIR"
-complete -c rsync -l copy-dest -xa '(__fish_complete_directories)' -d "Also compare received files relative to DIR and include copies of unchanged files"
+complete -c rsync -l copy-dest -xa '(__fish_complete_directories)' -d "Like compare-dest but also copies unchanged files"
 complete -c rsync -l link-dest -xa '(__fish_complete_directories)' -d "Hardlink to files in DIR when unchanged"
 complete -c rsync -s z -l compress -d "Compress file data during the transfer"
 complete -c rsync -l zc -l compress-choice -xa 'zstd lz4 zlibx zlib none' -d "Choose the compression algorithm"

From 136b99839bcca45d21c444b799412698ca107c0d Mon Sep 17 00:00:00 2001
From: Fabian Boehm <FHomborg@gmail.com>
Date: Tue, 22 Aug 2023 22:17:22 +0200
Subject: [PATCH 081/200] print_apt_packages: Go back to apt-cache for
 non-installed packages

Unfortunately, /var/lib/dpkg/status on recent-ish Debian versions at
least only contains the *installed* packages, rendering this solution
broken.

What we do instead is:

1. Remove a useless newline from each package, so our limit would now
let more full package data sets through
2. Increase the limit by 5x

This yields a completion that runs in ~800ms instead of ~700ms on a
raspberry pi, but gives ~10x the candidates, compared to the old
apt-cache version.

This partially reverts 96deaae7d86edfbc16e411bdb73bf54ced7fb447

(cherry picked from commit 81cd0359509621bd8fb11556bdfd65462ede54a9)
---
 .../functions/__fish_print_apt_packages.fish  | 36 ++++++++++++++++---
 1 file changed, 31 insertions(+), 5 deletions(-)

diff --git a/share/functions/__fish_print_apt_packages.fish b/share/functions/__fish_print_apt_packages.fish
index c8d578c9e..102895b1b 100644
--- a/share/functions/__fish_print_apt_packages.fish
+++ b/share/functions/__fish_print_apt_packages.fish
@@ -7,7 +7,12 @@ function __fish_print_apt_packages
             return
     end
 
-    type -q -f apt-cache || return 1
+    set -l search_term (commandline -ct | string replace -ar '[\'"\\\\]' '' | string lower)
+
+    if ! test -f /var/lib/dpkg/status
+        return 1
+    end
+
     if not set -q _flag_installed
         # Do not generate the cache as apparently sometimes this is slow.
         # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=547550
@@ -28,11 +33,32 @@ function __fish_print_apt_packages
         # The `head -n 500` causes us to stop once we have 500 lines. We do it after the `sed` because
         # Debian package descriptions can be extremely long and are hard-wrapped: texlive-latex-extra
         # has about 2700 lines on Debian 11.
-        apt-cache --no-generate show '.*'(commandline -ct)'.*' 2>/dev/null | sed -r '/^(Package|Description-?[a-zA-Z_]*):/!d;s/Package: (.*)/\1\t/g;s/Description-?[^:]*: (.*)/\1\x1a\n/g' | head -n 500 | string join "" | string replace --all --regex \x1a+ \n | uniq
+        apt-cache --no-generate show '.*'(commandline -ct)'.*' 2>/dev/null | sed -r '/^(Package|Description-?[a-zA-Z_]*):/!d;s/Package: (.*)/\1\t/g;s/Description-?[^:]*: (.*)/\1\x1a/g' | head -n 2500 | string join "" | string replace --all --regex \x1a+ \n | uniq
         return 0
     else
-        set -l packages (dpkg --get-selections | string replace -fr '(\S+)\s+install' "\$1" | string match -e (commandline -ct))
-        apt-cache --no-generate show $packages 2>/dev/null | sed -r '/^(Package|Description-?[a-zA-Z_]*):/!d;s/Package: (.*)/\1\t/g;s/Description-?[^:]*: (.*)/\1\x1a\n/g' | head -n 500 | string join "" | string replace --all --regex \x1a+ \n | uniq
-        return 0
+        # Do not not use `apt-cache` as it is sometimes inexplicably slow (by multiple orders of magnitude).
+        awk '
+BEGIN {
+  FS=": "
+}
+
+/^Package/ {
+  pkg=$2
+}
+
+/^Status/ {
+  installed=0
+  if ($2 ~ /(^|\s)installed/) {
+    installed=1
+  }
+}
+
+/^Description(-[a-zA-Z]+)?:/ {
+  desc=$2
+  if (installed == 1 && index(pkg, "'$search_term'") > 0) {
+    print pkg "\t" desc
+    installed=0 # Prevent multiple description translations from being printed
+  }
+}' </var/lib/dpkg/status
     end
 end

From 7260e1f828010f85a76a6cf6d9f3c2b65f688122 Mon Sep 17 00:00:00 2001
From: Fabian Boehm <FHomborg@gmail.com>
Date: Wed, 23 Aug 2023 19:15:05 +0200
Subject: [PATCH 082/200] sample_prompts/scales: Silence one last git call

Fixes #9975

(cherry picked from commit 5b1ff9459a4163fea275474f4cf92e273dc4f29e)
---
 share/tools/web_config/sample_prompts/scales.fish | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/share/tools/web_config/sample_prompts/scales.fish b/share/tools/web_config/sample_prompts/scales.fish
index a6508a6bf..d6708a87c 100644
--- a/share/tools/web_config/sample_prompts/scales.fish
+++ b/share/tools/web_config/sample_prompts/scales.fish
@@ -108,7 +108,7 @@ function fish_right_prompt
     #  B  |    |    |    | m  | r  | m  | u  |    |    |    |
     #  ?  |    |    |    | m  | r  | m  | u  |    |    | t  |
     #  _  |    |    | d  | m  | r  | m  | u  |    |    |    |
-    set -l porcelain_status (command git status --porcelain | string sub -l2)
+    set -l porcelain_status (command git status --porcelain 2>/dev/null | string sub -l2)
 
     set -l status_added 0
     if string match -qr '[ACDMT][ MT]|[ACMT]D' $porcelain_status

From 04b2e9629fb4ab7ae28bcc31cd220bfb3d7f505b Mon Sep 17 00:00:00 2001
From: Fabian Boehm <FHomborg@gmail.com>
Date: Fri, 25 Aug 2023 16:17:19 +0200
Subject: [PATCH 083/200] math: Fix docs on --scale

Fixes #9983

(cherry picked from commit e555f1b2355a059d115e7c505ae46bf15de281a6)
---
 doc_src/cmds/math.rst | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/doc_src/cmds/math.rst b/doc_src/cmds/math.rst
index 82c376d33..ed84b0e07 100644
--- a/doc_src/cmds/math.rst
+++ b/doc_src/cmds/math.rst
@@ -17,8 +17,9 @@ Description
 ``math`` performs mathematical calculations.
 It supports simple operations such as addition, subtraction, and so on, as well as functions like ``abs()``, ``sqrt()`` and ``ln()``.
 
-By default, the output is a floating-point number with trailing zeroes trimmed.
-To get a fixed representation, the ``--scale`` option can be used, including ``--scale=0`` for integer output.
+By default, the output shows up to 6 decimal places.
+To change the number of decimal places, use the ``--scale`` option, including ``--scale=0`` for integer output.
+Trailing zeroes will always be trimmed.
 
 Keep in mind that parameter expansion happens before expressions are evaluated.
 This can be very useful in order to perform calculations involving shell variables or the output of command substitutions, but it also means that parenthesis (``()``) and the asterisk (``*``) glob character have to be escaped or quoted.

From 651c1d2dc80e72d8868f17561389e82b39dfca63 Mon Sep 17 00:00:00 2001
From: Fabian Boehm <FHomborg@gmail.com>
Date: Fri, 25 Aug 2023 17:13:35 +0200
Subject: [PATCH 084/200] Css refresh (#9982)

This cleans up the CSS, reduces the number of different colors and special settings we use.

It increases contrast so we now pass WCAG AAA (according to chromium), and switches to css variables for colors to make dark mode simpler to implement.

(cherry picked from commit b48fa1f1a0cf021ea714ae9e9b6b70aedc22825e)
---
 .../python_docs_theme/static/pydoctheme.css   | 183 +++++++-----------
 doc_src/python_docs_theme/static/pygments.css |  53 +++--
 2 files changed, 101 insertions(+), 135 deletions(-)

diff --git a/doc_src/python_docs_theme/static/pydoctheme.css b/doc_src/python_docs_theme/static/pydoctheme.css
index 6eb6e2474..6d478f8a7 100644
--- a/doc_src/python_docs_theme/static/pydoctheme.css
+++ b/doc_src/python_docs_theme/static/pydoctheme.css
@@ -1,5 +1,18 @@
 :root {
-  color-scheme: light dark; /* both supported */
+    color-scheme: light dark; /* both supported */
+    --link-color: #0030B3;
+    --visited-link-color: #6363bb;
+    --hover-link-color: #00A5F4;
+    --text-color: #222;
+    --main-background: #EEEEFA;
+    --secondary-background: #ddddea;
+    --outer-background: linear-gradient(to bottom, #a7cfdf 0%,#23538a 100%);
+    --code-background: rgba(255,255,255, .2);
+    --code-border: #ac9;
+    --sidebar-border-color: #ccc;
+    --secondary-link-color: #444;
+    --highlight-background: #FFF;
+    --td-background: white;
 }
 
 html {
@@ -8,7 +21,10 @@ html {
 }
 
 body {
-    background: linear-gradient(to bottom, #a7cfdf 0%,#23538a 100%);
+    background: var(--outer-background);
+}
+
+html, body, input {
     /* Pick a font.
        sans-serif is the Browser default. This is great because the user could change it.
        Unfortunately the defaults are decades old and e.g. on Windows still use Arial in Firefox and Edge,
@@ -29,8 +45,7 @@ body {
 body {
   /* These stay, assuming some browsers pick different defaults */
   font-size: 100%;
-  background-color: #eeeefa;
-  color: #000;
+  background-color: var(--main-background);
   margin: 0;
   padding: 0;
 }
@@ -97,7 +112,7 @@ div.sphinxsidebar ul ul, div.sphinxsidebar ul.want-points {
 div.sphinxsidebar ul {
   margin: 10px;
   padding: 0;
-  color: #444444;
+  color: var(--secondary-link-color);
   margin: 10px;
   list-style: none;
 }
@@ -132,7 +147,7 @@ div.sphinxsidebar h3 {
 }
 
 div.sphinxsidebar h4 {
-  color: #444444;
+  color: var(--secondary-link-color);
   font-size: 1.3em;
   font-weight: normal;
   margin: 5px 0 0 0;
@@ -162,7 +177,7 @@ a:hover, div.footer a {
 }
 
 div.related a, div.sphinxsidebar a {
-  color: #444444;
+  color: var(--secondary-link-color);
 }
 
 div.warning {
@@ -192,10 +207,6 @@ div.footer {
   font-size: 75%;
 }
 
-th, dl.field-list > dt {
-  background-color: #ede;
-}
-
 table.docutils {
   border-collapse: collapse;
 }
@@ -212,9 +223,9 @@ th > :first-child, td > :first-child {
 /* End of SPHINX IMPORT */
 
 div#fmain {
-    color: #222;
+    color: var(--text-color);
     padding: 1em 2em;
-    background-color: #EEEEFA;
+    background-color: var(--main-background);
     border-radius: 14px;
     position: relative;
     margin: 1em auto 1em;
@@ -227,7 +238,8 @@ div#fmain {
 div.related {
     margin-bottom: 0;
     padding: 0.5em 0;
-    border-top: 1px solid #ccc;
+    border-top: 1px solid;
+    border-color: var(--sidebar-border-color);
     margin-top: 0;
 }
 
@@ -243,15 +255,10 @@ div.section {
     width: 100%;
 }
 
-div.related a:hover,
-div.footer a:hover,
-div.sphinxsidebar a:hover {
-    color: #0095C4;
-}
-
 div.related:first-child {
     border-top: 0;
-    border-bottom: 1px solid #ccc;
+    border-bottom: 1px solid;
+    border-color: var(--sidebar-border-color);
 }
 
 .inline-search {
@@ -265,7 +272,8 @@ form.inline-search input[type="submit"] {
 }
 
 div.sphinxsidebar {
-    border-right: 1px solid #ccc;
+    border-right: 1px solid;
+    border-color: var(--sidebar-border-color);
     border-radius: 0px;
     line-height: 1em;
     font-size: smaller;
@@ -325,7 +333,8 @@ ul.simple > li:not(:first-child) > p {
 
 form.inline-search input,
 div.sphinxsidebar input {
-    border: 1px solid #999999;
+    border: 1px solid;
+    border-color: var(--sidebar-border-color);
     font-size: smaller;
     border-radius: 3px;
 }
@@ -364,7 +373,8 @@ div.body hr {
 
 div.body pre, code {
     border-radius: 3px;
-    border: 1px solid #ac9;
+    border: 1px solid;
+    border-color: var(--code-border);
 }
 
 div.highlight {
@@ -399,28 +409,31 @@ div.body div.seealso {
     border: 1px solid #dddd66;
 }
 
-div.body a {
-    color: #0072aa;
+a {
+    color: var(--link-color);
 }
 
 div.body a:visited {
-    color: #6363bb;
+    color: var(--visited-link-color);
 }
 
+div.related a:hover,
+div.footer a:hover,
+div.sphinxsidebar a:hover,
 div.body a:hover {
-    color: #00B0E4;
+    color: var(--hover-link-color);
 }
 
 code {
     /* Make inline-code better visible */
-    background-color: rgba(20,20,80, .1);
+    background-color: var(--code-background);
     padding-left: 5px;
     padding-right: 5px;
     margin-left: 3px;
     margin-right: 3px;
 }
 
-tt, code, pre, dl > dt span ~ em, #synopsis p, #synopsis code, .command {
+tt, code, pre, dl > dt span ~ em, #synopsis p, #synopsis code, .command, button {
     /* Pick a monospace font.
        ui-monospace is the monospace version of system-ui - the system's monospace font.
        Unfortunately it's barely supported anywhere (at time of writing only Safari does!),
@@ -467,7 +480,8 @@ div.body tt.xref, div.body a tt, div.body code.xref, div.body a code {
 }
 
 table.docutils {
-    border: 1px solid #ddd;
+    border: 1px solid;
+    border-color: var(--sidebar-border-color);
     min-width: 20%;
     border-radius: 3px;
     margin-top: 1em;
@@ -478,7 +492,8 @@ table.docutils {
 }
 
 table.docutils td, table.docutils th {
-    border: 1px solid #ddd !important;
+    border: 1px solid;
+    border-color: var(--sidebar-border-color);
     border-radius: 3px;
 }
 
@@ -486,13 +501,13 @@ table p, table li {
     text-align: left !important;
 }
 
-table.docutils th {
-    background-color: #eee;
+th {
+    background-color: var(--secondary-background);
     padding: 0.3em 0.5em;
 }
 
 table.docutils td {
-    background-color: white;
+    background-color: var(--td-background);
     padding: 0.3em 0.5em;
 }
 
@@ -508,16 +523,8 @@ div.footer {
     margin-right: 10px;
 }
 
-.refcount {
-    color: #060;
-}
-
-.stableabi {
-    color: #229;
-}
-
 .highlight {
-    background: #FFF;
+    background: var(--highlight-background);
 }
 
 #synopsis p {
@@ -625,11 +632,10 @@ div.documentwrapper {
 .prompt { color: #8f7902; }
 
 kbd {
-  background-color: #f9f9f9;
-  border: 1px solid #aaa;
+  background-color: var(--td-background);
+  border: 1px solid;
+  border-color: var(--sidebar-border-color);
   border-radius: .2em;
-  box-shadow: 0.1em 0.1em 0.2em rgba(0,0,0,0.1);
-  color: #000;
   padding: 0.1em 0.3em;
 }
 
@@ -641,91 +647,38 @@ div.body .internal.reference:link {
     content: "$";
 }
 .footnote, .footnote-reference {
-    background-color: #ddddea;
+    background-color: var(--secondary-background);
     font-size: 90%;
 }
 
 @media (prefers-color-scheme: dark) {
-    body {
-        background: linear-gradient(to top, #1f1f3f 0%,#051f3a 100%);
+    :root {
+        --link-color: #5fb0fc;
+        --text-color: #DDD;
+        --main-background: #202028;
+        --secondary-background: #112;
+        --outer-background: linear-gradient(to top, #1f1f3f 0%,#051f3a 100%);
+        --code-background: rgba(20, 20, 25, .2);
+        --code-border: #536;
+        --sidebar-border-color: #666;
+        --secondary-link-color: #DDD;
+        --highlight-background: #000;
+        --td-background: #111;
     }
+
     div#fmain {
-        color: #DDD;
-        background-color: #202028;
         box-shadow: 0 0 5px 1px #000;
     }
 
-    div.body pre, code {
-        border: 1px solid #536;
-    }
-
-    .footnote, .footnote-reference {
-        background-color: #101020;
-    }
-
-    div.sphinxsidebar {
-        border-right: 1px solid #666;
-    }
-
-    div.related:first-child {
-        border-bottom: 1px solid #666;
-    }
-
-    div.related {
-        border-top: 1px solid #666;
-    }
-
-    div.sphinxsidebar a, div.footer {
-        color: #DDD;
-    }
-
-    div.sphinxsidebar h3 a, div.related a, div.sphinxsidebar h3, div.footer a {
-        color: #DDD;
-    }
-    .highlight {
-        background: #000;
-    }
     kbd {
-        background-color: #111;
-        border: 1px solid #444;
         box-shadow: 0.1em 0.1em 0.2em rgba(100,100,100,0.1);
         color: #FFF;
     }
-    table.docutils th {
-        background-color: #222;
-    }
 
     table.docutils td {
         background-color: #111;
     }
-    input {
-        background-color: #222;
-        color: #DDD;
-    }
-
-    dt:target, span.highlighted {
-        background-color: #404060;
-    }
-    table.docutils {
-        border: 1px solid #222;
-    }
-
-    table.docutils td, table.docutils th {
-        border: 1px solid #222 !important;
-    }
-    div.body a {
-        color: #2092fa;
-    }
 
     /* Color based on the Name.Function (.nf) class from pygments.css. */
     .command { color: #008fd7 }
-
-    /* The table background on fishfish Beta r1 */
-    th, dl.field-list > dt {
-        background-color: #121;
-    }
-
-    code {
-        background-color: rgba(200, 200, 255, .2);
-    }
 }
diff --git a/doc_src/python_docs_theme/static/pygments.css b/doc_src/python_docs_theme/static/pygments.css
index d657ce377..d33895f48 100644
--- a/doc_src/python_docs_theme/static/pygments.css
+++ b/doc_src/python_docs_theme/static/pygments.css
@@ -1,20 +1,19 @@
 .highlight .hll { background-color: #ffffcc }
 .highlight .err { color: #a40000; border: 1px solid #ef2929 } /* Error */
 .highlight .k { color: #204a87; font-weight: bold } /* Keyword */
-.highlight .o { color: #00a6b2; } /* Operator */
-.highlight .p { color: #00bfff; } /* Punctuation */
-.highlight .c { color: #777; font-style: italic; } /* Comment */
-.highlight .ch { color: #8f7902; font-style: italic } /* Comment.Hashbang */
-.highlight .cm { color: #8f7902; font-style: italic } /* Comment.Multiline */
-.highlight .cp { color: #8f7902; font-style: italic } /* Comment.Preproc */
-.highlight .cpf { color: #8f7902; font-style: italic } /* Comment.PreprocFile */
-.highlight .c1 { color: #8f7902; font-style: italic } /* Comment.Single */
-.highlight .cs { color: #8f7902; font-style: italic } /* Comment.Special */
+.highlight .o { color: #005F66; } /* Operator */
+.highlight .p { color: #000f8f; } /* Punctuation */
+.highlight .c { color: #575757; font-style: italic; } /* Comment */
+.highlight .ch { color: #645502; font-style: italic } /* Comment.Hashbang */
+.highlight .cm { color: #645502; font-style: italic } /* Comment.Multiline */
+.highlight .cp { color: #645502; font-style: italic } /* Comment.Preproc */
+.highlight .cpf { color: #645502; font-style: italic } /* Comment.PreprocFile */
+.highlight .c1 { color: #645502; font-style: italic } /* Comment.Single */
+.highlight .cs { color: #645502; font-style: italic } /* Comment.Special */
 .highlight .gd { color: #a40000 } /* Generic.Deleted */
 .highlight .gr { color: #ef2929 } /* Generic.Error */
 .highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */
 .highlight .gi { color: #00A000 } /* Generic.Inserted */
-.highlight .gp { color: #8f7902 } /* Generic.Prompt */
 .highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
 .highlight .gt { color: #a40000; font-weight: bold } /* Generic.Traceback */
 .highlight .kc { color: #204a87; font-weight: bold } /* Keyword.Constant */
@@ -24,15 +23,15 @@
 .highlight .kr { color: #204a87; font-weight: bold } /* Keyword.Reserved */
 .highlight .kt { color: #204a87; font-weight: bold } /* Keyword.Type */
 .highlight .m { color: #0000cf; font-weight: bold } /* Literal.Number */
-.highlight .s { color: #4e9a06 } /* Literal.String */
+.highlight .s { color: #2F5B06 } /* Literal.String */
 .highlight .na { color: #c4a000 } /* Name.Attribute */
 .highlight .nb { color: #204a87 } /* Name.Builtin */
-.highlight .no { color: #00bfff } /* Name.Constant */
+.highlight .no { color: #000f8f } /* Name.Constant */
 .highlight .nd { color: #5c35cc; font-weight: bold } /* Name.Decorator */
 .highlight .ni { color: #ce5c00 } /* Name.Entity */
 .highlight .ne { color: #cc0000; font-weight: bold } /* Name.Exception */
-.highlight .nf { color: #005fd7 } /* Name.Function */
-.highlight .nl { color: #f57900 } /* Name.Label */
+.highlight .nf { color: #004BCC; } /* Name.Function */
+.highlight .nl { color: #f57900; } /* Name.Label */
 .highlight .nt { color: #204a87; font-weight: bold } /* Name.Tag */
 .highlight .ow { color: #204a87; font-weight: bold } /* Operator.Word */
 .highlight .w { color: #f8f8f8; } /* Text.Whitespace */
@@ -46,13 +45,13 @@
 .highlight .sc { color: #4e9a06 } /* Literal.String.Char */
 .highlight .dl { color: #4e9a06 } /* Literal.String.Delimiter */
 .highlight .sd { color: #8f7902; font-style: italic } /* Literal.String.Doc */
-.highlight .s2 { color: #4daf08 } /* Literal.String.Double */
-.highlight .se { color: #00a6b2 } /* Literal.String.Escape */
+.highlight .s2 { color: #2E6506 } /* Literal.String.Double */
+.highlight .se { color: #800400 } /* Literal.String.Escape */
 .highlight .sh { color: #4e9a06 } /* Literal.String.Heredoc */
 .highlight .si { color: #4e9a06 } /* Literal.String.Interpol */
 .highlight .sx { color: #4e9a06 } /* Literal.String.Other */
 .highlight .sr { color: #4e9a06 } /* Literal.String.Regex */
-.highlight .s1 { color: #d0d00b } /* Literal.String.Single */
+.highlight .s1 { color: #605000 } /* Literal.String.Single */
 .highlight .ss { color: #4e9a06 } /* Literal.String.Symbol */
 .highlight .bp { color: #3465a4 } /* Name.Builtin.Pseudo */
 .highlight .il { color: #0000cf; font-weight: bold } /* Literal.Number.Integer.Long */
@@ -66,12 +65,26 @@
     :root {
         --contrast: #FFFFFF;
     }
-    .highlight .k { color: #507a97; font-weight: bold } /* Keyword */
-    .highlight .nf { color: #008fd7 } /* Name.Function */
-    .highlight .nb { color: #209a87 } /* Name.Builtin */
+    .highlight .no { color: #00bfff } /* Name.Constant */
+    .highlight .p { color: #00bfff; } /* Punctuation */
+    .highlight .k { color: #60A3BE; font-weight: bold } /* Keyword */
+    .highlight .nf { color: #00a0ff } /* Name.Function */
+    .highlight .nb { color: #A0AfF7 } /* Name.Builtin - we don't emit this, it's for bash scripts*/
+    .highlight .s { color: #4eFa06 } /* Literal.String */
+    .highlight .s1 { color: #a0a00b } /* Literal.String.Single */
     .highlight .s2 { color: #9ce781 } /* Literal.String.Double */
+    .highlight .c { color: #969696; font-style: italic; } /* Comment */
+    .highlight .ch { color: #b19602; font-style: italic } /* Comment.Hashbang */
+    .highlight .cm { color: #b19602; font-style: italic } /* Comment.Multiline */
+    .highlight .cp { color: #b19602; font-style: italic } /* Comment.Preproc */
+    .highlight .cpf { color: #b19602; font-style: italic } /* Comment.PreprocFile */
+    .highlight .c1 { color: #b19602; font-style: italic } /* Comment.Single */
+    .highlight .cs { color: #b19602; font-style: italic } /* Comment.Special */
+    .highlight .o { color: #00F6b2; } /* Operator */
+    .highlight .se { color: #00a6b2 } /* Literal.String.Escape */
 }
 .highlight .g { color: var(--contrast) } /* Generic */
+.highlight .gp { color: var(--contrast) } /* Generic.Prompt */
 .highlight .l { color: var(--contrast) } /* Literal */
 .highlight .n { color: var(--contrast) } /* Name */
 .highlight .x { color: var(--contrast) } /* Other */

From 7815cb363cc4b564d152f03e4c50c1cb496caad2 Mon Sep 17 00:00:00 2001
From: Fabian Boehm <FHomborg@gmail.com>
Date: Fri, 25 Aug 2023 19:34:24 +0200
Subject: [PATCH 085/200] parse_util: Only reject time in a pipeline without
 decorator

This allows e.g. `foo | command time`, while still rejecting `foo | time`.

(this should really be done in the ast itself, but tbh most of
parse_util kinda should)

Fixes #9985

(cherry picked from commit 482616f101cb3af25f36d8fcac7ca0bc9d78f7cb)
---
 src/parse_util.cpp     | 12 ++++++++++--
 tests/checks/time.fish | 14 ++++++++++++++
 2 files changed, 24 insertions(+), 2 deletions(-)

diff --git a/src/parse_util.cpp b/src/parse_util.cpp
index dc09d3071..ea55eca5f 100644
--- a/src/parse_util.cpp
+++ b/src/parse_util.cpp
@@ -1165,8 +1165,16 @@ static bool detect_errors_in_decorated_statement(const wcstring &buff_src,
 
         // Similarly for time (#8841).
         if (command == L"time") {
-            errored = append_syntax_error(parse_errors, source_start, source_length,
-                                          TIME_IN_PIPELINE_ERR_MSG);
+            // We only reject it if we have no decoration.
+            // `echo foo | command time something`
+            // is entirely fair and valid.
+            // Other current decorations like "exec"
+            // are already forbidden.
+            const auto &deco = dst.decoration();
+            if (deco == statement_decoration_t::none) {
+                errored = append_syntax_error(parse_errors, source_start, source_length,
+                                              TIME_IN_PIPELINE_ERR_MSG);
+            }
         }
     }
 
diff --git a/tests/checks/time.fish b/tests/checks/time.fish
index d42130739..f4fe070e1 100644
--- a/tests/checks/time.fish
+++ b/tests/checks/time.fish
@@ -48,3 +48,17 @@ $fish -c 'not time true&'
 #CHECKERR: not time true&
 #FIXME: This error marks the entire statement. Would be cool to mark just `time true&`.
 #CHECKERR: ^~~~~~~~~~~~~^
+
+$fish -c 'echo Is it time yet | time cat'
+#CHECKERR: fish: The 'time' command may only be at the beginning of a pipeline
+#CHECKERR: echo Is it time yet | time cat
+#CHECKERR:                       ^~~~~~~^
+
+begin
+    printf '%s\n' "#!/bin/sh" 'echo No this is Patrick' > time
+    chmod +x time
+    set -l PATH .
+    echo Hello is this time | command time
+    # CHECK: No this is Patrick
+end
+rm time

From 4d59d9cfb5fe97e422846a1050a785f1e78b23d8 Mon Sep 17 00:00:00 2001
From: Fabian Boehm <FHomborg@gmail.com>
Date: Sat, 26 Aug 2023 13:44:25 +0200
Subject: [PATCH 086/200] Also allow `command and` in a pipeline

Similar to `time`, except that one is more common as a command.

Note that this will also allow `builtin and`, which is somewhat
useless, but then it is also useless outside of a pipeline.

Addition to #9985

(cherry picked from commit b454b3bc40a2af3cf4a3034007c06a6d2a998f35)
---
 src/parse_util.cpp | 32 ++++++++++++++++----------------
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/src/parse_util.cpp b/src/parse_util.cpp
index ea55eca5f..943e3131b 100644
--- a/src/parse_util.cpp
+++ b/src/parse_util.cpp
@@ -1155,23 +1155,23 @@ static bool detect_errors_in_decorated_statement(const wcstring &buff_src,
     // beginning. We can't disallow them as commands entirely because we need to support 'and
     // --help', etc.
     if (pipe_pos == pipeline_position_t::subsequent) {
-        // check if our command is 'and' or 'or'. This is very clumsy; we don't catch e.g. quoted
-        // commands.
-        const wcstring &command = dst.command.source(buff_src, storage);
-        if (command == L"and" || command == L"or") {
-            errored = append_syntax_error(parse_errors, source_start, source_length,
-                                          INVALID_PIPELINE_CMD_ERR_MSG, command.c_str());
-        }
+        // We only reject it if we have no decoration.
+        // `echo foo | command time something`
+        // is entirely fair and valid.
+        // Other current decorations like "exec"
+        // are already forbidden.
+        const auto &deco = dst.decoration();
+        if (deco == statement_decoration_t::none) {
+            // check if our command is 'and' or 'or'. This is very clumsy; we don't catch e.g. quoted
+            // commands.
+            const wcstring &command = dst.command.source(buff_src, storage);
+            if (command == L"and" || command == L"or") {
+                errored = append_syntax_error(parse_errors, source_start, source_length,
+                                              INVALID_PIPELINE_CMD_ERR_MSG, command.c_str());
+            }
 
-        // Similarly for time (#8841).
-        if (command == L"time") {
-            // We only reject it if we have no decoration.
-            // `echo foo | command time something`
-            // is entirely fair and valid.
-            // Other current decorations like "exec"
-            // are already forbidden.
-            const auto &deco = dst.decoration();
-            if (deco == statement_decoration_t::none) {
+            // Similarly for time (#8841).
+            if (command == L"time") {
                 errored = append_syntax_error(parse_errors, source_start, source_length,
                                               TIME_IN_PIPELINE_ERR_MSG);
             }

From 65db0b2ec89094480558b6a0d2aa7309f7ca1d7c Mon Sep 17 00:00:00 2001
From: Fabian Boehm <FHomborg@gmail.com>
Date: Sat, 26 Aug 2023 09:40:53 +0200
Subject: [PATCH 087/200] fish_key_reader: Humanize key descriptions
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This used to print all codepoints outside of the ASCII range (i.e.
above 0x80) in \uXXXX or \UYYYYYYYY notation.

That's quite awkward, considering that this is about keys that are
being pressed, and many keyboards have actual symbols for these on
them - I have an "ö" key, so I would like to use `bind ö` and not
`bind \u00F6`. So we go by iswgraph.

On a slightly different note, `\e` was written as `\c[ (or \e)`. I do
not believe anyone really uses `\c[` (the `[` would need to
be escaped!), and it's confusing and unnecessary to even mention that.

(cherry picked from commit 55c425a0ddcc6ebbdf26d25ef38de2043fc6d47a)
---
 doc_src/cmds/fish_key_reader.rst | 2 +-
 src/fish_key_reader.cpp          | 7 ++++++-
 tests/pexpects/fkr.py            | 2 +-
 3 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/doc_src/cmds/fish_key_reader.rst b/doc_src/cmds/fish_key_reader.rst
index cfe967874..851ff3daa 100644
--- a/doc_src/cmds/fish_key_reader.rst
+++ b/doc_src/cmds/fish_key_reader.rst
@@ -56,7 +56,7 @@ Example
    > fish_key_reader --verbose
    Press a key:
    # press alt+enter
-              hex:   1B  char: \c[  (or \e)
+              hex:   1B  char: \e
    (  0.027 ms)  hex:    D  char: \cM  (or \r)
    bind \e\r 'do something'
 
diff --git a/src/fish_key_reader.cpp b/src/fish_key_reader.cpp
index b63664f76..1731003ec 100644
--- a/src/fish_key_reader.cpp
+++ b/src/fish_key_reader.cpp
@@ -135,7 +135,10 @@ static void ascii_printable_to_symbol(wchar_t *buf, int buf_len, wchar_t wc, boo
 static wchar_t *char_to_symbol(wchar_t wc, bool bind_friendly) {
     static wchar_t buf[64];
 
-    if (wc < L' ') {  // ASCII control character
+    if (wc == '\x1b') {
+        // Escape - this is *technically* also \c[
+        std::swprintf(buf, sizeof(buf) / sizeof(*buf), L"\\e");
+    } else if (wc < L' ') {  // ASCII control character
         ctrl_to_symbol(buf, sizeof(buf) / sizeof(*buf), wc, bind_friendly);
     } else if (wc == L' ') {  // the "space" character
         space_to_symbol(buf, sizeof(buf) / sizeof(*buf), wc, bind_friendly);
@@ -143,6 +146,8 @@ static wchar_t *char_to_symbol(wchar_t wc, bool bind_friendly) {
         del_to_symbol(buf, sizeof(buf) / sizeof(*buf), wc, bind_friendly);
     } else if (wc < 0x80) {  // ASCII characters that are not control characters
         ascii_printable_to_symbol(buf, sizeof(buf) / sizeof(*buf), wc, bind_friendly);
+    } else if (fish_iswgraph(wc)) {
+        std::swprintf(buf, sizeof(buf) / sizeof(*buf), L"%lc", wc);
     }
 // Conditional handling of BMP Unicode characters depends on the encoding. Assume width of wchar_t
 // corresponds to the encoding, i.e. WCHAR_T_BITS == 16 implies UTF-16 and WCHAR_T_BITS == 32
diff --git a/tests/pexpects/fkr.py b/tests/pexpects/fkr.py
index 9db0f1777..95ebfa3e8 100644
--- a/tests/pexpects/fkr.py
+++ b/tests/pexpects/fkr.py
@@ -31,7 +31,7 @@ expect_str("char: \\cG  (or \\a)\r\nbind \\a 'do something'\r\n")
 sleep(0.020)
 # send "\x1B\xE1\x88\xB4"
 send("\x1B\u1234")
-expect_str("char: \\u1234\r\nbind \\e\\u1234 'do something'\r\n")
+expect_str("char: ሴ\r\nbind \\eሴ 'do something'\r\n")
 
 # Is a NULL char echoed correctly?
 sleep(0.020)

From 80e5f6b2f839031f10a746108304c7968d90e670 Mon Sep 17 00:00:00 2001
From: Jason Nader <jason.nader@protonmail.com>
Date: Thu, 10 Aug 2023 06:20:51 +0900
Subject: [PATCH 088/200] scp completions: fix path escaping

(cherry picked from commit f6123d235c1317132e0a36246605adba46a908f0)
---
 share/completions/scp.fish | 28 ++++++++++++++++------------
 1 file changed, 16 insertions(+), 12 deletions(-)

diff --git a/share/completions/scp.fish b/share/completions/scp.fish
index 28c0d7572..8fe537218 100644
--- a/share/completions/scp.fish
+++ b/share/completions/scp.fish
@@ -37,26 +37,30 @@ end
 # scp specific completions
 #
 
-#
 # Inherit user/host completions from ssh
-#
 complete -c scp -d Remote -n "__fish_no_scp_remote_specified; and not string match -e : (commandline -ct)" -a "(complete -C'ssh ' | string replace -r '\t.*' ':')"
 
-#
 # Local path
-#
 complete -c scp -d "Local Path" -n "not string match @ -- (commandline -ct)"
 
-#
 # Remote path
-#
 # Get the list of remote files from the scp target.
-complete -c scp -d "Remote Path" -f -n "commandline -ct | string match -e ':'" -a "
-(__scp_remote_target):( \
-        command ssh (__scp2ssh_port_number) -o 'BatchMode yes' (__scp_remote_target) command\ ls\ -dp\ (__scp_remote_path_prefix | string unescape)\* 2>/dev/null |
-        string escape -n
-)
-"
+string match -rq 'OpenSSH_(?<major>\d+)\.*' -- (ssh -V 2>&1)
+if test "$major" -ge 9
+    complete -c scp -d "Remote Path" -f -n "commandline -ct | string match -e ':'" -a "
+    (__scp_remote_target):( \
+            command ssh (__scp2ssh_port_number) -o 'BatchMode yes' (__scp_remote_target) command\ ls\ -dp\ (__scp_remote_path_prefix)\* 2>/dev/null
+    )
+    "
+else
+    complete -c scp -d "Remote Path" -f -n "commandline -ct | string match -e ':'" -a "
+    (__scp_remote_target):( \
+            command ssh (__scp2ssh_port_number) -o 'BatchMode yes' (__scp_remote_target) command\ ls\ -dp\ (__scp_remote_path_prefix | string unescape)\* 2>/dev/null |
+            string escape -n
+    )
+    "
+end
+
 complete -c scp -s 3 -d "Copies between two remote hosts are transferred through the local host"
 complete -c scp -s B -d "Batch mode"
 complete -c scp -s D -x -d "Connect directly to a local SFTP server"

From 34c19bcee1e25fa75b8ae1ff397c57287a5c28c3 Mon Sep 17 00:00:00 2001
From: Yuntao Zhao <134149794+yuntaz0@users.noreply.github.com>
Date: Sat, 26 Aug 2023 06:05:52 -0700
Subject: [PATCH 089/200] Improve completion for rpm-ostree (#9910)

* Some temporary change until compose - commit

* First draft

* Fix an error that prints double completion

* Fix completion errors. Add rpm-ostree alias.

Fix cimpletion where it trigger by multiple commands.
Add update and remove, which are aliases for upgrade and uninstall.

* Remove -r when it is unnecessary

Some command need path completion for arguments no matter what,
which makes -r flag useless

* Remove -x for compose image
-x does not block the path anyway

* Add missing short otpion in compose image

Revert the last change to block -l completion

* Fix description

Fix multiple description.

(cherry picked from commit 9d0d16686e07a8c7051071d33a83757b1f58da87)
---
 share/completions/rpm-ostree.fish | 487 +++++++++++++++++++++++++-----
 1 file changed, 418 insertions(+), 69 deletions(-)

diff --git a/share/completions/rpm-ostree.fish b/share/completions/rpm-ostree.fish
index 4f9e1ae7f..68cab5300 100644
--- a/share/completions/rpm-ostree.fish
+++ b/share/completions/rpm-ostree.fish
@@ -1,79 +1,428 @@
-# Define subcommands for rpm-ostree
-set -l subcommands apply-live compose cancel cleanup db deploy initramfs initramfs-etc install kargs override refresh-md reload rebase reset rollback status uninstall upgrade usroverlay
+#
+# completion for rpm-ostree
+#
+
+# Subcommands for rpm-ostree
+set -l subcommands apply-live cancel cleanup compose db deploy initramfs initramfs-etc install kargs override rebase refresh-md reload remove reset rollback status uninstall update upgrade usroverlay
+
+# Options for rpm-ostree, most of them also apply to subcommands
+set -l options --version --quiet -q --help -h
+
+# subcommands that does not support --quiet
+set -l no_quiet apply-live container-encapsulate image usroverlay
+
+# subcommands that does not support --version
+set -l no_version apply-live container-encapsulate image
 
 # File completions also need to be disabled
 complete -c rpm-ostree -f
 
-# Define auto-completion options for rpm-ostree
-complete -c rpm-ostree -n "not __fish_seen_subcommand_from $subcommands" -a "$subcommands"
+# All the options
+# --help for all
+complete -c rpm-ostree -n "not __fish_seen_subcommand_from $options" -l help -xs h -d "Show help options"
 
-# deploy
-complete -c rpm-ostree -n '__fish_seen_subcommand_from deploy' -l unchanged-exit-77 -d 'Exit w/ code 77 if system already on specified commit'
-complete -c rpm-ostree -n '__fish_seen_subcommand_from deploy' -s r -l reboot -d 'Reboot after upgrade is prepared'
-complete -c rpm-ostree -n '__fish_seen_subcommand_from deploy' -l preview -d 'Download enough metadata to diff RPM w/out deploying'
-complete -c rpm-ostree -n '__fish_seen_subcommand_from deploy' -s C -l cache-only -d 'Perform operation w/out updating from remotes'
-complete -c rpm-ostree -n '__fish_seen_subcommand_from deploy' -l download-only -d 'Download targeted ostree/layered RPMs w/out deploying'
+# --quiet for all
+complete -c rpm-ostree -n "not __fish_seen_subcommand_from options $options $no_quiet" -l quiet -s q -d "Print minimal informational messages"
 
-# install
-complete -c rpm-ostree -n '__fish_seen_subcommand_from install' -l idempotent -d 'Don\'t error if package is already present'
-complete -c rpm-ostree -n '__fish_seen_subcommand_from install' -s r -l reboot -d 'Reboot after deployment is prepared'
-complete -c rpm-ostree -n '__fish_seen_subcommand_from install' -s n -l dry-run -d 'Exit after printing transaction (don\'t download and deploy)'
-complete -c rpm-ostree -n '__fish_seen_subcommand_from install' -l allow-inactive -d 'Allow packages already in base layer'
-complete -c rpm-ostree -n '__fish_seen_subcommand_from install' -s C -l cache-only -d 'Don\'t download latest packages'
-complete -c rpm-ostree -n '__fish_seen_subcommand_from install' -l download-only -d 'Download targeted layered RPMs w/out deploying'
-complete -c rpm-ostree -n '__fish_seen_subcommand_from install' -l apply-live -d 'Apply changes to booted deployment'
+# --version for all
+complete -c rpm-ostree -n "not __fish_seen_subcommand_from $options $no_version" -l version -d "Print version info and exit"
 
-# uninstall
-complete -c rpm-ostree -n '__fish_seen_subcommand_from uninstall' -s r -l reboot -d 'Reboot after deployment is prepared'
-complete -c rpm-ostree -n '__fish_seen_subcommand_from uninstall' -s n -l dry-run -d 'Exit after printing transaction (don\'t download and deploy)'
+# All the subcommands
+# There is not --version or --quiet for apply-live
+complete -c rpm-ostree -n "not __fish_seen_subcommand_from $subcommands --version --quiet -q" -a apply-live -d "Apply pending changes to booted deployment"
+complete -c rpm-ostree -n "not __fish_seen_subcommand_from $subcommands" -a cancel -d "Cancel an active transaction"
+complete -c rpm-ostree -n "not __fish_seen_subcommand_from $subcommands" -a cleanup -d "Clear cached/pending data"
+complete -c rpm-ostree -n "not __fish_seen_subcommand_from $subcommands" -a compose -d "Commands to compose a tree"
+complete -c rpm-ostree -n "not __fish_seen_subcommand_from $subcommands" -a db -d "Commands to query the RPM database"
+complete -c rpm-ostree -n "not __fish_seen_subcommand_from $subcommands" -a deploy -d "Deploy a specific commit"
+complete -c rpm-ostree -n "not __fish_seen_subcommand_from $subcommands" -a initramfs -d "Toggle local initramfs regeneration"
+complete -c rpm-ostree -n "not __fish_seen_subcommand_from $subcommands" -a initramfs-etc -d "Add files to the initramfs"
+complete -c rpm-ostree -n "not __fish_seen_subcommand_from $subcommands" -a install -d "Overlay additional packages"
+complete -c rpm-ostree -n "not __fish_seen_subcommand_from $subcommands" -a kargs -d "Query or modify kernel arguments"
+complete -c rpm-ostree -n "not __fish_seen_subcommand_from $subcommands" -a override -d "Manage base package overrides"
+complete -c rpm-ostree -n "not __fish_seen_subcommand_from $subcommands" -a rebase -d "Switch to a different tree"
+complete -c rpm-ostree -n "not __fish_seen_subcommand_from $subcommands" -a refresh-md -d "Generate rpm repo metadata"
+complete -c rpm-ostree -n "not __fish_seen_subcommand_from $subcommands" -a reload -d "Reload configuration"
+complete -c rpm-ostree -n "not __fish_seen_subcommand_from $subcommands" -a reset -d "Remove all mutations"
+complete -c rpm-ostree -n "not __fish_seen_subcommand_from $subcommands" -a rollback -d "Revert to previously booted tree"
+complete -c rpm-ostree -n "not __fish_seen_subcommand_from $subcommands" -a status -d "Get booted system version"
+complete -c rpm-ostree -n "not __fish_seen_subcommand_from $subcommands" -a uninstall -d "Remove overlayed additional packages"
+complete -c rpm-ostree -n "not __fish_seen_subcommand_from $subcommands" -a remove -d "Remove overlayed additional packages"
+complete -c rpm-ostree -n "not __fish_seen_subcommand_from $subcommands" -a upgrade -d "Perform system upgrade"
+complete -c rpm-ostree -n "not __fish_seen_subcommand_from $subcommands" -a update -d "Alias for upgrade"
+# 2023-07-21: Any flag between rpm-ostree and usroverlay can cause Segmentation fault. https://github.com/coreos/rpm-ostree/issues/4508
+complete -c rpm-ostree -n "not __fish_seen_subcommand_from $subcommands -" -a usroverlay -d "Apply transient overlayfs to /usr"
 
-# rebase
-complete -c rpm-ostree -n '__fish_seen_subcommand_from rebase' -l branch -d 'Pick a branch name'
-complete -c rpm-ostree -n '__fish_seen_subcommand_from rebase' -l remote -d 'Pick a remote name'
-complete -c rpm-ostree -n '__fish_seen_subcommand_from rebase' -s C -l cache-only -d 'Perform rebase w/out downloading latest'
-complete -c rpm-ostree -n '__fish_seen_subcommand_from rebase' -l download-only -d 'Download targeted ostree/layered RPMs w/out deploying'
-
-# rollback
-complete -c rpm-ostree -n '__fish_seen_subcommand_from rollback' -s r -l reboot -d 'Reboot after rollback is prepared'
-
-# upgrade
-complete -c rpm-ostree -n '__fish_seen_subcommand_from upgrade' -l allow-downgrade -d 'Permit deployment of older trees'
-complete -c rpm-ostree -n '__fish_seen_subcommand_from upgrade' -l preview -d 'Minimal download in order to do a package-level version diff'
-complete -c rpm-ostree -n '__fish_seen_subcommand_from upgrade' -l check -d 'Check if upgrade is available w/out downloading it'
-complete -c rpm-ostree -n '__fish_seen_subcommand_from upgrade' -s C -l cache-only -d 'Upgrade w/out updating to latest'
-complete -c rpm-ostree -n '__fish_seen_subcommand_from upgrade' -l download-only -d 'Download targeted ostree/layered RPMs w/out deploying'
-complete -c rpm-ostree -n '__fish_seen_subcommand_from upgrade' -s r -l reboot -d 'Reboot after upgrade is prepared'
-complete -c rpm-ostree -n '__fish_seen_subcommand_from upgrade' -l unchanged-exit-77 -d 'Exit w/ code 77 if system is up to date'
-
-# kargs
-complete -c rpm-ostree -n '__fish_seen_subcommand_from kargs' -l editor -d 'Use editor to modify kernel args'
-complete -c rpm-ostree -n '__fish_seen_subcommand_from kargs' -l append -d 'Append kernel arg'
-complete -c rpm-ostree -n '__fish_seen_subcommand_from kargs' -l append-if-missing -d 'Append kernel arg if not present'
-complete -c rpm-ostree -n '__fish_seen_subcommand_from kargs' -l delete -d 'Delete kernel arg'
-complete -c rpm-ostree -n '__fish_seen_subcommand_from kargs' -l delete-if-present -d 'Delete kernel arg if present'
-complete -c rpm-ostree -n '__fish_seen_subcommand_from kargs' -l replace -d 'Replace existing kernel arg'
-complete -c rpm-ostree -n '__fish_seen_subcommand_from kargs' -l unchanged-exit-77 -d 'Exit w/ code 77 if kernel args unchanged'
-complete -c rpm-ostree -n '__fish_seen_subcommand_from kargs' -l deploy-index -d 'Use specified index to modify kernel args'
-complete -c rpm-ostree -n '__fish_seen_subcommand_from kargs' -l import-proc-cmdline -d 'Use booted kernel args to modify kernel args'
-
-# cleanup
-complete -c rpm-ostree -n '__fish_seen_subcommand_from cleanup' -s p -l pending -d 'Remove pending deployment'
-complete -c rpm-ostree -n '__fish_seen_subcommand_from cleanup' -s r -l rollback -d 'Remove default rollback deployment'
-complete -c rpm-ostree -n '__fish_seen_subcommand_from cleanup' -s b -l base -d 'Free used space from interrupted ops'
-complete -c rpm-ostree -n '__fish_seen_subcommand_from cleanup' -s m -l repomd -d 'Clean up cached RPM repodata and partial downloads'
-
-# initramfs
-complete -c rpm-ostree -n '__fish_seen_subcommand_from initramfs' -l enable -d 'Enable client-side initramfs regen'
-complete -c rpm-ostree -n '__fish_seen_subcommand_from initramfs' -l arg -d 'Append custom args to initramfs program'
-complete -c rpm-ostree -n '__fish_seen_subcommand_from initramfs' -l disable -d 'Disable initramfs regen'
-
-# initramfs-etc
-complete -c rpm-ostree -n '__fish_seen_subcommand_from initramfs-etc' -l track -d 'Track specified file'
-complete -c rpm-ostree -n '__fish_seen_subcommand_from initramfs-etc' -l untrack -d 'Stop tracking files'
-complete -c rpm-ostree -n '__fish_seen_subcommand_from initramfs-etc' -l untrack-all -d 'Stop tracking all files'
-complete -c rpm-ostree -n '__fish_seen_subcommand_from initramfs-etc' -l force-sync -d 'Generate a new deployment w/out upgrading'
 
 # apply-live
-complete -c rpm-ostree -n '__fish_seen_subcommand_from apply-live' -l reset -d 'Reset filesystem tree to booted commit'
-complete -c rpm-ostree -n '__fish_seen_subcommand_from apply-live' -l target -d 'Target named OSTree commit'
-complete -c rpm-ostree -n '__fish_seen_subcommand_from apply-live' -l allow-replacement -d 'Enable live update/remove of extant packages'
+complete -c rpm-ostree -n "__fish_seen_subcommand_from apply-live" -l target -d "Target provided commit"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from apply-live" -l reset -d "Reset back to booted commit"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from apply-live" -l allow-replacement -d "Allow replacement of packages/files"
+
+
+# cancel
+complete -c rpm-ostree -n "__fish_seen_subcommand_from cancel" -l sysroot -r -d "=SYSROOT Use system root"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from cancel" -l peer -d "Force peer-to-peer connection"
+
+
+# cleanup
+complete -c rpm-ostree -n "__fish_seen_subcommand_from cleanup" -l os -d "=OSNAME Operate on provided OSNAME"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from cleanup" -l base -s b -d "Clear temporary files; will not change deployments"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from cleanup" -l pending -s p -d "Remove pending deployment"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from cleanup" -l rollback -s r -d "Remove rollback deployment"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from cleanup" -l repomd -s m -d "Delete cached rpm repo metadata"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from cleanup" -l sysroot -r -d "=SYSROOT Use system root"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from cleanup" -l peer -d "Force peer-to-peer connection"
+
+
+# compose
+# All compose subcommands
+# container-encapsulatedoes, image not have --quiet or --verison
+set -l compose_subcommands commit container-encapsulate extensions image install postprocess tree
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and not __fish_seen_subcommand_from $compose_subcommands" -a commit -d "Commit target path to an OSTree repo"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and not __fish_seen_subcommand_from $compose_subcommands --quiet -q --version" -a container-encapsulate -d "Create Chunked Container image from OSTree Commit"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and not __fish_seen_subcommand_from $compose_subcommands" -a extensions -d "Download Depsolved RPMs for Base OSTree"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and not __fish_seen_subcommand_from $compose_subcommands --quiet -q --version" -a image -d "Create reproducible Chunked Image from Treefile"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and not __fish_seen_subcommand_from $compose_subcommands" -a install -r -d "Install packages into a target path"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and not __fish_seen_subcommand_from $compose_subcommands" -a postprocess -d "Final postprocessing on an installation root"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and not __fish_seen_subcommand_from $compose_subcommands" -a tree -d "Process a treefile"
+
+# compose commit
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and __fish_seen_subcommand_from commit" -l unified-core -d "Use new unified core codepath"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and __fish_seen_subcommand_from commit" -l repo -s r -d "=REPO Path to OSTree repo"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and __fish_seen_subcommand_from commit" -l layer-repo -d "=REPO Path to OSTree repo for ostree-layers & ostree-override-layers"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and __fish_seen_subcommand_from commit" -l add-metadata-string -d "=KEY=VALUE Append given key=value to metadata"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and __fish_seen_subcommand_from commit" -l add-metadata-from-json -d "=JSON Append given JSON file to ostree commit"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and __fish_seen_subcommand_from commit" -l write-commitid-to -d "=FILE Write composed CommitID to file"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and __fish_seen_subcommand_from commit" -l write-composejson-to -d "=FIlE Write compose run info to JSON file"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and __fish_seen_subcommand_from commit" -l no-parent -d "Always commit without a parent"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and __fish_seen_subcommand_from commit" -l parent -d "=REV Commit with specific parent revision"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and __fish_seen_subcommand_from commit" -r -F # This seems to enable path completion
+
+# compose container-encapsulate
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and __fish_seen_subcommand_from container-encapsulate" -l repo -r -d "=REPO Path to repo"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and __fish_seen_subcommand_from container-encapsulate" -l label -xs l -d "Additional labels for container"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and __fish_seen_subcommand_from container-encapsulate" -l copymeta -d "Propagate OSTree key to container label"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and __fish_seen_subcommand_from container-encapsulate" -l copymeta-opt -d "Propagate opt OSTree key to container label"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and __fish_seen_subcommand_from container-encapsulate" -l cmd -d "Matches dockerfile CMD instruction"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and __fish_seen_subcommand_from container-encapsulate" -l max-layers -d "Maximum number of container image layers"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and __fish_seen_subcommand_from container-encapsulate" -l format-version -d "0 or 1; encapsulated container format version"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and __fish_seen_subcommand_from container-encapsulate" -l write-contentmeta-json -r -d "Output content metadata as JSON"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and __fish_seen_subcommand_from container-encapsulate" -l compare-with-build -d "Compare current OCI layers with another imgref"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and __fish_seen_subcommand_from container-encapsulate" -l previous-build-manifest -d "Preserve pack structure with prior metadata"
+
+# compose extensions
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and __fish_seen_subcommand_from extensions" -l unified-core -d "Use new unified core codepath"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and __fish_seen_subcommand_from extensions" -l repo -s r -d "=REPO Path to OSTree repo"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and __fish_seen_subcommand_from extensions" -l layer-repo -d "=REPO Repo for ostree-layers & ostree-override-layers"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and __fish_seen_subcommand_from extensions" -l output-dir -d "=PATH Path to extensions output dir"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and __fish_seen_subcommand_from extensions" -l base-rev -d "=REV Base OSTree revision"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and __fish_seen_subcommand_from extensions" -l cachedir -d "=CACHEDIR Cached state dir"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and __fish_seen_subcommand_from extensions" -l rootfs -d "=ROOTFS Path to existing rootfs"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and __fish_seen_subcommand_from extensions" -l touch-if-changed -d "=FILE Update mod time on file"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and __fish_seen_subcommand_from extensions" -r -F
+
+# compose image
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and __fish_seen_subcommand_from image" -l cachedir -d "Set cache directory for packages and data"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and __fish_seen_subcommand_from image" -l authfile -d "Container authentication file"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and __fish_seen_subcommand_from image" -l layer-repo -d "Specify repository for ostree layers and ostree-override-layers"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and __fish_seen_subcommand_from image" -l initialize -s i -d "Skip previous image query for first build"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and __fish_seen_subcommand_from image" -l format -d "Choose format (ociarchive oci registry)"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and __fish_seen_subcommand_from image" -l force-nocache -d "Force a build"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and __fish_seen_subcommand_from image" -l offline -d "Operate on cached data, no network repo access"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and __fish_seen_subcommand_from image" -l lockfile -d "Specify JSON-formatted lockfile"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and __fish_seen_subcommand_from image" -l label -xs l -d "Add labels (KEY=VALUE) to the container image"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and __fish_seen_subcommand_from image" -l touch-if-changed -d "Update file timestamp on changes"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and __fish_seen_subcommand_from image" -l copy-retry-times -d "Set number of copy retries to remote destination"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and __fish_seen_subcommand_from image" -r -F
+
+# compose install
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and __fish_seen_subcommand_from install" -l unified-core -d "Use new unified core codepath"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and __fish_seen_subcommand_from install" -l repo -s r -d "=REPO Path to OSTree repo"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and __fish_seen_subcommand_from install" -l layer-repo -d "=REPO Repo for ostree-layers & ostree-override-layers"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and __fish_seen_subcommand_from install" -l force-nocache -d "Always create new OSTree commit"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and __fish_seen_subcommand_from install" -l cache-only -d "Assume cache present, no updates"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and __fish_seen_subcommand_from install" -l cachedir -d "=CACHEDIR Cached state dir"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and __fish_seen_subcommand_from install" -l download-only -d "Dry-run but download & import RPMs"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and __fish_seen_subcommand_from install" -l download-only-rpms -d "Dry-run but download RPMs; need --cachedir"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and __fish_seen_subcommand_from install" -l proxy -d "=PROXY HTTP proxy"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and __fish_seen_subcommand_from install" -l dry-run -d "Print transaction and exit"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and __fish_seen_subcommand_from install" -l print-only -d "Expand includes and print treefile"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and __fish_seen_subcommand_from install" -l touch-if-changed -d "=FILE Update FILE's mod time if new commit"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and __fish_seen_subcommand_from install" -l previous-commit -d "=COMMIT for change detection"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and __fish_seen_subcommand_from install" -l previous-inputhash -d "=DIGEST Use input hash for change detect"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and __fish_seen_subcommand_from install" -l previous-version -d "=VERSION for auto version numbering"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and __fish_seen_subcommand_from install" -l workdir -d "=WORKDIR Working directory"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and __fish_seen_subcommand_from install" -l ex-write-lockfile-to -d "=FILE Write lockfile to FILE"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and __fish_seen_subcommand_from install" -l ex-lockfile -d "=FILE Read lockfile from FILE"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and __fish_seen_subcommand_from install" -l ex-lockfile-strict -d "Only allow installing locked packages with --ex-lockfile"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and __fish_seen_subcommand_from install" -r -F
+
+# compose postprocess
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and __fish_seen_subcommand_from postprocess" -l unified-core -d "Use new unified core codepath"
+
+# compose tree
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and __fish_seen_subcommand_from tree" -l unified-core -d "Use new unified core codepath"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and __fish_seen_subcommand_from tree" -l repo -s r -d "=REPO Path to OSTree repos"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and __fish_seen_subcommand_from tree" -l layer-repo -d "=REPO Repo for ostree-layers & ostree-override-layers"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and __fish_seen_subcommand_from tree" -l force-nocache -d "Always create new OSTree commit"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and __fish_seen_subcommand_from tree" -l cache-only -d "Assume cache present, no updates"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and __fish_seen_subcommand_from tree" -l cachedir -d "=CACHEDIR Specify cached state dir"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and __fish_seen_subcommand_from tree" -l download-only -d "Dry-run but download & import RPMs"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and __fish_seen_subcommand_from tree" -l download-only-rpms -d "Dry-run but download RPMs; need --cachedir"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and __fish_seen_subcommand_from tree" -l proxy -d "=PROXY HTTP proxy"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and __fish_seen_subcommand_from tree" -l dry-run -d "Print transaction and exit"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and __fish_seen_subcommand_from tree" -l print-only -d "Expand includes and print treefile"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and __fish_seen_subcommand_from tree" -l touch-if-changed -d "=FILE Update FILE's mod time if new commit"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and __fish_seen_subcommand_from tree" -l previous-commit -d "=COMMIT for change detection"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and __fish_seen_subcommand_from tree" -l previous-inputhash -d "=DIGEST Use input hash for change detect"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and __fish_seen_subcommand_from tree" -l previous-version -d "=VERSION for auto version numbering"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and __fish_seen_subcommand_from tree" -l workdir -d "=WORKDIR Working directory"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and __fish_seen_subcommand_from tree" -l ex-write-lockfile-to -d "=FILE Write lockfile to FILE"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and __fish_seen_subcommand_from tree" -l ex-lockfile -d "=FILE Read lockfile from FILE"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and __fish_seen_subcommand_from tree" -l ex-lockfile-strict -d "Only allow installing locked packages with --ex-lockfile"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and __fish_seen_subcommand_from tree" -l add-metadata-string -d "=KEY=VALUE Append key=value to metadata"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and __fish_seen_subcommand_from tree" -l add-metadata-from-json -d "=JSON Append JSON to OSTree commit"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and __fish_seen_subcommand_from tree" -l write-commitid-to -d "=FILE Write commitid to FILE, not ref"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and __fish_seen_subcommand_from tree" -l write-composejson-to -d "=FILE Write compose run info json to FILE"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and __fish_seen_subcommand_from tree" -l no-parent -d "Always Commit without a parent"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and __fish_seen_subcommand_from tree" -l parent -d "=REV Commit with specific parent revision"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from compose; and __fish_seen_subcommand_from tree" -r -F
+
+
+# db
+set -l db_subcommands diff list version
+complete -c rpm-ostree -n "__fish_seen_subcommand_from db; and not __fish_seen_subcommand_from $db_subcommands" -a diff -d "Show package changes between two commits"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from db; and not __fish_seen_subcommand_from $db_subcommands" -a list -d "List packages within commits"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from db; and not __fish_seen_subcommand_from $db_subcommands" -a version -d "Show rpmdb version of packages within the commits"
+
+# db diff
+complete -c rpm-ostree -n "__fish_seen_subcommand_from db; and __fish_seen_subcommand_from diff" -l repo -s r -r -d "=REPO Path to OSTree repo"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from db; and __fish_seen_subcommand_from diff" -l format -d "=FORMAT Choose output format (block diff json)"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from db; and __fish_seen_subcommand_from diff" -l changelogs -s c -d "Include RPM changelogs"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from db; and __fish_seen_subcommand_from diff" -l sysroot -r -d "=SYSROOT Use system root"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from db; and __fish_seen_subcommand_from diff" -l base -d "Diff against deployments' base"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from db; and __fish_seen_subcommand_from diff" -l advisories -s a -d "Include new advisories"
+
+# db list
+complete -c rpm-ostree -n "__fish_seen_subcommand_from db; and __fish_seen_subcommand_from list" -l repo -s r -r -d "=PATH Path to OSTree repo"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from db; and __fish_seen_subcommand_from list" -l advisories -s a -d "Include new advisories"
+
+# db version
+complete -c rpm-ostree -n "__fish_seen_subcommand_from db; and __fish_seen_subcommand_from version" -l repo -s r -r -d "=REPO Path to OSTree repo"
+
+
+# deploy
+complete -c rpm-ostree -n "__fish_seen_subcommand_from deploy" -l os -d "=OSNAME Operate on provided OSNAME"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from deploy" -l reboot -s r -d "Reboot after operation complete"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from deploy" -l preview -d "Preview package differences"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from deploy" -l cache-only -s C -d "No latest ostree and RPM download"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from deploy" -l download-only -d "Download latest ostree and RPM data, don't deploy"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from deploy" -l skip-branch-check -d "Don't check if commit belongs on the same branch"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from deploy" -l disallow-downgrade -d "Forbid deployment of older trees"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from deploy" -l unchanged-exit-77 -d "If no new deployment made, exit 77"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from deploy" -l register-driver -d "=DRIVERNAME Register agent as driver for updates"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from deploy" -l bypass-driver -d "Force deploy even if updates driver is registered"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from deploy" -l sysroot -r -d "=SYSROOT Use system root"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from deploy" -l peer -d "Force peer-to-peer connection"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from deploy" -l install -d "=PKG Overlay additional package"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from deploy" -l uninstall -d "=PKG Remove overlayed additional package"
+
+
+# initramfs
+complete -c rpm-ostree -n "__fish_seen_subcommand_from initramfs" -l os -d "=OSNAME Operate on provided OSNAME"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from initramfs" -l enable -d "Enable regenerating initramfs locally using dracut"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from initramfs" -l arg -d "=ARG Append ARG to the dracut arguments"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from initramfs" -l disable -d "Disable regenerating initramfs locally"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from initramfs" -l reboot -s r -d "Reboot after operation complete"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from initramfs" -l sysroot -r -d "=SYSROOT Use system root"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from initramfs" -l peer -d "Force peer-to-peer connection"
+
+
+# initramfs-etc
+complete -c rpm-ostree -n "__fish_seen_subcommand_from initramfs-etc" -l os -d "=OSNAME Operate on provided OSNAME"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from initramfs-etc" -l force-sync -d "Deploy a new tree with the latest tracked /etc files"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from initramfs-etc" -l track -r -d "=FILE Track root /etc file"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from initramfs-etc" -l untrack -r -d "=FILE Untrack root /etc file"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from initramfs-etc" -l untrack-all -d "Untrack all root /etc files"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from initramfs-etc" -l reboot -s r -d "Reboot after operation complete"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from initramfs-etc" -l unchanged-exit-77 -d "Exit with 77 if no new deployment made"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from initramfs-etc" -l sysroot -r -d "=SYSROOT Use system root"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from initramfs-etc" -l peer -d "Force peer-to-peer connection"
+
+
+# install, there is also compose install
+complete -c rpm-ostree -n "__fish_seen_subcommand_from install; and not __fish_seen_subcommand_from compose" -l uninstall -d "=PKG Remove overlayed additional package"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from install; and not __fish_seen_subcommand_from compose" -l cache-only -s C -d "Skip downloading latest ostree/RPM data"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from install; and not __fish_seen_subcommand_from compose" -l download-only -d "Download latest ostree & RPM data, skip deploy"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from install; and not __fish_seen_subcommand_from compose" -l apply-live -s A -d "Apply changes to pending & live filesystem"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from install; and not __fish_seen_subcommand_from compose" -l force-replacefiles -d "Allow package to replace files from others' pkgs"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from install; and not __fish_seen_subcommand_from compose" -l os -d "=OSNAME Operate on provided OSNAME"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from install; and not __fish_seen_subcommand_from compose" -l reboot -s r -d "Initiate a reboot post-operation"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from install; and not __fish_seen_subcommand_from compose" -l dry-run -s n -d "Exit after printing the transaction"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from install; and not __fish_seen_subcommand_from compose" -l assumeyes -s y -d "Auto-confirm non-security prompts"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from install; and not __fish_seen_subcommand_from compose" -l allow-inactive -d "Allow inactive package requests"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from install; and not __fish_seen_subcommand_from compose" -l idempotent -d "No action if pkg already (un)installed"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from install; and not __fish_seen_subcommand_from compose" -l unchanged-exit-77 -d "If no overlays were changed, exit 77"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from install; and not __fish_seen_subcommand_from compose" -l enablerepo -d "Enable repo based on its ID"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from install; and not __fish_seen_subcommand_from compose" -l disablerepo -d "Only disabling all (*) repo is supported"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from install; and not __fish_seen_subcommand_from compose" -l releasever -d "Set the releasever"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from install; and not __fish_seen_subcommand_from compose" -l sysroot -r -d "=SYSROOT Use system root"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from install; and not __fish_seen_subcommand_from compose" -l peer -d "Force peer-to-peer connection"
+
+
+# kargs
+complete -c rpm-ostree -n "__fish_seen_subcommand_from kargs" -l os -d "=OSNAME Operation on provided OSNAME"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from kargs" -l deploy-index -d "=INDEX Modify kernel args of a deployment by index"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from kargs" -l reboot -d "Initiate a reboot after operation"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from kargs" -l append -d "=KEY=VALUE Append kernel argument"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from kargs" -l replace -d "=KEY=VALUE=NEWVALUE Replace kernel argument"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from kargs" -l delete -d "=KEY=VALUE Delete kernel argument pair"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from kargs" -l append-if-missing -d "=KEY=VALUE Append kernel arg if missing"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from kargs" -l delete-if-present -d "=KEY=VALUE Delete kernel arg if present"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from kargs" -l unchanged-exit-77 -d "Exit 77 if no kernel args changed"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from kargs" -l import-proc-cmdline -d "Modify args from the booted deployment"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from kargs" -l editor -d "Use editor to modify kernel arguments"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from kargs" -l sysroot -r -d "=SYSROOT Use system root"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from kargs" -l peer -d "Force peer-to-peer connection"
+
+
+# override
+set -l override_subcommands remove replace reset
+complete -c rpm-ostree -n "__fish_seen_subcommand_from override; and not __fish_seen_subcommand_from $override_subcommands" -a remove -d "Remove packages from the base layer"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from override; and not __fish_seen_subcommand_from $override_subcommands" -a replace -d "Replace packages in the base layer"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from override; and not __fish_seen_subcommand_from $override_subcommands" -a reset -d "Reset active package overrides"
+
+# override remove
+complete -c rpm-ostree -n "__fish_seen_subcommand_from override; and __fish_seen_subcommand_from remove" -l replace -d "=RPM Replace a package"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from override; and __fish_seen_subcommand_from remove" -l os -d "=OSNAME Operate on provided OSNAME"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from override; and __fish_seen_subcommand_from remove" -l reboot -s r -d "Initiate a reboot after operation"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from override; and __fish_seen_subcommand_from remove" -l dry-run -s n -d "Exit after printing transaction"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from override; and __fish_seen_subcommand_from remove" -l cache-only -s C -d "Only operate on cached data"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from override; and __fish_seen_subcommand_from remove" -l sysroot -r -d "=SYSROOT Use system root"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from override; and __fish_seen_subcommand_from remove" -l peer -d "Force peer-to-peer connection"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from override; and __fish_seen_subcommand_from remove" -l install -d "=PKG Overlay additional package"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from override; and __fish_seen_subcommand_from remove" -l uninstall -d "=PKG Remove overlayed package"
+
+# override replace
+complete -c rpm-ostree -n "__fish_seen_subcommand_from override; and __fish_seen_subcommand_from replace" -l remove -d "=PKG Remove a package"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from override; and __fish_seen_subcommand_from replace" -l os -d "=OSNAME Operate on provided OSNAME"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from override; and __fish_seen_subcommand_from replace" -l reboot -d "Initiate a reboot after operation"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from override; and __fish_seen_subcommand_from replace" -l dry-run -s n -d "Exit after printing transaction"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from override; and __fish_seen_subcommand_from replace" -l cache-only -s C -d "Only operate on cached data"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from override; and __fish_seen_subcommand_from replace" -l sysroot -r -d "=SYSROOT Use system root"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from override; and __fish_seen_subcommand_from replace" -l peer -d "Force peer-to-peer connection"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from override; and __fish_seen_subcommand_from replace" -l install -d "=PKG Overlay additional package"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from override; and __fish_seen_subcommand_from replace" -l uninstall -d "=PKG Remove overlayed package"
+
+# override reset
+complete -c rpm-ostree -n "__fish_seen_subcommand_from override; and __fish_seen_subcommand_from reset" -l all -s a -d "Reset all active overrides"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from override; and __fish_seen_subcommand_from reset" -l os -d "=OSNAME Operate on provided OSNAME"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from override; and __fish_seen_subcommand_from reset" -l reboot -s r -d "Initiate a reboot after operation"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from override; and __fish_seen_subcommand_from reset" -l dry-run -s n -d "Exit after printing transaction"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from override; and __fish_seen_subcommand_from reset" -l cache-only -s C -d "Only operate on cached data"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from override; and __fish_seen_subcommand_from reset" -l sysroot -r -d "=SYSROOT Use system root "
+complete -c rpm-ostree -n "__fish_seen_subcommand_from override; and __fish_seen_subcommand_from reset" -l peer -d "Force peer-to-peer connection"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from override; and __fish_seen_subcommand_from reset" -l install -d "=PKG Overlay additional package"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from override; and __fish_seen_subcommand_from reset" -l uninstall -d "=PKG Remove overlayed package"
+
+
+# rebase
+complete -c rpm-ostree -n "__fish_seen_subcommand_from rebase" -l os -d "=OSNAME Operate on provided OSNAME"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from rebase" -l branch -s b -x -d "=BRANCH Rebase to branch BRANCH"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from rebase" -l remote -s m -x -d "=REMOTE Rebase to current branch name using REMOTE"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from rebase" -l reboot -s r -d "Initiate a reboot after operation"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from rebase" -l skip-purge -d "Keep previous refspec after rebase"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from rebase" -l cache-only -s C -d "Don't download latest ostree/RPM data"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from rebase" -l download-only -d "Download ostree & RPM data, don't deploy"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from rebase" -l custom-origin-description -d "Human-readable description of custom origin"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from rebase" -l custom-origin-url -d "Machine-readable description of custom origin"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from rebase" -l experimental -d "Enable experimental features"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from rebase" -l disallow-downgrade -d "Forbid older trees deployment"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from rebase" -l bypass-driver -d "Force rebase despite updates driver is registered"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from rebase" -l sysroot -r -d "=SYSROOT Use system root"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from rebase" -l peer -d "Force peer-to-peer connection"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from rebase" -l install -d "=PKG Overlay additional package"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from rebase" -l uninstall -d "=PKG Remove overlayed package"
+
+
+# refresh-md
+complete -c rpm-ostree -n "__fish_seen_subcommand_from refresh-md" -l os -d "=OSNAME Operate on provided OSNAME"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from refresh-md" -l force -d "Expire current cache"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from refresh-md" -l sysroot -r -d "=SYSROOT Use system root"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from refresh-md" -l peer -d "Force peer-to-peer connection"
+
+
+# reload
+complete -c rpm-ostree -n "__fish_seen_subcommand_from reload" -l sysroot -r -d "=SYSROOT Use system root"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from refresh-md" -l peer -d "Force peer-to-peer connection"
+
+
+# reset, there is also override reset
+complete -c rpm-ostree -n "__fish_seen_subcommand_from reset; and not __fish_seen_subcommand_from override" -l os -d "=OSNAME Operate on provided OSNAME"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from reset; and not __fish_seen_subcommand_from override" -l reboot -s r -d "Reboot after transaction"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from reset; and not __fish_seen_subcommand_from override" -l overlays -s l -d "Remove all overlayed packages"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from reset; and not __fish_seen_subcommand_from override" -l overrides -s o -d "Remove all overrides"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from reset; and not __fish_seen_subcommand_from override" -l initramfs -s i -d "Stop regenerating initramfs"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from reset; and not __fish_seen_subcommand_from override" -l sysroot -r -d "=SYSROOT Use system root"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from reset; and not __fish_seen_subcommand_from override" -l peer -d "Force peer-to-peer connection"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from reset; and not __fish_seen_subcommand_from override" -l install -d "=PKG Overlay additional package"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from reset; and not __fish_seen_subcommand_from override" -l uninstall -d "=PKG Remove overlayed package"
+
+
+# rollback
+complete -c rpm-ostree -n "__fish_seen_subcommand_from rollback" -l reboot -s r -d "Reboot after transaction"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from rollback" -l sysroot -r -d "=SYSROOT Use system root"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from rollback" -l peer -d "Force peer-to-peer connection"
+
+# status
+complete -c rpm-ostree -n "__fish_seen_subcommand_from status" -l verbose -s v -d "Print additional fields"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from status" -l advisories -s a -d "Expand advisories listing"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from status" -l json -d "Output JSON"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from status" -l jsonpath -s J -d "=EXPRESSION Filter JSONPath expression"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from status" -l booted -s b -d "Only print booted deployment"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from status" -l pending-exit-77 -d "If pending deployment available, exit 77"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from status" -l sysroot -r -d "=SYSROOT Use system root"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from status" -l peer -d "Force peer-to-peer connection"
+
+
+
+# uninstall and remove, there is also override remove
+complete -c rpm-ostree -n "__fish_seen_subcommand_from uninstall remove; and not __fish_seen_subcommand_from override" -l install -d "=PKG Overlay additional package"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from uninstall remove; and not __fish_seen_subcommand_from override" -l all -d "Remove all overlayed packages"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from uninstall remove; and not __fish_seen_subcommand_from override" -l os -d "=OSNAME Operate on provided OSNAME"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from uninstall remove; and not __fish_seen_subcommand_from override" -l reboot -s r -d "Reboot after operation"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from uninstall remove; and not __fish_seen_subcommand_from override" -l dry-run -s n -d "Print transaction, don't execute"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from uninstall remove; and not __fish_seen_subcommand_from override" -l assumeyes -s y -d "Auto-confirm non-security prompts"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from uninstall remove; and not __fish_seen_subcommand_from override" -l allow-inactive -d "Allow inactive package requests"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from uninstall remove; and not __fish_seen_subcommand_from override" -l idempotent -d "Skip if pkg already (un)installed"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from uninstall remove; and not __fish_seen_subcommand_from override" -l unchanged-exit-77 -d "Exit 77 if no overlays changed"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from uninstall remove; and not __fish_seen_subcommand_from override" -l enablerepo -d "Enable repo by id"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from uninstall remove; and not __fish_seen_subcommand_from override" -l disablerepo -d "Disable all (*) repositories"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from uninstall remove; and not __fish_seen_subcommand_from override" -l releasever -d "Set the release version"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from uninstall remove; and not __fish_seen_subcommand_from override" -l sysroot -r -d "=SYSROOT Use system root"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from uninstall remove; and not __fish_seen_subcommand_from override" -l peer -d "Force peer-to-peer connection"
+
+
+# upgrade
+complete -c rpm-ostree -n "__fish_seen_subcommand_from update upgrade" -l os -d "=OSNAME Operate on provided OSNAME"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from update upgrade" -l reboot -s r -d "Reboot after operation"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from update upgrade" -l allow-downgrade -d "Allow older trees deployment"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from update upgrade" -l preview -d "Preview pkg differences"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from update upgrade" -l check -d "Check upgrade availability"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from update upgrade" -l cache-only -s C -d "Don't download OSTree & RPM data"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from update upgrade" -l download-only -d "Download OSTree & RPM data, don't deploy"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from update upgrade" -l unchanged-exit-77 -d "Exit 77 if no deployment"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from update upgrade" -l bypass-driver -d "Force upgrade even if updates driver is registered"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from update upgrade" -l sysroot -r -d "=SYSROOT Use system root"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from update upgrade" -l peer -d "Force peer-to-peer connection"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from update upgrade" -l install -d "=PKG Overlay additional package"
+complete -c rpm-ostree -n "__fish_seen_subcommand_from update upgrade" -l uninstall -d "=PKG Remove overlayed package"
+
+
+# usroverlay
+# Usage: rpm-ostree usroverlay
+#
+# Options:
+#   -h, --help     Print help (see more with '--help')
+#   -V, --version  Print version

From f82f92df1346991a38698edc13481b6a0403f7c6 Mon Sep 17 00:00:00 2001
From: ghostflyby <ghostflyby@outlook.com>
Date: Thu, 31 Aug 2023 22:35:14 +0800
Subject: [PATCH 090/200] completion for macOS `java_home`

(cherry picked from commit 33ec25da8a88b12eaaf38c1850b6fe48ecc5ec7c)
---
 share/completions/java_home.fish | 45 ++++++++++++++++++++++++++++++++
 1 file changed, 45 insertions(+)
 create mode 100644 share/completions/java_home.fish

diff --git a/share/completions/java_home.fish b/share/completions/java_home.fish
new file mode 100644
index 000000000..102dffff8
--- /dev/null
+++ b/share/completions/java_home.fish
@@ -0,0 +1,45 @@
+
+function __fish_complete_macos_java_version
+    set -l json (/usr/libexec/java_home -X|plutil -convert json -o - -)
+    osascript -l JavaScript -s o -e "JSON.parse('$json').forEach(e => console.log(`\${e.JVMVersion}\t\${e.JVMArch} \${e.JVMName} by--exec \${e.JVMVendor}`))"
+end
+
+function __fish_complete_macos_java_home_exec
+    # seperate the buffer into two parts
+    # where the first used to get the JAVA_HOME
+    # and the second is the subcommand to complete
+    set -l cmds (string replace -a -r ' *java_home *' ''  (commandline) )
+    set -l cmds (string replace -r ' *--exec *' \n -- "$cmds")
+
+    # parse the java_home argv to get $JAVA_HOME/bin
+    argparse v/version= a/arch= -- "$cmds[1]"
+    set -l get_java_home /usr/libexec/java_home
+    if test -n "$_flag_v"
+        set get_java_home "$get_java_home -v $_flag_v"
+    end
+    if test -n "$_flag_a"
+        set get_java_home "$get_java_home -a $_flag_a"
+    end
+    set -l java_bin_dir (eval $get_java_home)"/bin"
+
+    # if such $binary in $JAVA_HOME/bin
+    # complete the subcommand
+    # else
+    # complete using $binary as prefix
+    set -l binary (string match -r '^.*?(?= )' $cmds[2])
+    if test -f "$java_bin_dir/$binary"
+        complete -C $cmds[2]
+    else
+        command ls $java_bin_dir | string match -r ^"$binary.*"
+    end
+end
+
+complete -ec java_home
+complete -xc java_home -n "__fish_not_contain_opt -s h exec " -l exec
+complete -xc java_home -n "__fish_contains_opt exec " -a "(__fish_complete_macos_java_home_exec)"
+complete -xc java_home -n "__fish_not_contain_opt -s h exec " -s v -l version -a '(__fish_complete_macos_java_version)' -d 'Filter versions (as if JAVA_VERSION had been set in the environment).'
+complete -xc java_home -n "__fish_not_contain_opt -s h exec " -s a -l arch -a "arm64 x86_64" -d 'Filter architecture (as if JAVA_ARCH had been set in the environment).'
+complete -xc java_home -n "__fish_not_contain_opt -s h exec " -s h -l help -d 'Usage information.'
+complete -fc java_home -n "__fish_not_contain_opt -s h exec " -s F -l failfast -d 'Fail when filters return no JVMs, do not continue with default.'
+complete -fc java_home -n "__fish_not_contain_opt -s h exec " -s X -l xml -d 'Print full JVM list and additional data as XML plist.'
+complete -fc java_home -n "__fish_not_contain_opt -s h exec " -s V -l verbose -d 'Print full JVM list with architectures.'

From 0b1aa0b12e2ae59640895ce60ecddb04cd47148b Mon Sep 17 00:00:00 2001
From: Xiretza <xiretza@xiretza.xyz>
Date: Wed, 23 Aug 2023 21:42:54 +0000
Subject: [PATCH 091/200] completions: make: respect line continuations in
 recipes

Without this, a recipe containing a trailing backslash followed by a line not
beginning with tab (like any non-continued recipe lines would) would result in
the continuation showing up in completions.

Whenever a line ends in a backslash, consider the next line invalid as a target.

Regex explanation:

^([^#]*[^#\\])? -- optional prefix not containing comment character and not
                   ending in backslash
(\\\\)*\\$      -- 2n+1 backslashes at end of line (handles escaped backslashes)

(cherry picked from commit fff320b56ba42964033089809c77b38147058598)
---
 share/completions/make.fish | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/share/completions/make.fish b/share/completions/make.fish
index 2f5f42f3e..6dec6289d 100644
--- a/share/completions/make.fish
+++ b/share/completions/make.fish
@@ -12,9 +12,13 @@ function __fish_print_make_targets --argument-names directory file
     if make --version 2>/dev/null | string match -q 'GNU*'
         # https://stackoverflow.com/a/26339924
         make $makeflags -pRrq : 2>/dev/null |
-            awk -F: '/^# Files/,/^# Finished Make data base/ {
+            awk -F: -v 'bs_regex=\\\\\\\\' '/^# Files/,/^# Finished Make data base/ {
                 if ($1 == "# Not a target") skip = 1;
-                if ($1 !~ "^[#.\t]") { if (!skip) print $1; skip=0 }
+                if ($1 !~ "^[#.\t]" && !is_continuation ) {
+                    if (!skip) print $1;
+                    skip = 0
+                }
+                is_continuation = $0 ~ "^([^#]*[^#" bs_regex "])?(" bs_regex bs_regex ")*" bs_regex "$";
             }' 2>/dev/null
     else
         # BSD make

From 465da28f20922d681922bd9c67c43a4fd128e635 Mon Sep 17 00:00:00 2001
From: Fabian Boehm <FHomborg@gmail.com>
Date: Fri, 8 Sep 2023 18:25:17 +0200
Subject: [PATCH 092/200] docs/commandline: Add more on the -oc/-ct thing

This was the remaining immediately actionable part of #7375.

It's not definitely the last word, but a change here would require a
bigger plan.

Fixes #7375

(cherry picked from commit 0e81d25b369c202cf8e256382104552d4023921e)
---
 doc_src/cmds/commandline.rst | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/doc_src/cmds/commandline.rst b/doc_src/cmds/commandline.rst
index 3f9206ae1..5f575a6fe 100644
--- a/doc_src/cmds/commandline.rst
+++ b/doc_src/cmds/commandline.rst
@@ -74,6 +74,10 @@ The following options change the way ``commandline`` prints the current commandl
 
 **-c** or **--cut-at-cursor**
     Only print selection up until the current cursor position.
+    If combined with ``--tokenize``, this will print up until the last completed token - excluding the token the cursor is in.
+    This is typically what you would want for instance in completions.
+    To get both, use both ``commandline --cut-at-cursor --tokenize; commandline --cut-at-cursor --current-token``,
+    or ``commandline -co; commandline -ct`` for short.
 
 **-o** or **--tokenize**
     Tokenize the selection and print one string-type token per line.
@@ -120,8 +124,22 @@ The ``echo $flounder >&`` is the first process, ``less`` the second and ``and ec
 
 **$flounder** is the current token.
 
-More examples:
+The most common use for something like completions is
 
+::
+
+   set -l tokens (commandline -opc)
+
+which gives the current *process* (what is being completed), tokenized into separate entries, up to but excluding the currently being completed token
+
+If you are then also interested in the in-progress token, add
+
+::
+   set -l current (commandline -ct)
+
+Note that this makes it easy to render fish's infix matching moot - if possible it's best if the completions just print all possibilities and leave the matching to the current token up to fish's logic.
+
+More examples:
 
 ::
 

From 67a0c046059565663df74e6a026ddd27f5950863 Mon Sep 17 00:00:00 2001
From: Fabian Boehm <FHomborg@gmail.com>
Date: Wed, 6 Sep 2023 21:42:54 +0200
Subject: [PATCH 093/200] reader: Use existing search string when opening the
 history pager

I sometimes find myself doing something like this:

- Look for a commandline that includes "echo" (as an example)
- Type echo, press up a few times
- I can't immediately find what I'm looking for
- Press ctrl-r to open up the history pager
- It uses the current commandline as the search string,
  so now I'm looking for "echo foobar"

This makes it so if the search string already is in use, that's what
the history-pager picks as the initial search string.

(cherry picked from commit 5b44c26a197fd73a4aa465fa1d43bb4c67805fd0)
---
 src/reader.cpp | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/reader.cpp b/src/reader.cpp
index 8669ac111..d3bfa17fb 100644
--- a/src/reader.cpp
+++ b/src/reader.cpp
@@ -3757,7 +3757,13 @@ void reader_data_t::handle_readline_command(readline_cmd_t c, readline_loop_stat
             pager.set_search_field_shown(true);
             pager.set_prefix(MB_CUR_MAX > 1 ? L"► " : L"> ", false /* highlight */);
             // Update the search field, which triggers the actual history search.
-            insert_string(&pager.search_field_line, command_line.text());
+            if (!history_search.active() || history_search.search_string().empty()) {
+                insert_string(&pager.search_field_line, command_line.text());
+            } else {
+                // If we have an actual history search already going, reuse that term
+                // - this is if the user looks around a bit and decides to switch to the pager.
+                insert_string(&pager.search_field_line, history_search.search_string());
+            }
             break;
         }
         case rl::backward_char: {

From 8235fd49ce2db074b6e775476212bee26161a07f Mon Sep 17 00:00:00 2001
From: Asuka Minato <i@asukaminato.eu.org>
Date: Sat, 9 Sep 2023 15:29:39 +0900
Subject: [PATCH 094/200] add gcc completion for link lib (#10007)

* add completion for lib

* use path basename && use -a

(cherry picked from commit 3bf80b23742717bd7f16804ae377bc72931eaaaa)
---
 share/completions/gcc.fish | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/share/completions/gcc.fish b/share/completions/gcc.fish
index 2cbdd06b2..e31713b8c 100644
--- a/share/completions/gcc.fish
+++ b/share/completions/gcc.fish
@@ -490,7 +490,9 @@ complete -c gcc -s c -d 'Compile or assemble the source files, but do not link.'
 complete -c gcc -s S -d 'Stop after the stage of compilation proper; do not assemble'
 complete -c gcc -s E -d 'Stop after the preprocessing stage; do not run the compiler proper'
 complete -c gcc -o llibrary -d 'Search the library named library when linking'
+complete -c gcc -a '-l(path basename /usr/lib/lib*.so* | string match -r -g "^lib(.*?)\.so.*")'
 complete -c gcc -s l -d 'Search the library named library when linking'
+complete -c gcc -o ldl -d 'Search the dynamic loader library when linking'
 complete -c gcc -o lm -d 'Search the math library when linking'
 complete -c gcc -o lz -d 'Search the zlib library when linking'
 complete -c gcc -o lrt -d 'Search the realtime extensions library when linking'

From 1119f68e6611b9db4ee1eec858b2461f02cd18cf Mon Sep 17 00:00:00 2001
From: Jason Nader <24377231+6A61736F6E206E61646572@users.noreply.github.com>
Date: Sat, 9 Sep 2023 15:30:16 +0900
Subject: [PATCH 095/200] completions: add ibmcloud (#10004)

* completions: add ibmcloud

* Update ibmcloud.fish

(cherry picked from commit d6e234c60caa7d17109c0637095be01920f10ef7)
---
 share/completions/ibmcloud.fish | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 share/completions/ibmcloud.fish

diff --git a/share/completions/ibmcloud.fish b/share/completions/ibmcloud.fish
new file mode 100644
index 000000000..5168b1987
--- /dev/null
+++ b/share/completions/ibmcloud.fish
@@ -0,0 +1 @@
+complete -c ibmcloud -f -a '(__fish_argcomplete_complete (commandline -opc) --generate-bash-completion)'

From 57bd21e7ce20c7fd79a398b1842cb2c3b7b27416 Mon Sep 17 00:00:00 2001
From: Fabian Boehm <FHomborg@gmail.com>
Date: Sun, 10 Sep 2023 18:11:23 +0200
Subject: [PATCH 096/200] __fish_complete_command: Fix --foo= logic

This was already supposed to handle `--foo=bar<TAB>` cases, except it
printed the `--foo=` again, causing fish to take that as part of the
token.

See #9538 for a similar thing with __fish_complete_directories.

Fixes #10011

(cherry picked from commit b03327f5d2e0c7062f5af13d194e5c989df28c69)
---
 share/functions/__fish_complete_command.fish | 2 +-
 tests/checks/complete.fish                   | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/share/functions/__fish_complete_command.fish b/share/functions/__fish_complete_command.fish
index ddbfb0273..875d72d23 100644
--- a/share/functions/__fish_complete_command.fish
+++ b/share/functions/__fish_complete_command.fish
@@ -3,7 +3,7 @@ function __fish_complete_command --description 'Complete using all available com
     switch $ctoken
         case '*=*'
             set ctoken (string split "=" -- $ctoken)
-            printf '%s\n' $ctoken[1]=(complete -C "$ctoken[2]")
+            complete -C "$ctoken[2]"
         case '-*' # do not try to complete options as commands
             return
         case '*'
diff --git a/tests/checks/complete.fish b/tests/checks/complete.fish
index 1d40c84c7..79ef35f4c 100644
--- a/tests/checks/complete.fish
+++ b/tests/checks/complete.fish
@@ -532,3 +532,7 @@ begin
 end
 
 rm -r $tmpdir
+
+complete -C'complete --command=fish' | head -n 1 | string replace -rf '\t.*' ''
+# (one "--command=" is okay, we used to get "--command=--command="
+# CHECK: --command=fish

From 9ea7465ab48b2762c8335333b65f0fcdb9febf26 Mon Sep 17 00:00:00 2001
From: NextAlone <12210746+NextAlone@users.noreply.github.com>
Date: Sun, 24 Sep 2023 04:49:43 +0800
Subject: [PATCH 097/200] completion(loginctl): complete sessions, users, seats
 (#10023)

* completion(loginctl): complete sessions, users, seats
* fix: rename functions and use builtin to parse strings
* fix: duplicate commands

(cherry picked from commit 3bcde90a88030ca29dfd3d97abf6d795a947dc31)
---
 share/completions/loginctl.fish | 24 +++++++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)

diff --git a/share/completions/loginctl.fish b/share/completions/loginctl.fish
index 2883ad902..887a4a7a5 100644
--- a/share/completions/loginctl.fish
+++ b/share/completions/loginctl.fish
@@ -1,10 +1,12 @@
-#loginctl (systemd 248)
+#loginctl (systemd 254)
 
 #variables
 set -l seen __fish_seen_subcommand_from
 set -l commands activate attach disable-linger enable-linger flush-devices kill-session kill-user list-seats list-sessions list-users lock-session lock-sessions seat-status session-status show-seat show-session show-user terminate-seat terminate-session terminate-user unlock-session unlock-sessions user-status
 set -l output cat export json json-pretty json-seq json-sse short short-full short-iso short-iso-precise short-monotonic short-precise short-unix verbose with-unit
 
+complete -c loginctl -f
+
 #commands
 complete -c loginctl -x -n "not $seen $commands" -a "$commands"
 
@@ -25,3 +27,23 @@ complete -c loginctl -x -n "not $seen $commands" -s P -d "Equivalent to --value
 complete -c loginctl -x -n "not $seen $commands" -l signal -s s -d "Which signal to send"
 complete -c loginctl -f -n "not $seen $commands" -l value -d "When showing properties, only print the value"
 complete -c loginctl -f -n "not $seen $commands" -l version -d "Show package version"
+
+
+function __fish_loginctl_list_sessions
+    loginctl list-sessions --no-legend --no-pager --output=short | string replace -r '(\d+) \d+ (\S+) \S+ (\S+) .*' '$1\t$2 at $3'
+end
+
+
+function __fish_loginctl_list_users
+    loginctl list-users --no-legend --no-pager --output=short | string replace -r '(\d+) (\S+) .*' '$1\t$2'
+end
+
+
+function __fish_loginctl_list_seats
+    loginctl list-seats --no-legend --no-pager --output=short
+end
+
+
+complete -c loginctl -n "$seen session-status show-session activate lock-session unlock-session terminate-session kill-session" -a '(__fish_loginctl_list_sessions)'
+complete -c loginctl -n "$seen user-status show-user enable-linger disable-linger terminate-user kill-user" -a '(__fish_loginctl_list_users)'
+complete -c loginctl -n "$seen seat-status show-seat attach terminate-seat" -a '(__fish_loginctl_list_seats)'

From 3027bc355bdf740f361aef10c16df463ad254532 Mon Sep 17 00:00:00 2001
From: Charlotte <charlotte@lottia.net>
Date: Wed, 27 Sep 2023 20:33:42 +1000
Subject: [PATCH 098/200] completions/pkill: use locals.

(cherry picked from commit 7c5777a82a3f78ce0b6256d163727b20d2bf0d0d)
---
 share/completions/pkill.fish | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/share/completions/pkill.fish b/share/completions/pkill.fish
index 00e350b94..8aa5538e3 100644
--- a/share/completions/pkill.fish
+++ b/share/completions/pkill.fish
@@ -2,7 +2,7 @@
 __fish_complete_pgrep pkill
 __fish_make_completion_signals
 for i in $__kill_signals
-    echo $i | read number name
+    echo $i | read -l number name
     complete -c pkill -o $number -d $name
     complete -c pkill -o $name -d $name
 end

From 577dc2be94a26e7663ba465c1892c8f08a7254a0 Mon Sep 17 00:00:00 2001
From: Fabian Boehm <FHomborg@gmail.com>
Date: Sat, 30 Sep 2023 15:27:37 +0200
Subject: [PATCH 099/200] screen: Unset color at the end of a line even without
 clr_eol

This is a sensible thing to do, and fixes some cases where we're
state-dependent.

E.g. this fixes the case in the pager where some things are bold and
some aren't, because that bolding is (rather awkwardly) implicitly
triggered when we have a background, and so we don't notice we need to
re-do that bolding after we moved to the next line because we think we
still have the same color.

Fixes #9617

(cherry picked from commit 10d91b0249f57a5269ee5e1c0517da095fe3c820)
---
 src/screen.cpp | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/screen.cpp b/src/screen.cpp
index ef8fbf16f..7cb6cf52f 100644
--- a/src/screen.cpp
+++ b/src/screen.cpp
@@ -878,8 +878,12 @@ void screen_t::update(const wcstring &left_prompt, const wcstring &right_prompt,
                 clear_remainder = prev_width > current_width;
             }
         }
+
+        // We unset the color even if we don't clear the line.
+        // This means that we switch background correctly on the next,
+        // including our weird implicit bolding.
+        set_color(highlight_spec_t{});
         if (clear_remainder && clr_eol) {
-            set_color(highlight_spec_t{});
             this->move(current_width, static_cast<int>(i));
             this->write_mbs(clr_eol);
         }

From 542e23e87b079abc298ebf2020c2618c239e0873 Mon Sep 17 00:00:00 2001
From: Roland Fredenhagen <dev@modprog.de>
Date: Sun, 1 Oct 2023 08:37:42 +0200
Subject: [PATCH 100/200] completions: add watchexec (#10027)

* completions: add watchexec

* review

(cherry picked from commit e6bef40c22758ea999540323bc362b8088d182c1)
---
 share/completions/watchexec.fish | 79 ++++++++++++++++++++++++++++++++
 1 file changed, 79 insertions(+)
 create mode 100644 share/completions/watchexec.fish

diff --git a/share/completions/watchexec.fish b/share/completions/watchexec.fish
new file mode 100644
index 000000000..d91fdb7f3
--- /dev/null
+++ b/share/completions/watchexec.fish
@@ -0,0 +1,79 @@
+function __fish_watchexec_print_remaining_args
+    set -l spec w/watch= c/clear='?' o/on-busy-update= r/restart s/signal= stop-signal= stop-timeout= d/debounce= stdin-quit no-vcs-ignore no-project-ignore no-global-ignore no-default-ignore no-discover-ignore p/postpone delay-run= poll= shell= n no-environment emit-events-to= E/env= no-process-group N/notify project-origin= workdir= e/exts= f/filter= filter-file= i/ignore= ignore-file= fs-events= no-meta print-events v/verbose log-file= manual h/help V/version
+
+    set argv (commandline -opc) (commandline -ct)
+    set -e argv[1]
+
+    argparse -s $spec -- $argv 2>/dev/null
+
+    # The remaining argv is the subcommand with all its options, which is what
+    # we want.
+    if set -q argv[1]
+        and not string match -qr '^-.*' -- $argv[1]
+        string join0 -- $argv
+        return 0
+    else
+        return 1
+    end
+end
+
+function __fish_watchexec_complete_subcommand
+    set -l args (__fish_watchexec_print_remaining_args | string split0) 
+    complete -C "$args"
+end
+
+function __fish_watchexec_at_argfile
+    set -l current (commandline -ct)
+    if test (count (commandline -opc)) -eq 1 
+        and string match -q '@*' -- $current
+
+        set current (string sub -s 2 -- $current)
+        __fish_complete_path | string replace -r "^" @
+        return 0
+    end
+    return 1
+end
+
+complete -c watchexec -n "__fish_watchexec_at_argfile" -x -a "(__fish_watchexec_at_argfile)"
+
+complete -c watchexec -x -a "(__fish_watchexec_complete_subcommand)"
+
+complete -c watchexec -n "not __fish_watchexec_print_remaining_args" -sw -lwatch -r -d "Watch a specific file or directory"
+complete -c watchexec -n "not __fish_watchexec_print_remaining_args" -sc -lclear -fa reset -d "Clear screen before running command"
+complete -c watchexec -n "not __fish_watchexec_print_remaining_args" -so -lon-busy-update -r -xa "queue do-nothinig restart signal" -d "What to do when receiving events while the command is running"
+complete -c watchexec -n "not __fish_watchexec_print_remaining_args" -sr -lrestart -d "Restart the process if it's still running"
+complete -c watchexec -n "not __fish_watchexec_print_remaining_args" -ss -lsignal -r -f -d "Send a signal to the process when it's still running"
+complete -c watchexec -n "not __fish_watchexec_print_remaining_args" -lstop-signal -r -f -d "Signal to send to sstop the command"
+complete -c watchexec -n "not __fish_watchexec_print_remaining_args" -lstop-timeout -r -f -d "Time to wait for the command to exit gracefully"
+complete -c watchexec -n "not __fish_watchexec_print_remaining_args" -sd -ldebounce -r -f -d "Time to wait for new events before taking action"
+complete -c watchexec -n "not __fish_watchexec_print_remaining_args" -lstdin-quit -d "Exit when stding closes"
+complete -c watchexec -n "not __fish_watchexec_print_remaining_args" -lno-vcs-ignore -d "Don't load gitignores"
+complete -c watchexec -n "not __fish_watchexec_print_remaining_args" -lno-project-ignore -d "Don't load project-local ignores"
+complete -c watchexec -n "not __fish_watchexec_print_remaining_args" -lno-global-ignore -d "Don't load global ignores"
+complete -c watchexec -n "not __fish_watchexec_print_remaining_args" -lno-default-ignore -d "Don't use internal default ignores"
+complete -c watchexec -n "not __fish_watchexec_print_remaining_args" -lno-discover-ignore -d "Don't discover ignore files at all"
+complete -c watchexec -n "not __fish_watchexec_print_remaining_args" -sp -lpostpone -d "Wait until first change before running command"
+complete -c watchexec -n "not __fish_watchexec_print_remaining_args" -ldelay-run -r -f -d "Sleep before running the command"
+complete -c watchexec -n "not __fish_watchexec_print_remaining_args" -lpoll -r -f -d "Poll for filesystem changes"
+complete -c watchexec -n "not __fish_watchexec_print_remaining_args" -lshell -r -fa "(printf 'none\tDon\'t use a shell\n';string match -r '^[^#].*' < /etc/shells)" -d "Use a different shell"
+complete -c watchexec -n "not __fish_watchexec_print_remaining_args" -ln -d "Don#t use a shell"
+complete -c watchexec -n "not __fish_watchexec_print_remaining_args" -lno-environment -d "--emit-events=none"
+complete -c watchexec -n "not __fish_watchexec_print_remaining_args" -lemit-events-to -r -fa "environment stdin file json-stdin json-file none" -d "Configure event emission"
+complete -c watchexec -n "not __fish_watchexec_print_remaining_args" -sE -lenv -r -f -d "Add env vars to the command"
+complete -c watchexec -n "not __fish_watchexec_print_remaining_args" -lno-process-group -d "Don't use a process group"
+complete -c watchexec -n "not __fish_watchexec_print_remaining_args" -sN -lnotify -d "Alert when commands start and end"
+complete -c watchexec -n "not __fish_watchexec_print_remaining_args" -lproject-origin -r -fa "(__fish_complete_directories)" -d "Set the project origin"
+complete -c watchexec -n "not __fish_watchexec_print_remaining_args" -lworkdir -r -fa "(__fish_complete_directories)" -d "Set the working directory"
+complete -c watchexec -n "not __fish_watchexec_print_remaining_args" -se -lexts -r -f -d "Filename extensions to filter to"
+complete -c watchexec -n "not __fish_watchexec_print_remaining_args" -sf -lfilter -r -f -d "Filename patterns to filter to"
+complete -c watchexec -n "not __fish_watchexec_print_remaining_args" -lfilter-file -r -d "Files to load filters from"
+complete -c watchexec -n "not __fish_watchexec_print_remaining_args" -si -lignore -r -f -d "Filename patterns to filter out"
+complete -c watchexec -n "not __fish_watchexec_print_remaining_args" -lignore-file -r -d "Files to load ignores from"
+complete -c watchexec -n "not __fish_watchexec_print_remaining_args" -lfs-events -r -fa "access create remove rename modify metadata" -d "Filesystem events to filter to"
+complete -c watchexec -n "not __fish_watchexec_print_remaining_args" -lno-meta -d "Filesystem events to filter to"
+complete -c watchexec -n "not __fish_watchexec_print_remaining_args" -lprint-events -d "Print events that trigger actions"
+complete -c watchexec -n "not __fish_watchexec_print_remaining_args" -sv -lverbose -d "Set diagnostic log level"
+complete -c watchexec -n "not __fish_watchexec_print_remaining_args" -llog-file -r -d "Write diagnostic logs to a file"
+complete -c watchexec -n "not __fish_watchexec_print_remaining_args" -lmanual -d "Show the manual page"
+complete -c watchexec -n "not __fish_watchexec_print_remaining_args" -sh -lhelp -d "Print help (see a summary with '-h')"
+complete -c watchexec -n "not __fish_watchexec_print_remaining_args" -sV -lversion -d "Print version"

From bd6471d2ceda01ad1adcf09c64d20ac1038564bc Mon Sep 17 00:00:00 2001
From: "Kevin  F. Konrad" <kevinkonrad@ymail.com>
Date: Sun, 1 Oct 2023 08:38:27 +0200
Subject: [PATCH 101/200] add completions for crc and oc (#10034)

(cherry picked from commit 269c9c3f0c0308c0abaaf716b8c5a5e22b92c274)
---
 share/completions/crc.fish | 1 +
 share/completions/oc.fish  | 1 +
 2 files changed, 2 insertions(+)
 create mode 100644 share/completions/crc.fish
 create mode 100644 share/completions/oc.fish

diff --git a/share/completions/crc.fish b/share/completions/crc.fish
new file mode 100644
index 000000000..de2272d30
--- /dev/null
+++ b/share/completions/crc.fish
@@ -0,0 +1 @@
+crc completion fish | source
diff --git a/share/completions/oc.fish b/share/completions/oc.fish
new file mode 100644
index 000000000..26a7881cb
--- /dev/null
+++ b/share/completions/oc.fish
@@ -0,0 +1 @@
+oc completion fish | source

From 52276e4766441891098a13fa45f6bc8ff65d1749 Mon Sep 17 00:00:00 2001
From: Xiretza <xiretza@xiretza.xyz>
Date: Sat, 30 Sep 2023 16:03:44 +0000
Subject: [PATCH 102/200] completions/pacman: fix -Qp completing packages, not
 files

--file/-p makes -Q interpret the command line argument as a package file
rather than a package name.

(cherry picked from commit 0cdf801d0b979c1aa53310b905791a6514792eef)
---
 share/completions/pacman.fish | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/share/completions/pacman.fish b/share/completions/pacman.fish
index f198294f2..cb39eeebd 100644
--- a/share/completions/pacman.fish
+++ b/share/completions/pacman.fish
@@ -9,10 +9,14 @@ set -l listinstalled "(__fish_print_pacman_packages --installed)"
 set -l listall "(__fish_print_pacman_packages)"
 set -l listrepos "(__fish_print_pacman_repos)"
 set -l listgroups "(pacman -Sg)\t'Package Group'"
+# Theoretically, pacman reads packages in all formats that libarchive supports
+# In practice, it's going to be tar.xz, tar.gz, tar.zst, or just pkg.tar (uncompressed pkg)
+set -l listfiles '(__fish_complete_suffix pkg.tar.zst pkg.tar.xz pkg.tar.gz pkg.tar)'
 
 set -l noopt 'not __fish_contains_opt -s S -s D -s Q -s R -s U -s T -s F database query sync remove upgrade deptest files'
 set -l database '__fish_contains_opt -s D database'
 set -l query '__fish_contains_opt -s Q query'
+set -l queryfile '__fish_contains_opt -s p file'
 set -l remove '__fish_contains_opt -s R remove'
 set -l sync '__fish_contains_opt -s S sync'
 set -l upgrade '__fish_contains_opt -s U upgrade'
@@ -120,7 +124,8 @@ complete -c $progname -n "$query" -s p -l file -d 'Query a package file instead
 complete -c $progname -n "$query" -s s -l search -d 'Search locally-installed packages for regexp' -f
 complete -c $progname -n "$query" -s t -l unrequired -d 'List only unrequired packages [and optdepends]' -f
 complete -c $progname -n "$query" -s u -l upgrades -d 'List only out-of-date packages' -f
-complete -c $progname -n "$query" -d 'Installed package' -xa "$listinstalled"
+complete -c $progname -n "$query" -n "not $queryfile" -d 'Installed package' -xa "$listinstalled"
+complete -c $progname -n "$query" -n "$queryfile" -d 'Package file' -k -xa "$listfiles"
 
 # Remove options
 complete -c $progname -n "$remove" -s c -l cascade -d 'Also remove packages depending on PACKAGE' -f
@@ -139,6 +144,4 @@ complete -c $progname -n "$sync" -s w -l downloadonly -d 'Only download the targ
 complete -c $progname -n "$sync" -xa "$listall $listgroups"
 
 # Upgrade options
-# Theoretically, pacman reads packages in all formats that libarchive supports
-# In practice, it's going to be tar.xz, tar.gz, tar.zst, or just pkg.tar (uncompressed pkg)
-complete -c $progname -n "$upgrade" -k -xa '(__fish_complete_suffix pkg.tar.zst pkg.tar.xz pkg.tar.gz pkg.tar)' -d 'Package file'
+complete -c $progname -n "$upgrade" -k -xa "$listfiles" -d 'Package file'

From 04492a1a23fd6a7f7b08d6f9703bee514445e29f Mon Sep 17 00:00:00 2001
From: Fabian Boehm <FHomborg@gmail.com>
Date: Wed, 4 Oct 2023 15:57:32 +0200
Subject: [PATCH 103/200] open: Don't run xdg-open in the background

This was introduced as a workaround to #7215 - xdg-open's generic path
wouldn't background graphical apps.

This has been fixed a month ago in xdg-open, so we can stop doing it.

The good news is this also allows terminal apps to be used again, so
it

Fixes #10045

(cherry picked from commit f8e38819a50367bcdd6a26fe7b18b21c1dffbe23)
---
 share/functions/open.fish | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/share/functions/open.fish b/share/functions/open.fish
index 442bdf568..08c1942ad 100644
--- a/share/functions/open.fish
+++ b/share/functions/open.fish
@@ -24,14 +24,7 @@ if not command -sq open
             end
         else if type -q -f xdg-open
             for i in $argv
-                # In the "generic" path where it doesn't use a helper utility,
-                # xdg-open fails to fork off, so it blocks the terminal.
-                xdg-open $i &
-                # Note: We *need* to pass $last_pid, or it will disown the last *existing* job.
-                # In case xdg-open forks, that would be whatever else the user has backgrounded.
-                #
-                # Yes, this has a (hopefully theoretical) race of the PID being recycled.
-                disown $last_pid 2>/dev/null
+                xdg-open $i
             end
         else
             echo (_ 'No open utility found. Try installing "xdg-open" or "xdg-utils".') >&2

From ac64331217d5ee39bacb56ef0b07bfecc64a8aa7 Mon Sep 17 00:00:00 2001
From: Fabian Boehm <FHomborg@gmail.com>
Date: Fri, 6 Oct 2023 16:38:26 +0200
Subject: [PATCH 104/200] reader: Only move cursor if needed for repaint-mode

This uses "screen.reset_line" to move the cursor without informing the
reader's machinery (because that deals with positions *in the
commandline*), but then only repainted "if needed" - meaning if the
reader thought anything changed.

That could lead to a situation where the cursor stays at column 0
until you do something, e.g. in

```fish
bind -m insert u undo
```

when you press alt+u - because the *escape* calls repaint-mode, which
puts the cursor in column 0, and then the undo doesn't, which keeps it
there.

Of course this binding should also `repaint-mode`, because it changes
the mode.

Some changes might be ergonomic:

1. Make repaint-mode the default if the mode changed (we would need to
skip it for bracketed-paste)
2. Make triggering the repaint easier - do we need to set
force_exec_prompt_and_repaint to false here as well?

Anyway, this

Fixes #7910

(cherry picked from commit ff433b0cb235689a93734e08a9dbed0204ce7ebe)
---
 src/reader.cpp | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/reader.cpp b/src/reader.cpp
index d3bfa17fb..351c12e4d 100644
--- a/src/reader.cpp
+++ b/src/reader.cpp
@@ -3489,8 +3489,10 @@ void reader_data_t::handle_readline_command(readline_cmd_t c, readline_loop_stat
             parser().libdata().is_repaint = true;
             exec_mode_prompt();
             if (!mode_prompt_buff.empty()) {
-                screen.reset_line(true /* redraw prompt */);
-                if (this->is_repaint_needed()) this->layout_and_repaint(L"mode");
+                if (this->is_repaint_needed()) {
+                    screen.reset_line(true /* redraw prompt */);
+                    this->layout_and_repaint(L"mode");
+                }
                 parser().libdata().is_repaint = false;
                 break;
             }

From 11304f00cfab0a0e2249c2fcf54f40177e21b1aa Mon Sep 17 00:00:00 2001
From: Fabian Boehm <FHomborg@gmail.com>
Date: Fri, 6 Oct 2023 18:15:25 +0200
Subject: [PATCH 105/200] Apply variable overrides for exec

Fixes #9995

(cherry picked from commit 496d65fb5d9660f2f0287a7c3951f96324f04de8)
---
 src/exec.cpp           | 5 +++++
 tests/checks/exec.fish | 8 ++++++--
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/src/exec.cpp b/src/exec.cpp
index 7fae21c3d..26809c80c 100644
--- a/src/exec.cpp
+++ b/src/exec.cpp
@@ -1006,6 +1006,11 @@ bool exec_job(parser_t &parser, const shared_ptr<job_t> &j, const io_chain_t &bl
             return false;
         }
 
+        // Apply foo=bar variable assignments
+        for (const auto &assignment : j->processes.front()->variable_assignments) {
+            parser.vars().set(assignment.variable_name, ENV_LOCAL | ENV_EXPORT, assignment.values);
+        }
+
         internal_exec(parser.vars(), j.get(), block_io);
         // internal_exec only returns if it failed to set up redirections.
         // In case of an successful exec, this code is not reached.
diff --git a/tests/checks/exec.fish b/tests/checks/exec.fish
index ddaa203a6..ed7d8d5a2 100644
--- a/tests/checks/exec.fish
+++ b/tests/checks/exec.fish
@@ -1,4 +1,5 @@
-#RUN: %fish %s
+#RUN: %fish -C 'set -l fish %fish' %s
+
 exec cat <nosuchfile
 #CHECKERR: warning: An error occurred while redirecting file 'nosuchfile'
 #CHECKERR: warning: Path 'nosuchfile' does not exist
@@ -10,7 +11,10 @@ not exec cat <nosuchfile
 echo "neg failed: $status"
 #CHECK: neg failed: 0
 
+# See that variable overrides are applied to exec'd processes
+$fish --no-config -c 'foo=bar exec env' | grep foo=bar
+# CHECK: foo=bar
+
 # This needs to be last, because it actually runs exec.
 exec cat </dev/null
 echo "not reached"
-

From 4b12671b1c480cddca1a506113a733cfa547aa92 Mon Sep 17 00:00:00 2001
From: Mathijs Henquet <mathijs.henquet@gmail.com>
Date: Sat, 7 Oct 2023 18:00:17 +0200
Subject: [PATCH 106/200] Fix out of scope opt variable (#10020)

* Fix out of scope opt variable

* Update ls.fish

(cherry picked from commit a8096724129e7246bddca0c7552e3ddac51b3b36)
---
 share/functions/ls.fish | 1 +
 1 file changed, 1 insertion(+)

diff --git a/share/functions/ls.fish b/share/functions/ls.fish
index c02b8198f..da05d9887 100644
--- a/share/functions/ls.fish
+++ b/share/functions/ls.fish
@@ -49,6 +49,7 @@ function ls --description "List contents of directory"
     # Set the colors to the default via `dircolors` if none is given.
     __fish_set_lscolors
 
+    set -l opt
     isatty stdout
     and set -a opt -F
 

From 18c65df3c727009e935c9bd2e6da23dc5b73d13c Mon Sep 17 00:00:00 2001
From: Fabian Boehm <FHomborg@gmail.com>
Date: Sun, 8 Oct 2023 11:41:30 +0200
Subject: [PATCH 107/200] Add a clear-screen bind function to clear the screen
 (#10044)

This can be bound like `bind \cl clear-screen`, and is, by default

In contrast to the current way it doesn't need the external `clear`
command that was always awkward.

Also it will clear the screen and first draw the old prompt to remove
flicker.
Then it will immediately trigger a repaint, so the prompt will be overwritten.

(cherry picked from commit c4ca1a68d361c2f0e636c2f5aba53fc0c35a52f1)
---
 doc_src/cmds/bind.rst                         |  3 +++
 .../functions/__fish_shared_key_bindings.fish |  4 +---
 src/input.cpp                                 |  1 +
 src/input_common.h                            |  2 ++
 src/reader.cpp                                | 21 +++++++++++++++++++
 src/screen.cpp                                |  7 +++++++
 src/screen.h                                  |  1 +
 7 files changed, 36 insertions(+), 3 deletions(-)

diff --git a/doc_src/cmds/bind.rst b/doc_src/cmds/bind.rst
index 3a481f40c..451fa3d00 100644
--- a/doc_src/cmds/bind.rst
+++ b/doc_src/cmds/bind.rst
@@ -143,6 +143,9 @@ The following special input functions are available:
 ``capitalize-word``
     make the current word begin with a capital letter
 
+``clear-screen``
+    clears the screen and redraws the prompt. if the terminal doesn't support clearing the screen it is the same as ``repaint``.
+
 ``complete``
     guess the remainder of the current token
 
diff --git a/share/functions/__fish_shared_key_bindings.fish b/share/functions/__fish_shared_key_bindings.fish
index eaf4f132f..ccaacb3f8 100644
--- a/share/functions/__fish_shared_key_bindings.fish
+++ b/share/functions/__fish_shared_key_bindings.fish
@@ -86,9 +86,7 @@ function __fish_shared_key_bindings -d "Bindings shared between emacs and vi mod
     bind --preset $argv \el __fish_list_current_token
     bind --preset $argv \eo __fish_preview_current_file
     bind --preset $argv \ew __fish_whatis_current_token
-    # ncurses > 6.0 sends a "delete scrollback" sequence along with clear.
-    # This string replace removes it.
-    bind --preset $argv \cl 'echo -n (clear | string replace \e\[3J ""); commandline -f repaint'
+    bind --preset $argv \cl clear-screen
     bind --preset $argv \cc cancel-commandline
     bind --preset $argv \cu backward-kill-line
     bind --preset $argv \cw backward-kill-path-component
diff --git a/src/input.cpp b/src/input.cpp
index 562cf7f33..25c3f20d1 100644
--- a/src/input.cpp
+++ b/src/input.cpp
@@ -106,6 +106,7 @@ static constexpr const input_function_metadata_t input_function_metadata[] = {
     {L"cancel", readline_cmd_t::cancel},
     {L"cancel-commandline", readline_cmd_t::cancel_commandline},
     {L"capitalize-word", readline_cmd_t::capitalize_word},
+    {L"clear-screen", readline_cmd_t::clear_screen_and_repaint},
     {L"complete", readline_cmd_t::complete},
     {L"complete-and-search", readline_cmd_t::complete_and_search},
     {L"delete-char", readline_cmd_t::delete_char},
diff --git a/src/input_common.h b/src/input_common.h
index a53c46b5d..bef8b1694 100644
--- a/src/input_common.h
+++ b/src/input_common.h
@@ -91,6 +91,8 @@ enum class readline_cmd_t {
     end_undo_group,
     repeat_jump,
     disable_mouse_tracking,
+    // ncurses uses the obvious name
+    clear_screen_and_repaint,
     // NOTE: This one has to be last.
     reverse_repeat_jump
 };
diff --git a/src/reader.cpp b/src/reader.cpp
index 351c12e4d..036d2096b 100644
--- a/src/reader.cpp
+++ b/src/reader.cpp
@@ -4243,6 +4243,27 @@ void reader_data_t::handle_readline_command(readline_cmd_t c, readline_loop_stat
             outp.writestr(L"\x1B[?1000l");
             break;
         }
+        case rl::clear_screen_and_repaint: {
+            parser().libdata().is_repaint = true;
+            auto clear = screen_clear();
+            if (!clear.empty()) {
+                // Clear the screen if we can.
+                // This is subtle: We first clear, draw the old prompt,
+                // and *then* reexecute the prompt and overdraw it.
+                // This removes the flicker,
+                // while keeping the prompt up-to-date.
+                outputter_t &outp = outputter_t::stdoutput();
+                outp.writestr(clear.c_str());
+                screen.reset_line(true /* redraw prompt */);
+                this->layout_and_repaint(L"readline");
+            }
+            exec_prompt();
+            screen.reset_line(true /* redraw prompt */);
+            this->layout_and_repaint(L"readline");
+            force_exec_prompt_and_repaint = false;
+            parser().libdata().is_repaint = false;
+            break;
+        }
         // Some commands should have been handled internally by inputter_t::readch().
         case rl::self_insert:
         case rl::self_insert_notfirst:
diff --git a/src/screen.cpp b/src/screen.cpp
index 7cb6cf52f..28733893f 100644
--- a/src/screen.cpp
+++ b/src/screen.cpp
@@ -266,6 +266,13 @@ maybe_t<size_t> escape_code_length(const wchar_t *code) {
     return found ? maybe_t<size_t>{esc_seq_len} : none();
 }
 
+wcstring screen_clear() {
+    if (clear_screen) {
+        return str2wcstring(clear_screen);
+    }
+    return wcstring{};
+}
+
 size_t layout_cache_t::escape_code_length(const wchar_t *code) {
     assert(code != nullptr);
     if (*code != L'\x1B') return 0;
diff --git a/src/screen.h b/src/screen.h
index 26bbb452b..64f3dc7a5 100644
--- a/src/screen.h
+++ b/src/screen.h
@@ -331,5 +331,6 @@ class layout_cache_t : noncopyable_t {
 
 maybe_t<size_t> escape_code_length(const wchar_t *code);
 
+wcstring screen_clear();
 void screen_set_midnight_commander_hack();
 #endif

From 724b44907e304161226dba6107855fd454ba09ac Mon Sep 17 00:00:00 2001
From: Fabian Boehm <FHomborg@gmail.com>
Date: Sun, 8 Oct 2023 16:46:59 +0200
Subject: [PATCH 108/200] Reduce stat calls for wildcards ending in "/"
 (#10032)

This makes it so expand_intermediate_segment knows about the case
where it's last, only followed by a "/".

When it is, it can do without the file_id for finding links (we don't
resolve the files we get here), which allows us to remove a stat()
call.

This speeds up the case of `...*/` by quite a bit.

If that last component was a directory with 1000 subdirectories we
could skip 1000 stat calls!

One slight weirdness: We refuse to add links to directories that we already visited, even if they are the last component and we don't actually follow them. That means we can't do the fast path here either, but we do know if something is a link (if we get d_type), so it still works in common cases.

(cherry picked from commit 86803e44429b002d77342bdf8984dd790d5d7779)
---
 src/wildcard.cpp | 20 ++++++++++++++++++--
 src/wutil.cpp    |  4 +++-
 src/wutil.h      |  6 ++++++
 3 files changed, 27 insertions(+), 3 deletions(-)

diff --git a/src/wildcard.cpp b/src/wildcard.cpp
index f5404650a..7da596642 100644
--- a/src/wildcard.cpp
+++ b/src/wildcard.cpp
@@ -722,6 +722,7 @@ void wildcard_expander_t::expand_intermediate_segment(const wcstring &base_dir,
                                                       const wcstring &prefix) {
     std::string narrow;
     const dir_iter_t::entry_t *entry{};
+    bool is_final = !*wc_remainder && wc_segment.find(ANY_STRING_RECURSIVE) == wcstring::npos;
     while (!interrupted_or_overflowed() && (entry = base_dir_iter.next())) {
         // Note that it's critical we ignore leading dots here, else we may descend into . and ..
         if (!wildcard_match(entry->name, wc_segment, true)) {
@@ -733,6 +734,22 @@ void wildcard_expander_t::expand_intermediate_segment(const wcstring &base_dir,
             continue;
         }
 
+        // Fast path: If this entry can't be a link (we know via d_type),
+        // we don't need to protect against symlink loops.
+        // This is *not* deduplication, we just don't want a loop.
+        //
+        // We only do this when we are the last `*/` component,
+        // because we're a bit inconsistent on when we will enter loops.
+        if (is_final && !entry->is_possible_link()) {
+            // We made it through.
+            // Perform normal wildcard expansion on this new directory,
+            // starting at our tail_wc
+            wcstring full_path = base_dir + entry->name;
+            full_path.push_back(L'/');
+            this->expand(full_path, wc_remainder, prefix + wc_segment + L'/');
+            continue;
+        }
+
         auto statbuf = entry->stat();
         if (!statbuf) {
             continue;
@@ -744,8 +761,7 @@ void wildcard_expander_t::expand_intermediate_segment(const wcstring &base_dir,
             continue;
         }
 
-        // We made it through. Perform normal wildcard expansion on this new directory, starting at
-        // our tail_wc, which includes the ANY_STRING_RECURSIVE guy.
+        // (like the fast path above)
         wcstring full_path = base_dir + entry->name;
         full_path.push_back(L'/');
         this->expand(full_path, wc_remainder, prefix + wc_segment + L'/');
diff --git a/src/wutil.cpp b/src/wutil.cpp
index 5914c1ca3..ef987f952 100644
--- a/src/wutil.cpp
+++ b/src/wutil.cpp
@@ -228,10 +228,12 @@ const dir_iter_t::entry_t *dir_iter_t::next() {
     entry_.inode = dent->d_ino;
 #ifdef HAVE_STRUCT_DIRENT_D_TYPE
     auto type = dirent_type_to_entry_type(dent->d_type);
-    // Do not store symlinks as we will need to resolve them.
+    // Do not store symlinks as type as we will need to resolve them.
     if (type != dir_entry_type_t::lnk) {
         entry_.type_ = type;
     }
+    // This entry could be a link if it is a link or unknown.
+    entry_.possible_link_ = !type.has_value() || type == dir_entry_type_t::lnk;
 #endif
     return &entry_;
 }
diff --git a/src/wutil.h b/src/wutil.h
index a0565faee..5ab2d4bdc 100644
--- a/src/wutil.h
+++ b/src/wutil.h
@@ -221,6 +221,9 @@ class dir_iter_t : noncopyable_t {
         /// \return whether this is a directory. This may call stat().
         bool is_dir() const { return check_type() == dir_entry_type_t::dir; }
 
+        /// \return false if we know this can't be a link via d_type, true if it could be.
+        bool is_possible_link() const { return possible_link_; }
+
         /// \return the stat buff for this entry, invoking stat() if necessary.
         const maybe_t<struct stat> &stat() const;
 
@@ -239,6 +242,9 @@ class dir_iter_t : noncopyable_t {
         // and the type is left as none(). Note this is an unavoidable race.
         mutable maybe_t<dir_entry_type_t> type_{};
 
+        /// whether this entry could be a link, false if we know definitively it isn't.
+        bool possible_link_ = true;
+
         // fd of the DIR*, used for fstatat().
         int dirfd_{-1};
 

From 8a8c7abb0f7dfb224c04455a71a4bca4a9928d1c Mon Sep 17 00:00:00 2001
From: yanshay <yanivshaya@gmail.com>
Date: Sat, 29 Jul 2023 19:23:07 +0300
Subject: [PATCH 109/200] added support for fish_sequence_key_delay_ms to set
 how long to wait between sequence key presses

---
 src/env_dispatch.cpp    |  1 +
 src/fish_key_reader.cpp |  2 +-
 src/input.cpp           | 21 +++++++++++++--------
 src/input_common.cpp    | 38 ++++++++++++++++++++++++++++++++++++--
 src/input_common.h      |  6 +++++-
 5 files changed, 56 insertions(+), 12 deletions(-)

diff --git a/src/env_dispatch.cpp b/src/env_dispatch.cpp
index 9c3882ce0..0e1f8c4a8 100644
--- a/src/env_dispatch.cpp
+++ b/src/env_dispatch.cpp
@@ -317,6 +317,7 @@ static std::unique_ptr<const var_dispatch_table_t> create_dispatch_table() {
     var_dispatch_table->add(L"fish_term256", handle_fish_term_change);
     var_dispatch_table->add(L"fish_term24bit", handle_fish_term_change);
     var_dispatch_table->add(L"fish_escape_delay_ms", update_wait_on_escape_ms);
+    var_dispatch_table->add(L"fish_sequence_key_delay_ms", update_wait_on_sequence_key_ms);
     var_dispatch_table->add(L"fish_emoji_width", guess_emoji_width);
     var_dispatch_table->add(L"fish_ambiguous_width", handle_change_ambiguous_width);
     var_dispatch_table->add(L"LINES", handle_term_size_change);
diff --git a/src/fish_key_reader.cpp b/src/fish_key_reader.cpp
index 1731003ec..bb7afeaaf 100644
--- a/src/fish_key_reader.cpp
+++ b/src/fish_key_reader.cpp
@@ -237,7 +237,7 @@ static void process_input(bool continuous_mode, bool verbose) {
         if (reader_test_and_clear_interrupted()) {
             evt = char_event_t{shell_modes.c_cc[VINTR]};
         } else {
-            evt = queue.readch_timed();
+            evt = queue.readch_timed_esc();
         }
         if (!evt || !evt->is_char()) {
             output_bind_command(bind_chars);
diff --git a/src/input.cpp b/src/input.cpp
index 25c3f20d1..4831953ff 100644
--- a/src/input.cpp
+++ b/src/input.cpp
@@ -465,19 +465,24 @@ class event_queue_peeker_t {
 
     /// Check if the next event is the given character. This advances the index on success only.
     /// If \p timed is set, then return false if this (or any other) character had a timeout.
-    bool next_is_char(wchar_t c, bool timed = false) {
+    bool next_is_char(wchar_t c, bool escaped = false) {
         assert(idx_ <= peeked_.size() && "Index must not be larger than dequeued event count");
         // See if we had a timeout already.
-        if (timed && had_timeout_) {
+        if (escaped && had_timeout_) {
             return false;
         }
         // Grab a new event if we have exhausted what we have already peeked.
         // Use either readch or readch_timed, per our param.
         if (idx_ == peeked_.size()) {
             char_event_t newevt{L'\0'};
-            if (!timed) {
-                newevt = event_queue_.readch();
-            } else if (auto mevt = event_queue_.readch_timed()) {
+            if (!escaped) {
+                if (auto mevt = event_queue_.readch_timed_sequence_key()) {
+                    newevt = mevt.acquire();
+                } else {
+                    had_timeout_ = true;
+                    return false;
+                }
+            } else if (auto mevt = event_queue_.readch_timed_esc()) {
                 newevt = mevt.acquire();
             } else {
                 had_timeout_ = true;
@@ -542,7 +547,7 @@ static bool have_mouse_tracking_csi(event_queue_peeker_t *peeker) {
     // Maximum length of any CSI is NPAR (which is nominally 16), although this does not account for
     // user input intermixed with pseudo input generated by the tty emulator.
     // Check for the CSI first.
-    if (!peeker->next_is_char(L'\x1b') || !peeker->next_is_char(L'[', true /* timed */)) {
+    if (!peeker->next_is_char(L'\x1b') || !peeker->next_is_char(L'[', true /* escaped */)) {
         return false;
     }
 
@@ -593,8 +598,8 @@ static bool try_peek_sequence(event_queue_peeker_t *peeker, const wcstring &str)
     for (wchar_t c : str) {
         // If we just read an escape, we need to add a timeout for the next char,
         // to distinguish between the actual escape key and an "alt"-modifier.
-        bool timed = prev == L'\x1B';
-        if (!peeker->next_is_char(c, timed)) {
+        bool escaped = prev == L'\x1B';
+        if (!peeker->next_is_char(c, escaped)) {
             return false;
         }
         prev = c;
diff --git a/src/input_common.cpp b/src/input_common.cpp
index d2e6e78c0..daa1e7c2a 100644
--- a/src/input_common.cpp
+++ b/src/input_common.cpp
@@ -34,6 +34,9 @@
 #define WAIT_ON_ESCAPE_DEFAULT 30
 static int wait_on_escape_ms = WAIT_ON_ESCAPE_DEFAULT;
 
+#define WAIT_ON_SEQUENCE_KEY_INFINITE (-1)
+static int wait_on_sequence_key_ms = WAIT_ON_SEQUENCE_KEY_INFINITE;
+
 input_event_queue_t::input_event_queue_t(int in) : in_(in) {}
 
 /// Internal function used by readch to read one byte.
@@ -138,6 +141,26 @@ void update_wait_on_escape_ms(const environment_t& vars) {
     }
 }
 
+// Update the wait_on_sequence_key_ms value in response to the fish_sequence_key_delay_ms user variable being
+// set.
+void update_wait_on_sequence_key_ms(const environment_t& vars) {
+    auto sequence_key_time_ms = vars.get(L"fish_sequence_key_delay_ms");
+    if (sequence_key_time_ms.missing_or_empty()) {
+        wait_on_sequence_key_ms = WAIT_ON_SEQUENCE_KEY_INFINITE;
+        return;
+    }
+
+    long tmp = fish_wcstol(sequence_key_time_ms->as_string().c_str());
+    if (errno || tmp < 10 || tmp >= 5000) {
+        std::fwprintf(stderr,
+                      L"ignoring fish_sequence_key_delay_ms: value '%ls' "
+                      L"is not an integer or is < 10 or >= 5000 ms\n",
+                      sequence_key_time_ms->as_string().c_str());
+    } else {
+        wait_on_sequence_key_ms = static_cast<int>(tmp);
+    }
+}
+
 maybe_t<char_event_t> input_event_queue_t::try_pop() {
     if (queue_.empty()) {
         return none();
@@ -216,7 +239,18 @@ char_event_t input_event_queue_t::readch() {
     }
 }
 
-maybe_t<char_event_t> input_event_queue_t::readch_timed() {
+maybe_t<char_event_t> input_event_queue_t::readch_timed_esc() {
+    return readch_timed(wait_on_escape_ms);
+}
+
+maybe_t<char_event_t> input_event_queue_t::readch_timed_sequence_key() {
+    if (wait_on_sequence_key_ms == WAIT_ON_SEQUENCE_KEY_INFINITE) {
+        return readch();
+    }
+    return readch_timed(wait_on_sequence_key_ms);
+}
+
+maybe_t<char_event_t> input_event_queue_t::readch_timed(const int wait_time_ms) {
     if (auto evt = try_pop()) {
         return evt;
     }
@@ -229,7 +263,7 @@ maybe_t<char_event_t> input_event_queue_t::readch_timed() {
     // pselect expects timeouts in nanoseconds.
     const uint64_t nsec_per_msec = 1000 * 1000;
     const uint64_t nsec_per_sec = nsec_per_msec * 1000;
-    const uint64_t wait_nsec = wait_on_escape_ms * nsec_per_msec;
+    const uint64_t wait_nsec = wait_time_ms * nsec_per_msec;
     struct timespec timeout;
     timeout.tv_sec = (wait_nsec) / nsec_per_sec;
     timeout.tv_nsec = (wait_nsec) % nsec_per_sec;
diff --git a/src/input_common.h b/src/input_common.h
index bef8b1694..88c85cec8 100644
--- a/src/input_common.h
+++ b/src/input_common.h
@@ -188,6 +188,7 @@ class char_event_t {
 /// Adjust the escape timeout.
 class environment_t;
 void update_wait_on_escape_ms(const environment_t &vars);
+void update_wait_on_sequence_key_ms(const environment_t& vars);
 
 /// A class which knows how to produce a stream of input events.
 /// This is a base class; you may subclass it for its override points.
@@ -204,7 +205,10 @@ class input_event_queue_t {
     /// Like readch(), except it will wait at most WAIT_ON_ESCAPE milliseconds for a
     /// character to be available for reading.
     /// \return none on timeout, the event on success.
-    maybe_t<char_event_t> readch_timed();
+    maybe_t<char_event_t> readch_timed(const int wait_time_ms);
+
+    maybe_t<char_event_t> readch_timed_esc();
+    maybe_t<char_event_t> readch_timed_sequence_key();
 
     /// Enqueue a character or a readline function to the queue of unread characters that
     /// readch will return before actually reading from fd 0.

From 1b98566f3d260864fb4f4720c9bc6df040261391 Mon Sep 17 00:00:00 2001
From: Fabian Boehm <FHomborg@gmail.com>
Date: Wed, 13 Sep 2023 17:08:52 +0200
Subject: [PATCH 110/200] docs/set: Correct some errors

(cherry picked from commit ad54f073285e34e5eb63e3a02828aac5cae5be4a)
---
 doc_src/cmds/set.rst | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/doc_src/cmds/set.rst b/doc_src/cmds/set.rst
index 07dc21758..9650c39b1 100644
--- a/doc_src/cmds/set.rst
+++ b/doc_src/cmds/set.rst
@@ -25,7 +25,7 @@ If both *NAME* and *VALUE* are provided, ``set`` assigns any values to variable
 Variables in fish are :ref:`lists <variables-lists>`, multiple values are allowed.
 One or more variable *INDEX* can be specified including ranges (not for all options.)
 
-If no *VALUE* is given, the variable will be set to the empty list i.e. ``''``.
+If no *VALUE* is given, the variable will be set to the empty list.
 
 If ``set`` is ran without arguments, it prints the names and values of all shell variables in sorted order.
 Passing :ref:`scope <variables-scope>` or :ref:`export <variables-export>` flags allows filtering this to only matching variables, so ``set --local`` would only show local variables.
@@ -34,7 +34,7 @@ With ``--erase`` and optionally a scope flag ``set`` will erase the matching var
 
 With ``--show``, ``set`` will describe the given variable names, explaining how they have been defined - in which scope with which values and options.
 
-The following scope control variable scope:
+The following options control variable scope:
 
 **-U** or **--universal**
     Sets a universal variable.

From 71ef8d317afc17729126a7d964fad2aefa274e10 Mon Sep 17 00:00:00 2001
From: Fabian Boehm <FHomborg@gmail.com>
Date: Fri, 6 Oct 2023 22:15:35 +0200
Subject: [PATCH 111/200] fish_config: Fix `save` with variable with multiple
 values

Your basic quoting problem, regressed in 3.6.0

(cherry picked from commit 098b7093da27775c2e0d788d66fc249021ce0658)
---
 share/functions/fish_config.fish | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/share/functions/fish_config.fish b/share/functions/fish_config.fish
index 3989ec731..1923ae426 100644
--- a/share/functions/fish_config.fish
+++ b/share/functions/fish_config.fish
@@ -293,7 +293,7 @@ function fish_config --description "Launch fish's web based configuration"
                                 # Cache the value from whatever scope currently defines it
                                 set -l value $$color
                                 set -eg $color
-                                set -U $color "$value"
+                                set -U $color $value
                             end
                         end
                     end

From 6be5b02231c2c8afeed8197f6b82f01738b9b28c Mon Sep 17 00:00:00 2001
From: Fabian Boehm <FHomborg@gmail.com>
Date: Mon, 11 Sep 2023 16:52:38 +0200
Subject: [PATCH 112/200] Test for mktemp completion

Turns out fish isn't in $PATH on the CI systems

(cherry picked from commit 136dc6ce2868ec5733b8a814efeca8ce34090f0f)
---
 tests/checks/complete.fish | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/checks/complete.fish b/tests/checks/complete.fish
index 79ef35f4c..be13fb0d1 100644
--- a/tests/checks/complete.fish
+++ b/tests/checks/complete.fish
@@ -533,6 +533,6 @@ end
 
 rm -r $tmpdir
 
-complete -C'complete --command=fish' | head -n 1 | string replace -rf '\t.*' ''
+complete -C'complete --command=mktemp' | string replace -rf '=mktemp\t.*' '=mktemp'
 # (one "--command=" is okay, we used to get "--command=--command="
-# CHECK: --command=fish
+# CHECK: --command=mktemp

From 85c03e4b675ca6c0df8664e495b1167eeb39df8e Mon Sep 17 00:00:00 2001
From: Fabian Boehm <FHomborg@gmail.com>
Date: Sat, 14 Oct 2023 08:45:15 +0200
Subject: [PATCH 113/200] wildcard: Rationalize file/command completions
 (#10052)

* wildcard: Remove file size from the description

We no longer add descriptions for normal file completions, so this was
only ever reached if this was a command completion, and then it was
only added if the file wasn't a regular file... in which case it can't
be an executable.

So this was dead.

* Make possible_link() a maybe

This gives us the full information, not just "no" or "maybe"

* wildcard: Rationalize file/command completions

This keeps the entry_t as long as possible, and asks it, so especially
on systems with working d_type we can get by without a single stat in
most cases.

Then it guts file_get_desc, because that is only used for command
completions - we have been disabling file descriptions for *years*,
and so this is never called there.

That means we have no need to print descriptions about e.g. broken symlinks, because those are not executable.

Put together, what this means is that we, in most cases, only do
an *access(2)* call instead of a stat, because that might be checking
more permissions.

So we have the following constellations:

- If we have d_type:
  - We need a stat() for every _symlink_ to get the type (e.g. dir or regular)
    (this is for most symlinks, if we want to know if it's a dir or executable)
  - We need an access() for every file for executables
- If we do not have d_type:
  - We need a stat() for every file
  - We need an lstat() for every file if we do descriptions
    (i.e. just for command completion)
  - We need an access() for every file for executables

As opposed to the current way, where every file gets one lstat whether
with d_type or not, and an additional stat() for links, *and* an
access.

So we go from two syscalls to one for executables.

* Some more comments

* rust link option

* rust remove size

* rust accessovaganza

* Check for .dll first for WSL

This saves quite a few checks if e.g. System32 is in $PATH (which it
is if you inherit windows paths, IIRC).

Note: Our WSL check currently fails for WSL2, where this would
be *more* important because of how abysmal the filesystem performance
on that is.
---
 src/wildcard.cpp | 140 +++++++++++++++++------------------------------
 src/wutil.cpp    |   8 ++-
 src/wutil.h      |   4 +-
 3 files changed, 60 insertions(+), 92 deletions(-)

diff --git a/src/wildcard.cpp b/src/wildcard.cpp
index 7da596642..eb0bd44a5 100644
--- a/src/wildcard.cpp
+++ b/src/wildcard.cpp
@@ -327,58 +327,27 @@ wildcard_result_t wildcard_complete(const wcstring &str, const wchar_t *wc,
 
 /// Obtain a description string for the file specified by the filename.
 ///
+/// It assumes the file exists and won't run stat() to confirm.
 /// The returned value is a string constant and should not be free'd.
 ///
 /// \param filename The file for which to find a description string
-/// \param lstat_res The result of calling lstat on the file
-/// \param lbuf The struct buf output of calling lstat on the file
-/// \param stat_res The result of calling stat on the file
-/// \param buf The struct buf output of calling stat on the file
-/// \param err The errno value after a failed stat call on the file.
-static const wchar_t *file_get_desc(const wcstring &filename, int lstat_res,
-                                    const struct stat &lbuf, int stat_res, const struct stat &buf,
-                                    int err, bool definitely_executable) {
-    if (lstat_res) {
-        return COMPLETE_FILE_DESC;
-    }
-
-    if (S_ISLNK(lbuf.st_mode)) {
-        if (!stat_res) {
-            if (S_ISDIR(buf.st_mode)) {
-                return COMPLETE_DIRECTORY_SYMLINK_DESC;
-            }
-            if (definitely_executable || (buf.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH) && waccess(filename, X_OK) == 0)) {
-                // Weird group permissions and other such issues make it non-trivial to find out if
-                // we can actually execute a file using the result from stat. It is much safer to
-                // use the access function, since it tells us exactly what we want to know.
-                //
-                // We skip this check in case the caller tells us the file is definitely executable.
-                return COMPLETE_EXEC_LINK_DESC;
-            }
-
-            return COMPLETE_SYMLINK_DESC;
+/// \param is_dir Whether the file is a directory or not (might be behind a link)
+/// \param is_link Whether it's a link (that might point to a directory)
+/// \param definitely_executable Whether we know that it is executable, or don't know
+static const wchar_t *file_get_desc(const wcstring &filename, bool is_dir,
+                                    bool is_link, bool definitely_executable) {
+    if (is_link) {
+        if (is_dir) {
+            return COMPLETE_DIRECTORY_SYMLINK_DESC;
+        }
+        if (definitely_executable || waccess(filename, X_OK) == 0) {
+            return COMPLETE_EXEC_LINK_DESC;
         }
 
-        if (err == ENOENT) return COMPLETE_BROKEN_SYMLINK_DESC;
-        if (err == ELOOP) return COMPLETE_LOOP_SYMLINK_DESC;
-        // On unknown errors we do nothing. The file will be given the default 'File'
-        // description or one based on the suffix.
-    } else if (S_ISCHR(buf.st_mode)) {
-        return COMPLETE_CHAR_DESC;
-    } else if (S_ISBLK(buf.st_mode)) {
-        return COMPLETE_BLOCK_DESC;
-    } else if (S_ISFIFO(buf.st_mode)) {
-        return COMPLETE_FIFO_DESC;
-    } else if (S_ISSOCK(buf.st_mode)) {
-        return COMPLETE_SOCKET_DESC;
-    } else if (S_ISDIR(buf.st_mode)) {
+        return COMPLETE_SYMLINK_DESC;
+    } else if (is_dir) {
         return COMPLETE_DIRECTORY_DESC;
-    } else if (definitely_executable || (buf.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH) && waccess(filename, X_OK) == 0)) {
-        // Weird group permissions and other such issues make it non-trivial to find out if we can
-        // actually execute a file using the result from stat. It is much safer to use the access
-        // function, since it tells us exactly what we want to know.
-        //
-        // We skip this check in case the caller tells us the file is definitely executable.
+    } else if (definitely_executable || waccess(filename, X_OK) == 0) {
         return COMPLETE_EXEC_DESC;
     }
 
@@ -390,14 +359,14 @@ static const wchar_t *file_get_desc(const wcstring &filename, int lstat_res,
 /// up. Note that the filename came from a readdir() call, so we know it exists.
 static bool wildcard_test_flags_then_complete(const wcstring &filepath, const wcstring &filename,
                                               const wchar_t *wc, expand_flags_t expand_flags,
-                                              completion_receiver_t *out, bool known_dir) {
+                                              completion_receiver_t *out, const dir_iter_t::entry_t &entry) {
     const bool executables_only = expand_flags & expand_flag::executables_only;
     const bool need_directory = expand_flags & expand_flag::directories_only;
     // Fast path: If we need directories, and we already know it is one,
     // and we don't need to do anything else, just return it.
     // This is a common case for cd completions, and removes the `stat` entirely in case the system
     // supports it.
-    if (known_dir && !executables_only && !(expand_flags & expand_flag::gen_descriptions)) {
+    if (entry.is_dir() && !executables_only && !(expand_flags & expand_flag::gen_descriptions)) {
         return wildcard_complete(filename + L'/', wc, const_desc(L""), out, expand_flags,
                                  COMPLETE_NO_SPACE) == wildcard_result_t::match;
     }
@@ -406,34 +375,7 @@ static bool wildcard_test_flags_then_complete(const wcstring &filepath, const wc
         return false;
     }
 
-    struct stat lstat_buf = {}, stat_buf = {};
-    int stat_res = -1;
-    int stat_errno = 0;
-    int lstat_res = lwstat(filepath, &lstat_buf);
-    if (lstat_res >= 0) {
-        if (S_ISLNK(lstat_buf.st_mode)) {
-            stat_res = wstat(filepath, &stat_buf);
-
-            if (stat_res < 0) {
-                // In order to differentiate between e.g. broken symlinks and symlink loops, we also
-                // need to know the error status of wstat.
-                stat_errno = errno;
-            }
-        } else {
-            stat_buf = lstat_buf;
-            stat_res = lstat_res;
-        }
-    }
-
-    const long long file_size = stat_res == 0 ? stat_buf.st_size : 0;
-    const bool is_directory = stat_res == 0 && S_ISDIR(stat_buf.st_mode);
-    const bool is_executable = stat_res == 0 && S_ISREG(stat_buf.st_mode);
-
-    if (need_directory && !is_directory) {
-        return false;
-    }
-
-    if (executables_only && (!is_executable || waccess(filepath, X_OK) != 0)) {
+    if (need_directory && !entry.is_dir()) {
         return false;
     }
 
@@ -442,23 +384,44 @@ static bool wildcard_test_flags_then_complete(const wcstring &filepath, const wc
         return false;
     }
 
+    // regular file *excludes* broken links - we have no use for them as commands.
+    const bool is_regular_file = entry.check_type() == dir_entry_type_t::reg;
+    if (executables_only && (!is_regular_file || waccess(filepath, X_OK) != 0)) {
+        return false;
+    }
+
     // Compute the description.
+    // This is effectively only for command completions,
+    // because we disable descriptions for regular file completions.
     wcstring desc;
     if (expand_flags & expand_flag::gen_descriptions) {
+        bool is_link = false;
+
+        if (!entry.is_possible_link().has_value()) {
+            // We do not know it's a link from the d_type,
+            // so we will have to do an lstat().
+            struct stat lstat_buf = {};
+            int lstat_res = lwstat(filepath, &lstat_buf);
+            if (lstat_res < 0) {
+                // This file is no longer be usable, skip it.
+                return false;
+            }
+            if (S_ISLNK(lstat_buf.st_mode)) {
+                is_link = true;
+            }
+        } else {
+            is_link = entry.is_possible_link().value();
+        }
+
         // If we have executables_only, we already checked waccess above,
         // so we tell file_get_desc that this file is definitely executable so it can skip the check.
-        desc = file_get_desc(filepath, lstat_res, lstat_buf, stat_res, stat_buf, stat_errno, executables_only);
-
-        if (!is_directory && !is_executable && file_size >= 0) {
-            if (!desc.empty()) desc.append(L", ");
-            desc.append(format_size(file_size));
-        }
+        desc = file_get_desc(filepath, entry.is_dir(), is_link, executables_only);
     }
 
     // Append a / if this is a directory. Note this requirement may be the only reason we have to
     // call stat() in some cases.
     auto desc_func = const_desc(desc);
-    if (is_directory) {
+    if (entry.is_dir()) {
         return wildcard_complete(filename + L'/', wc, desc_func, out, expand_flags,
                                  COMPLETE_NO_SPACE) == wildcard_result_t::match;
     }
@@ -592,7 +555,7 @@ class wildcard_expander_t {
 
     void try_add_completion_result(const wcstring &filepath, const wcstring &filename,
                                    const wcstring &wildcard, const wcstring &prefix,
-                                   bool known_dir) {
+                                   const dir_iter_t::entry_t &entry) {
         // This function is only for the completions case.
         assert(this->flags & expand_flag::for_completions);
 
@@ -604,7 +567,7 @@ class wildcard_expander_t {
 
         size_t before = this->resolved_completions->size();
         if (wildcard_test_flags_then_complete(abs_path, filename, wildcard.c_str(), this->flags,
-                                              this->resolved_completions, known_dir)) {
+                                              this->resolved_completions, entry)) {
             // Hack. We added this completion result based on the last component of the wildcard.
             // Prepend our prefix to each wildcard that replaces its token.
             // Note that prepend_token_prefix is a no-op unless COMPLETE_REPLACES_TOKEN is set
@@ -708,7 +671,7 @@ void wildcard_expander_t::expand_trailing_slash(const wcstring &base_dir, const
                 if (need_dir && !known_dir) continue;
                 if (!entry->name.empty() && entry->name.at(0) != L'.') {
                     this->try_add_completion_result(base_dir + entry->name, entry->name, L"",
-                                                    prefix, known_dir);
+                                                    prefix, *entry);
                 }
             }
         }
@@ -740,7 +703,7 @@ void wildcard_expander_t::expand_intermediate_segment(const wcstring &base_dir,
         //
         // We only do this when we are the last `*/` component,
         // because we're a bit inconsistent on when we will enter loops.
-        if (is_final && !entry->is_possible_link()) {
+        if (is_final && !entry->is_possible_link().value_or(true)) {
             // We made it through.
             // Perform normal wildcard expansion on this new directory,
             // starting at our tail_wc
@@ -826,7 +789,6 @@ void wildcard_expander_t::expand_literal_intermediate_segment_with_fuzz(const wc
 
 void wildcard_expander_t::expand_last_segment(const wcstring &base_dir, dir_iter_t &base_dir_iter,
                                               const wcstring &wc, const wcstring &prefix) {
-    bool is_dir = false;
     bool need_dir = flags & expand_flag::directories_only;
 
     const dir_iter_t::entry_t *entry{};
@@ -834,7 +796,7 @@ void wildcard_expander_t::expand_last_segment(const wcstring &base_dir, dir_iter
         if (need_dir && !entry->is_dir()) continue;
         if (flags & expand_flag::for_completions) {
             this->try_add_completion_result(base_dir + entry->name, entry->name, wc, prefix,
-                                            is_dir);
+                                            *entry);
         } else {
             // Normal wildcard expansion, not for completions.
             if (wildcard_match(entry->name, wc, true /* skip files with leading dots */)) {
diff --git a/src/wutil.cpp b/src/wutil.cpp
index ef987f952..d1262a934 100644
--- a/src/wutil.cpp
+++ b/src/wutil.cpp
@@ -231,9 +231,15 @@ const dir_iter_t::entry_t *dir_iter_t::next() {
     // Do not store symlinks as type as we will need to resolve them.
     if (type != dir_entry_type_t::lnk) {
         entry_.type_ = type;
+    } else {
+        entry_.type_ = none();
     }
     // This entry could be a link if it is a link or unknown.
-    entry_.possible_link_ = !type.has_value() || type == dir_entry_type_t::lnk;
+    if (type.has_value()) {
+        entry_.possible_link_ = type == dir_entry_type_t::lnk;
+    } else {
+        entry_.possible_link_ = none();
+    }
 #endif
     return &entry_;
 }
diff --git a/src/wutil.h b/src/wutil.h
index 5ab2d4bdc..584499165 100644
--- a/src/wutil.h
+++ b/src/wutil.h
@@ -222,7 +222,7 @@ class dir_iter_t : noncopyable_t {
         bool is_dir() const { return check_type() == dir_entry_type_t::dir; }
 
         /// \return false if we know this can't be a link via d_type, true if it could be.
-        bool is_possible_link() const { return possible_link_; }
+        maybe_t<bool> is_possible_link() const { return possible_link_; }
 
         /// \return the stat buff for this entry, invoking stat() if necessary.
         const maybe_t<struct stat> &stat() const;
@@ -243,7 +243,7 @@ class dir_iter_t : noncopyable_t {
         mutable maybe_t<dir_entry_type_t> type_{};
 
         /// whether this entry could be a link, false if we know definitively it isn't.
-        bool possible_link_ = true;
+        mutable maybe_t<bool> possible_link_{};
 
         // fd of the DIR*, used for fstatat().
         int dirfd_{-1};

From e1c2a4e50ccbc2bcb2fba08e8b2aebe7864d9015 Mon Sep 17 00:00:00 2001
From: Eddie Lebow <elebow@users.noreply.github.com>
Date: Sun, 15 Jan 2023 00:41:19 -0500
Subject: [PATCH 114/200] Include subsequence matches in history-pager

If a `contains` search yields no results, try again with `contains_subsequence`.

(cherry picked from commit 00692bcdfeed150edaf145bfe64bec9b6c9ccce8)
---
 src/history.cpp      |  3 +++
 src/history.h        |  2 ++
 src/reader.cpp       | 12 +++++++++++-
 src/wcstringutil.cpp |  2 +-
 src/wcstringutil.h   |  3 +++
 5 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/src/history.cpp b/src/history.cpp
index 9ab51723c..6ce463b0e 100644
--- a/src/history.cpp
+++ b/src/history.cpp
@@ -195,6 +195,9 @@ bool history_item_t::matches_search(const wcstring &term, enum history_search_ty
             if (wcpattern2.back() != ANY_STRING) wcpattern2.push_back(ANY_STRING);
             return wildcard_match(content_to_match, wcpattern2);
         }
+        case history_search_type_t::contains_subsequence: {
+            return subsequence_in_string(term, content_to_match);
+        }
         case history_search_type_t::match_everything: {
             return true;
         }
diff --git a/src/history.h b/src/history.h
index 61fba0429..0f649486d 100644
--- a/src/history.h
+++ b/src/history.h
@@ -57,6 +57,8 @@ enum class history_search_type_t {
     contains_glob,
     /// Search for commands starting with the given glob pattern.
     prefix_glob,
+    /// Search for commands containing the given string as a subsequence
+    contains_subsequence,
     /// Matches everything.
     match_everything,
 };
diff --git a/src/reader.cpp b/src/reader.cpp
index 036d2096b..384eb3a88 100644
--- a/src/reader.cpp
+++ b/src/reader.cpp
@@ -1295,11 +1295,21 @@ static history_pager_result_t history_pager_search(const std::shared_ptr<history
     completion_list_t completions;
     history_search_t search{history, search_string, history_search_type_t::contains,
                             smartcase_flags(search_string), history_index};
-    while (completions.size() < page_size && search.go_to_next_match(direction)) {
+    bool next_match_found = search.go_to_next_match(direction);
+    if (!next_match_found) {
+        // If there were no matches, try again with subsequence search
+        search =
+            history_search_t{history, search_string, history_search_type_t::contains_subsequence,
+                             smartcase_flags(search_string), history_index};
+        next_match_found = search.go_to_next_match(direction);
+    }
+    while (completions.size() < page_size && next_match_found) {
         const history_item_t &item = search.current_item();
         completions.push_back(completion_t{
             item.str(), L"", string_fuzzy_match_t::exact_match(),
             COMPLETE_REPLACES_COMMANDLINE | COMPLETE_DONT_ESCAPE | COMPLETE_DONT_SORT});
+
+        next_match_found = search.go_to_next_match(direction);
     }
     size_t last_index = search.current_index();
     if (direction == history_search_direction_t::forward)
diff --git a/src/wcstringutil.cpp b/src/wcstringutil.cpp
index 5022fe7dc..23ebcf003 100644
--- a/src/wcstringutil.cpp
+++ b/src/wcstringutil.cpp
@@ -119,7 +119,7 @@ bool string_suffixes_string_case_insensitive(const wcstring &proposed_suffix,
 
 /// Returns true if needle, represented as a subsequence, is contained within haystack.
 /// Note subsequence is not substring: "foo" is a subsequence of "follow" for example.
-static bool subsequence_in_string(const wcstring &needle, const wcstring &haystack) {
+bool subsequence_in_string(const wcstring &needle, const wcstring &haystack) {
     // Impossible if needle is larger than haystack.
     if (needle.size() > haystack.size()) {
         return false;
diff --git a/src/wcstringutil.h b/src/wcstringutil.h
index 566b3f931..1ede27fba 100644
--- a/src/wcstringutil.h
+++ b/src/wcstringutil.h
@@ -34,6 +34,9 @@ bool string_suffixes_string_case_insensitive(const wcstring &proposed_suffix,
 bool string_prefixes_string_case_insensitive(const wcstring &proposed_prefix,
                                              const wcstring &value);
 
+/// Test if a string matches a subsequence of another.
+bool subsequence_in_string(const wcstring &needle, const wcstring &haystack);
+
 /// Case-insensitive string search, modeled after std::string::find().
 /// \param fuzzy indicates this is being used for fuzzy matching and case insensitivity is
 /// expanded to include symbolic characters (#3584).

From 64bff1a51c66312a2fc48360f9175b829c489814 Mon Sep 17 00:00:00 2001
From: Johannes Altmanninger <aclopte@gmail.com>
Date: Tue, 10 Jan 2023 01:25:06 +0100
Subject: [PATCH 115/200] history pager: delete selected history entry with
 Shift-Delete

After accidentally running a command that includes a pasted password, I want
to delete command from history. Today we need to recall or type (part of)
that command and type "history delete".  Let's maybe add a shortcut to do
this from the history pager.

The current shortcut is Shift+Delete. I don't think that's very discoverable,
maybe we should use Delete instead (but only if the cursor is at the end of
the commandline, otherwise delete a char).

Closes #9454

(cherry picked from commit 052823c1202faf840c6d86644a21f0ad8c5b074c)
---
 doc_src/cmds/bind.rst                         |  3 +
 .../functions/__fish_shared_key_bindings.fish |  1 +
 .../functions/fish_default_key_bindings.fish  |  1 -
 share/functions/fish_vi_key_bindings.fish     |  2 -
 src/input.cpp                                 |  1 +
 src/input_common.h                            |  1 +
 src/pager.cpp                                 |  9 +++
 src/pager.h                                   |  3 +
 src/reader.cpp                                | 78 +++++++++++++++----
 9 files changed, 79 insertions(+), 20 deletions(-)

diff --git a/doc_src/cmds/bind.rst b/doc_src/cmds/bind.rst
index 451fa3d00..b0ad70fa0 100644
--- a/doc_src/cmds/bind.rst
+++ b/doc_src/cmds/bind.rst
@@ -202,6 +202,9 @@ The following special input functions are available:
 ``history-pager``
     invoke the searchable pager on history (incremental search); or if the history pager is already active, search further backwards in time.
 
+``history-pager-delete``
+    permanently delete the history item selected in the history pager
+
 ``history-search-backward``
     search the history for the previous match
 
diff --git a/share/functions/__fish_shared_key_bindings.fish b/share/functions/__fish_shared_key_bindings.fish
index ccaacb3f8..d6e37c576 100644
--- a/share/functions/__fish_shared_key_bindings.fish
+++ b/share/functions/__fish_shared_key_bindings.fish
@@ -38,6 +38,7 @@ function __fish_shared_key_bindings -d "Bindings shared between emacs and vi mod
     bind --preset $argv \cs pager-toggle-search
     # shift-tab does a tab complete followed by a search.
     bind --preset $argv --key btab complete-and-search
+    bind --preset $argv -k sdc history-pager-delete or backward-delete-char # shifted delete
 
     bind --preset $argv \e\n "commandline -f expand-abbr; commandline -i \n"
     bind --preset $argv \e\r "commandline -f expand-abbr; commandline -i \n"
diff --git a/share/functions/fish_default_key_bindings.fish b/share/functions/fish_default_key_bindings.fish
index 4875700f0..2a4836d3e 100644
--- a/share/functions/fish_default_key_bindings.fish
+++ b/share/functions/fish_default_key_bindings.fish
@@ -51,7 +51,6 @@ function fish_default_key_bindings -d "emacs-like key binds"
 
     bind --preset $argv -k home beginning-of-line
     bind --preset $argv -k end end-of-line
-    bind --preset $argv -k sdc backward-delete-char # shifted delete
 
     bind --preset $argv \ca beginning-of-line
     bind --preset $argv \ce end-of-line
diff --git a/share/functions/fish_vi_key_bindings.fish b/share/functions/fish_vi_key_bindings.fish
index 9fc512238..998d30a66 100644
--- a/share/functions/fish_vi_key_bindings.fish
+++ b/share/functions/fish_vi_key_bindings.fish
@@ -125,8 +125,6 @@ function fish_vi_key_bindings --description 'vi-like key bindings for fish'
     bind -s --preset -M default \ch backward-char
     bind -s --preset -M insert \x7f backward-delete-char
     bind -s --preset -M default \x7f backward-char
-    bind -s --preset -M insert -k sdc backward-delete-char # shifted delete
-    bind -s --preset -M default -k sdc backward-delete-char # shifted delete
 
     bind -s --preset dd kill-whole-line
     bind -s --preset D kill-line
diff --git a/src/input.cpp b/src/input.cpp
index 4831953ff..cd4a858b3 100644
--- a/src/input.cpp
+++ b/src/input.cpp
@@ -129,6 +129,7 @@ static constexpr const input_function_metadata_t input_function_metadata[] = {
     {L"forward-single-char", readline_cmd_t::forward_single_char},
     {L"forward-word", readline_cmd_t::forward_word},
     {L"history-pager", readline_cmd_t::history_pager},
+    {L"history-pager-delete", readline_cmd_t::history_pager_delete},
     {L"history-prefix-search-backward", readline_cmd_t::history_prefix_search_backward},
     {L"history-prefix-search-forward", readline_cmd_t::history_prefix_search_forward},
     {L"history-search-backward", readline_cmd_t::history_search_backward},
diff --git a/src/input_common.h b/src/input_common.h
index 88c85cec8..2cf8490cf 100644
--- a/src/input_common.h
+++ b/src/input_common.h
@@ -29,6 +29,7 @@ enum class readline_cmd_t {
     history_prefix_search_backward,
     history_prefix_search_forward,
     history_pager,
+    history_pager_delete,
     delete_char,
     backward_delete_char,
     kill_line,
diff --git a/src/pager.cpp b/src/pager.cpp
index 3dae7b358..6aafe7d77 100644
--- a/src/pager.cpp
+++ b/src/pager.cpp
@@ -883,6 +883,15 @@ const completion_t *pager_t::selected_completion(const page_rendering_t &renderi
     return result;
 }
 
+size_t pager_t::selected_completion_index() const { return selected_completion_idx; }
+
+void pager_t::set_selected_completion_index(size_t new_index) {
+    // Current users are off by one at most.
+    assert(new_index == PAGER_SELECTION_NONE || new_index <= completion_infos.size());
+    if (new_index == completion_infos.size()) --new_index;
+    selected_completion_idx = new_index;
+}
+
 /// Get the selected row and column. Completions are rendered column first, i.e. we go south before
 /// we go west. So if we have N rows, and our selected index is N + 2, then our row is 2 (mod by N)
 /// and our column is 1 (divide by N).
diff --git a/src/pager.h b/src/pager.h
index ff74d055b..1ca1b2222 100644
--- a/src/pager.h
+++ b/src/pager.h
@@ -165,6 +165,9 @@ class pager_t {
     // Returns the currently selected completion for the given rendering.
     const completion_t *selected_completion(const page_rendering_t &rendering) const;
 
+    size_t selected_completion_index() const;
+    void set_selected_completion_index(size_t new_index);
+
     // Indicates the row and column for the given rendering. Returns -1 if no selection.
     size_t get_selected_row(const page_rendering_t &rendering) const;
     size_t get_selected_column(const page_rendering_t &rendering) const;
diff --git a/src/reader.cpp b/src/reader.cpp
index 384eb3a88..5d55da193 100644
--- a/src/reader.cpp
+++ b/src/reader.cpp
@@ -726,6 +726,8 @@ class reader_data_t : public std::enable_shared_from_this<reader_data_t> {
     reader_history_search_t history_search{};
     /// Whether the in-pager history search is active.
     bool history_pager_active{false};
+    /// The direction of the last successful history pager search.
+    history_search_direction_t history_pager_direction{};
     /// The range in history covered by the history pager's current page.
     size_t history_pager_history_index_start{static_cast<size_t>(-1)};
     size_t history_pager_history_index_end{static_cast<size_t>(-1)};
@@ -789,8 +791,14 @@ class reader_data_t : public std::enable_shared_from_this<reader_data_t> {
     /// Do what we need to do whenever our command line changes.
     void command_line_changed(const editable_line_t *el);
     void maybe_refilter_pager(const editable_line_t *el);
-    void fill_history_pager(bool new_search, history_search_direction_t direction =
-                                                 history_search_direction_t::backward);
+    enum class history_pager_invocation_t {
+        anew,
+        advance,
+        refresh,
+    };
+    void fill_history_pager(
+        history_pager_invocation_t why,
+        history_search_direction_t direction = history_search_direction_t::backward);
 
     /// Do what we need to do whenever our pager selection changes.
     void pager_selection_changed();
@@ -1264,7 +1272,8 @@ void reader_data_t::command_line_changed(const editable_line_t *el) {
         s_generation.store(1 + read_generation_count(), std::memory_order_relaxed);
     } else if (el == &this->pager.search_field_line) {
         if (history_pager_active) {
-            fill_history_pager(true, history_search_direction_t::backward);
+            fill_history_pager(history_pager_invocation_t::anew,
+                               history_search_direction_t::backward);
             return;
         }
         this->pager.refilter_completions();
@@ -1317,16 +1326,29 @@ static history_pager_result_t history_pager_search(const std::shared_ptr<history
     return {completions, last_index, search.go_to_next_match(direction)};
 }
 
-void reader_data_t::fill_history_pager(bool new_search, history_search_direction_t direction) {
-    assert(!new_search || direction == history_search_direction_t::backward);
-    size_t index;
-    if (new_search) {
-        index = 0;
-    } else if (direction == history_search_direction_t::forward) {
-        index = history_pager_history_index_start;
-    } else {
-        assert(direction == history_search_direction_t::backward);
-        index = history_pager_history_index_end;
+void reader_data_t::fill_history_pager(history_pager_invocation_t why,
+                                       history_search_direction_t direction) {
+    size_t index = -1;
+    maybe_t<size_t> old_pager_index;
+    switch (why) {
+        case history_pager_invocation_t::anew:
+            assert(direction == history_search_direction_t::backward);
+            index = 0;
+            break;
+        case history_pager_invocation_t::advance:
+            if (direction == history_search_direction_t::forward) {
+                index = history_pager_history_index_start;
+            } else {
+                assert(direction == history_search_direction_t::backward);
+                index = history_pager_history_index_end;
+            }
+            break;
+        case history_pager_invocation_t::refresh:
+            // Redo the previous search previous direction.
+            direction = history_pager_direction;
+            index = history_pager_history_index_start;
+            old_pager_index = pager.selected_completion_index();
+            break;
     }
     const wcstring &search_term = pager.search_field_line.text();
     auto shared_this = this->shared_from_this();
@@ -1335,11 +1357,12 @@ void reader_data_t::fill_history_pager(bool new_search, history_search_direction
         [=](const history_pager_result_t &result) {
             if (search_term != shared_this->pager.search_field_line.text())
                 return;  // Stale request.
-            if (result.matched_commands.empty() && !new_search) {
+            if (result.matched_commands.empty() && why == history_pager_invocation_t::advance) {
                 // No more matches, keep the existing ones and flash.
                 shared_this->flash();
                 return;
             }
+            history_pager_direction = direction;
             if (direction == history_search_direction_t::forward) {
                 shared_this->history_pager_history_index_start = result.final_index;
                 shared_this->history_pager_history_index_end = index;
@@ -1350,7 +1373,12 @@ void reader_data_t::fill_history_pager(bool new_search, history_search_direction
             shared_this->pager.extra_progress_text =
                 result.have_more_results ? _(L"Search again for more results") : L"";
             shared_this->pager.set_completions(result.matched_commands);
-            shared_this->select_completion_in_direction(selection_motion_t::next, true);
+            if (why == history_pager_invocation_t::refresh) {
+                pager.set_selected_completion_index(*old_pager_index);
+                pager_selection_changed();
+            } else {
+                shared_this->select_completion_in_direction(selection_motion_t::next, true);
+            }
             shared_this->super_highlight_me_plenty();
             shared_this->layout_and_repaint(L"history-pager");
         });
@@ -3540,7 +3568,8 @@ void reader_data_t::handle_readline_command(readline_cmd_t c, readline_loop_stat
         }
         case rl::pager_toggle_search: {
             if (history_pager_active) {
-                fill_history_pager(false, history_search_direction_t::forward);
+                fill_history_pager(history_pager_invocation_t::advance,
+                                   history_search_direction_t::forward);
                 break;
             }
             if (!pager.empty()) {
@@ -3754,7 +3783,8 @@ void reader_data_t::handle_readline_command(readline_cmd_t c, readline_loop_stat
         }
         case rl::history_pager: {
             if (history_pager_active) {
-                fill_history_pager(false, history_search_direction_t::backward);
+                fill_history_pager(history_pager_invocation_t::advance,
+                                   history_search_direction_t::backward);
                 break;
             }
 
@@ -3778,6 +3808,20 @@ void reader_data_t::handle_readline_command(readline_cmd_t c, readline_loop_stat
             }
             break;
         }
+        case rl::history_pager_delete: {
+            if (!history_pager_active) {
+                inputter.function_set_status(false);
+                break;
+            }
+            inputter.function_set_status(true);
+            if (auto completion = pager.selected_completion(current_page_rendering)) {
+                history->remove(completion->completion);
+                history->save();
+                fill_history_pager(history_pager_invocation_t::refresh,
+                                   history_search_direction_t::backward);
+            }
+            break;
+        }
         case rl::backward_char: {
             editable_line_t *el = active_edit_line();
             if (is_navigating_pager_contents()) {

From 211a3ceee1821610577c5958225656d8161bde05 Mon Sep 17 00:00:00 2001
From: Johannes Altmanninger <aclopte@gmail.com>
Date: Tue, 8 Aug 2023 21:53:42 +0200
Subject: [PATCH 116/200] Copy history pager search field to command line on
 Enter if no match

Closes #9934

(cherry picked from commit b7f7dcf7881a24d57dd65e335f261e31bec7b795)
---
 src/reader.cpp                        | 7 +++++++
 tests/checks/tmux-history-search.fish | 7 +++++++
 2 files changed, 14 insertions(+)

diff --git a/src/reader.cpp b/src/reader.cpp
index 5d55da193..3880b6998 100644
--- a/src/reader.cpp
+++ b/src/reader.cpp
@@ -4389,6 +4389,13 @@ bool reader_data_t::handle_execute(readline_loop_state_t &rls) {
     // using a backslash, insert a newline.
     // If the user hits return while navigating the pager, it only clears the pager.
     if (is_navigating_pager_contents()) {
+        if (this->history_pager_active &&
+            this->pager.selected_completion_index() == PAGER_SELECTION_NONE) {
+            command_line.push_edit(
+                edit_t{0, command_line.size(), this->pager.search_field_line.text()},
+                /* allow_coalesce */ false);
+            command_line.set_position(this->pager.search_field_line.position());
+        }
         clear_pager();
         return true;
     }
diff --git a/tests/checks/tmux-history-search.fish b/tests/checks/tmux-history-search.fish
index 92bab0b80..7b2425400 100644
--- a/tests/checks/tmux-history-search.fish
+++ b/tests/checks/tmux-history-search.fish
@@ -27,3 +27,10 @@ isolated-tmux send-keys C-z _
 tmux-sleep
 isolated-tmux capture-pane -p | grep 'prompt 2'
 # CHECK: prompt 2> _
+
+# When history pager fails to find a result, copy the search field to the command line.
+isolated-tmux send-keys C-e C-u C-r "echo no such command in history"
+tmux-sleep
+isolated-tmux send-keys Enter
+# CHECK: prompt 2> echo no such command in history
+isolated-tmux capture-pane -p | grep 'prompt 2'

From c883d731454d08d2875c81b6aa6e0f02b00fb4bc Mon Sep 17 00:00:00 2001
From: Fabian Boehm <FHomborg@gmail.com>
Date: Tue, 17 Oct 2023 17:35:58 +0200
Subject: [PATCH 117/200] Work on 3.7.0 CHANGELOG

---
 CHANGELOG.rst | 81 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 81 insertions(+)

diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index d78fe3850..8dd039545 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -1,3 +1,84 @@
+fish 3.7.0 (released ???)
+====================================
+
+This release of fish contains a number of fixes for problems identified in fish 3.6.1, as well as some enhancements.
+
+Notable improvements and fixes
+------------------------------
+
+Deprecations and removed features
+---------------------------------
+- 
+
+Scripting improvements
+----------------------
+- Running ``exit`` with a negative number no longer crashes fish by hitting an assert() (:issue:`9659`).
+- ``fish -c`` will now return a non-zero status if parsing failed (:issue:`9888`).
+- Globbing will now use fewer system calls in some cases, especially with a trailing slash (``/path/a*/``), and for searching for commands.
+  Some of this requires filesystem support - the d_type field in the dirent struct returned by readdir(3).
+  This improves performance for command completions and globbing, especially on slow filesystems like NFS (:issue:`9891`, :issue:`9931`, :issue:`10032`, :issue:`10052`).
+- The ``jobs`` builtin will now escape the commands it prints (:issue:`9875`, :issue:`9808`).
+- ``string repeat`` no longer overflows if the count is a multiple of the chunk size (:issue:`9900`).
+- The ``builtin`` builtin will now properly error out with invalid arguments instead of doing nothing and returning true (:issue:`9942`).
+- ``command time`` in a pipeline is allowed again, as is ``command and`` and ``command or`` (:issue:`9985`).
+- ``exec`` will now also apply variable overrides, so ``FOO=bar exec`` will now set $FOO correctly (:issue:`9995`).
+
+Interactive improvements
+------------------------
+- The :kbd:`Alt`\ +\ :kbd:`s` binding now also checks ``please`` in addition to ``sudo`` and ``doas``
+- The history pager will now also attempt subsequence matches (:issue:`9476`), so you can find a commandline like ``git log 3.6.1..Integration_3.7.0`` by searching for ``gitInt``.
+- Closing the history pager with enter will now copy the search text to the commandline if there was no match, so you can continue editing the command you tried to find right away (:issue:`9934`).
+- Opening the history pager will now fill the search field with a search string if you're already in a search (:issue:`10005`). This makes it nicer to search something with up-arrow and then later decide to switch to the full pager.
+- ``read`` no longer enables bracketed paste so it doesn't stay enabled in combined commandlines like ``mysql -p(read --silent)`` (:issue:`8285`).
+- Vi-mode now uses :envvar:`fish_cursor_external` to set the cursor shape for external commands (:issue:`4656`, :issue:`9565`).
+- Vi-mode cursor shaping is now enabled in iterm2 (:issue:`9698`).
+- Completing commands as root now finds commands not owned by root again (:issue:`9699`).
+- Selection now uses fish_color_selection for the foreground as well (:issue:`9717`).
+- The completion pager will no longer sometimes skip the last entry when moving through a long list (:issue:`9812`, :issue:`9833`).
+- The interactive ``history delete`` now allows specifying index ranges like "1..5" (:issue:`9736`).
+- Command completion will now call the stock manpath on macOS instead of a potential homebrew version. This prevents awkward error messages (:issue:`9817`).
+- A new bind function ``history-pager-delete`` will delete the current history pager item from history (:issue:`9454`, :issue:`9515`).
+- ``fish_key_reader`` will now use printable characters as-is, so pressing "ö" no longer leads to it telling you to bind ``\u00F6`` (:issue:`9986`).
+- Fish can now wait for a timeout for a key sequence to complete instead of waiting indefinitely. This makes e.g. binding ``kj`` to switching modes in vi-mode possible.
+  The timeout can be set via the new :envvar:`fish_sequence_key_delay_ms` (:issue:`7401`, :issue:`9926`), and may be set by default in future versions.
+- ``open`` no longer works around an xdg-open bug that was finally fixed and can be used to launch terminal programs again (:issue:`10045`).
+- The ``repaint-mode`` binding will now only move the cursor if there is repainting to be done. This fixes alt+something bindings in vi-mode (:issue:`7910`).
+- A new ``clear-screen`` bind function is used for :kbd:`Alt`\ +\ :kbd:`l` by default. This clears the screen and repaints the existing prompt at first,
+  so it eliminates visible flicker unless the terminal is very slow (:issue:`10044`).
+
+Improved prompts
+^^^^^^^^^^^^^^^^
+- The default theme now only uses named colors, so it will track the terminal's palette (:issue:`9913`).
+- The Dracula theme has now been synced with upstream (:issue:`9807`).
+- ``fish_vcs_prompt`` now also supports fossil (:issue:`9497`, :issue:`9500`, :issue:`9528`).
+
+Completions
+^^^^^^^^^^^
+- Added completions for:
+  - ``apkanalyzer`` (:issue:`9558`)
+  - ``neovim`` (:issue:`9543`)
+  - ``otool``
+  - ``pre-commit`` (:issue:`9521`)
+  - ``proxychains`` (:issue:`9486`)
+  - ``scrypt`` (:issue:`9583`)
+  - ``stow`` (:issue:`9571`)
+  - ``trash`` and helper utilities ``trash-empty``, ``trash-list``, ``trash-put``, ``trash-restore`` (:issue:`9560`)
+  - ``ssh-copy-id`` (:issue:`9675`)
+- The ``zfs`` completions no longer print errors about setting a read-only variable (:issue:`9705`).
+- The ``kitty`` completions have been removed in favor of keeping them upstream (:issue:`9750`).
+- Improvements to many completions.
+- The manpage completion generator will no longer sometimes parse a manpage of the same name in two different directories (:issue:`9787`).
+- The manpage completion generator won't cause up-to-date python versions to spew SyntaxWarnings about invalid backslash sequences anymore (:issue:`9814`)
+- The manpage completion generator will replace a few more roff escapes (:issue:`9961`).
+
+Other improvements
+------------------
+- Improvements and corrections to the documentation.
+
+For distributors
+----------------
+- Fish will now also look for libterminfo, which is what NetBSD curses calls libtinfo (:issue:`9794`).
+
 fish 3.6.1 (released March 25, 2022)
 ====================================
 

From 572374333d4032b9c1989a2d2992b2af040de2bb Mon Sep 17 00:00:00 2001
From: Fabian Boehm <FHomborg@gmail.com>
Date: Tue, 24 Oct 2023 18:24:51 +0200
Subject: [PATCH 118/200] docs: More on key timeout, key chord limitations

(cherry picked from commit 496fc03b9880891ea3da4989cee50cf7381e707c)
---
 doc_src/cmds/bind.rst   |  3 +++
 doc_src/interactive.rst | 21 +++++++++++++++++++--
 doc_src/language.rst    |  4 ++++
 3 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/doc_src/cmds/bind.rst b/doc_src/cmds/bind.rst
index b0ad70fa0..6c0181cbf 100644
--- a/doc_src/cmds/bind.rst
+++ b/doc_src/cmds/bind.rst
@@ -380,3 +380,6 @@ The escape key can be used standalone, for example, to switch from insertion mod
 Holding alt and something else also typically sends escape, for example holding alt+a will send an escape character and then an "a".
 
 fish waits for a period after receiving the escape character, to determine whether it is standalone or part of an escape sequence. While waiting, additional key presses make the escape key behave as a meta key. If no other key presses come in, it is handled as a standalone escape. The waiting period is set to 30 milliseconds (0.03 seconds). It can be configured by setting the ``fish_escape_delay_ms`` variable to a value between 10 and 5000 ms. This can be a universal variable that you set once from an interactive session.
+So the escape character has its own timeout configured with :envvar:`fish_escape_delay_ms`.
+
+See also :ref:`Key sequences`.
diff --git a/doc_src/interactive.rst b/doc_src/interactive.rst
index 2adea7925..bab02a0a2 100644
--- a/doc_src/interactive.rst
+++ b/doc_src/interactive.rst
@@ -537,6 +537,12 @@ If you change your mind on a binding and want to go back to fish's default, you
 
 Fish remembers its preset bindings and so it will take effect again. This saves you from having to remember what it was before and add it again yourself.
 
+If you use :ref:`vi bindings <vi-mode>`, note that ``bind`` will by default bind keys in :ref:`command mode <vi-mode-command>`. To bind something in :ref:`insert mode <vi-mode-insert>`::
+
+  bind --mode insert \cc 'commandline -r ""'
+
+.. _interactive-key-sequences:
+
 Key sequences
 """""""""""""
 
@@ -553,14 +559,25 @@ In these cases, :doc:`fish_key_reader <cmds/fish_key_reader>` can tell you how t
   Press a key:
   bind \e\[C 'do something'
 
-Note that some key combinations are indistinguishable or unbindable. For instance control-i *is the same* as the tab key. This is a terminal limitation that fish can't do anything about.
+Note that some key combinations are indistinguishable or unbindable. For instance control-i *is the same* as the tab key. This is a terminal limitation that fish can't do anything about. When ``fish_key_reader`` prints the same sequence for two different keys, then that is because your terminal sends the same sequence for them.
 
-Also, :kbd:`Escape` is the same thing as :kbd:`Alt` in a terminal. To distinguish between pressing :kbd:`Escape` and then another key, and pressing :kbd:`Alt` and that key (or an escape sequence the key sends), fish waits for a certain time after seeing an escape character. This is configurable via the ``fish_escape_delay_ms`` variable.
+Also, :kbd:`Escape` is the same thing as :kbd:`Alt` in a terminal. To distinguish between pressing :kbd:`Escape` and then another key, and pressing :kbd:`Alt` and that key (or an escape sequence the key sends), fish waits for a certain time after seeing an escape character. This is configurable via the :envvar:`fish_escape_delay_ms` variable.
 
 If you want to be able to press :kbd:`Escape` and then a character and have it count as :kbd:`Alt`\ +\ that character, set it to a higher value, e.g.::
 
   set -g fish_escape_delay_ms 100
 
+Similarly, to disambiguate *other* keypresses where you've bound a subsequence and a longer sequence, fish has :envvar:`fish_sequence_key_delay_ms`::
+
+  # This binds "jk" to switch to normal mode in vi-mode.
+  # If you kept it like that, every time you press "j",
+  # fish would wait for a "k" or other key to disambiguate
+  bind -M insert -m default jk cancel repaint-mode
+
+  # After setting this, fish only waits 200ms for the "k",
+  # or decides to treat the "j" as a separate sequence, inserting it.
+  set -g fish_sequence_key_delay_ms 200
+
 .. _killring:
 
 Copy and paste (Kill Ring)
diff --git a/doc_src/language.rst b/doc_src/language.rst
index d1b148a0b..164618f7c 100644
--- a/doc_src/language.rst
+++ b/doc_src/language.rst
@@ -1449,6 +1449,10 @@ You can change the settings of fish by changing the values of certain variables.
 
    sets how long fish waits for another key after seeing an escape, to distinguish pressing the escape key from the start of an escape sequence. The default is 30ms. Increasing it increases the latency but allows pressing escape instead of alt for alt+character bindings. For more information, see :ref:`the chapter in the bind documentation <cmd-bind-escape>`.
 
+.. envvar:: fish_sequence_key_delay_ms
+
+   sets how long fish waits for another key after seeing a key that is part of a longer sequence, to disambiguate. For instance if you had bound ``\cx\ce`` to open an editor, fish would wait for this long in milliseconds to see a ctrl-e after a ctrl-x. If the time elapses, it will handle it as a ctrl-x (by default this would copy the current commandline to the clipboard). See also :ref:`Key sequences <interactive-key-sequences>`.
+
 .. envvar:: fish_complete_path
 
    determines where fish looks for completion. When trying to complete for a command, fish looks for files in the directories in this variable.

From be75769564bd31e3b7ec9605d92a101b113e9277 Mon Sep 17 00:00:00 2001
From: Asuka Minato <i@asukaminato.eu.org>
Date: Fri, 27 Oct 2023 08:44:13 +0900
Subject: [PATCH 119/200] Update find.fish

add -D and -nowarn

(cherry picked from commit 754e81afa3b7201a247f6b8f2e319938ccdf9e46)
---
 share/completions/find.fish | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/share/completions/find.fish b/share/completions/find.fish
index 77bdbabaa..572911628 100644
--- a/share/completions/find.fish
+++ b/share/completions/find.fish
@@ -22,7 +22,11 @@ complete -c find -o regextype -d "Specify regular expression type" -a "emacs pos
 complete -c find -o version -l version -d "Display version and exit"
 complete -c find -o warn -d "Turn warnings on"
 complete -c find -o nowarn -d "Turn warnings off"
-
+complete -c find -o O0 -d "Equivalent to optimisation level 1."
+complete -c find -o O1 -d "Default optimisation level and corresponds to the traditional behaviour."
+complete -c find -o O2 -d "Any -type or -xtype tests are performed after any tests based only on the names of files."
+complete -c find -o O3 -d "The full cost-based query optimiser is enabled."
+complete -c find -s D -d "Print diagnostic information." -x -a "exec opt rates search stat time tree all help"
 
 # Tests
 

From 3444e1cbf34db97806f359183bc3b80f68ae452e Mon Sep 17 00:00:00 2001
From: Wadii Hajji <wadii@cardiologs.com>
Date: Sun, 5 Nov 2023 12:20:02 +0100
Subject: [PATCH 120/200] fix(git): add `force-if-includes` completion

(cherry picked from commit 3f7fdd569343f90d974823973e163144b9b83fe0)
---
 share/completions/git.fish | 1 +
 1 file changed, 1 insertion(+)

diff --git a/share/completions/git.fish b/share/completions/git.fish
index 0a66248eb..04b97cad6 100644
--- a/share/completions/git.fish
+++ b/share/completions/git.fish
@@ -1875,6 +1875,7 @@ complete -f -c git -n '__fish_git_using_command push' -s n -l dry-run -d 'Do eve
 complete -f -c git -n '__fish_git_using_command push' -l porcelain -d 'Produce machine-readable output'
 complete -f -c git -n '__fish_git_using_command push' -s f -l force -d 'Force update of remote refs'
 complete -f -c git -n '__fish_git_using_command push' -l force-with-lease -d 'Force update of remote refs, stopping if other\'s changes would be overwritten'
+complete -f -c git -n '__fish_git_using_command push' -l force-if-includes -d 'Force an update only if the tip of the remote-tracking ref has been integrated locally'
 complete -f -c git -n '__fish_git_using_command push' -s u -l set-upstream -d 'Add upstream (tracking) reference'
 complete -f -c git -n '__fish_git_using_command push' -s q -l quiet -d 'Be quiet'
 complete -f -c git -n '__fish_git_using_command push' -s v -l verbose -d 'Be verbose'

From 66401f8575f18873b156f6991de144eb11ef2441 Mon Sep 17 00:00:00 2001
From: Nicholas Rodrigues Lordello <nick@safe.global>
Date: Thu, 2 Nov 2023 12:50:02 +0100
Subject: [PATCH 121/200] `ls` No Longer Sets `LS_COLORS`

(cherry picked from commit 5cf36bf3f803afc69182211e04e3769fc5c0da69)
---
 CHANGELOG.rst           |  2 ++
 share/functions/ls.fish | 26 ++------------------------
 2 files changed, 4 insertions(+), 24 deletions(-)

diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index 8dd039545..12076fd63 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -5,6 +5,8 @@ This release of fish contains a number of fixes for problems identified in fish
 
 Notable improvements and fixes
 ------------------------------
+- ``LS_COLORS`` is no longer set automatically by ``ls`` (:issue:`10080`). Users
+  that set ``.dircolors`` should manually import it using other means.
 
 Deprecations and removed features
 ---------------------------------
diff --git a/share/functions/ls.fish b/share/functions/ls.fish
index da05d9887..369dcb860 100644
--- a/share/functions/ls.fish
+++ b/share/functions/ls.fish
@@ -1,22 +1,3 @@
-function __fish_set_lscolors --description 'Set $LS_COLORS if possible'
-    if ! set -qx LS_COLORS && set -l cmd (command -s {g,}dircolors)[1]
-        set -l colorfile
-        for file in ~/.dir_colors ~/.dircolors /etc/DIR_COLORS
-            if test -f $file
-                set colorfile $file
-                break
-            end
-        end
-        # Here we rely on the legacy behavior of `dircolors -c` producing output
-        # suitable for csh in order to extract just the data we're interested in.
-        set -gx LS_COLORS ($cmd -c $colorfile | string split ' ')[3]
-        # The value should always be quoted but be conservative and check first.
-        if string match -qr '^([\'"]).*\1$' -- $LS_COLORS
-            set LS_COLORS (string match -r '^.(.*).$' $LS_COLORS)[2]
-        end
-    end
-end
-
 function ls --description "List contents of directory"
     # Make ls use colors and show indicators if we are on a system that supports that feature and writing to stdout.
     #
@@ -34,10 +15,10 @@ function ls --description "List contents of directory"
         # Since that one's quite different, don't use it.
         if command -sq colorls
             and command colorls -GF >/dev/null 2>/dev/null
-            set -g __fish_ls_color_opt -GF
+            set -g __fish_ls_color_opt -G
             set -g __fish_ls_command colorls
         else
-            for opt in --color=auto -G --color -F
+            for opt in --color=auto -G --color
                 if command ls $opt / >/dev/null 2>/dev/null
                     set -g __fish_ls_color_opt $opt
                     break
@@ -46,9 +27,6 @@ function ls --description "List contents of directory"
         end
     end
 
-    # Set the colors to the default via `dircolors` if none is given.
-    __fish_set_lscolors
-
     set -l opt
     isatty stdout
     and set -a opt -F

From f775ab6ef4eac7915b950da6799f00bff3c317e4 Mon Sep 17 00:00:00 2001
From: Nicholas Rodrigues Lordello <nick@safe.global>
Date: Thu, 2 Nov 2023 13:00:58 +0100
Subject: [PATCH 122/200] Additional checks for -F support

(cherry picked from commit 93b3a0c1f55562354e32856edd45d08c82516e01)
---
 share/functions/ls.fish | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/share/functions/ls.fish b/share/functions/ls.fish
index 369dcb860..7cb16c625 100644
--- a/share/functions/ls.fish
+++ b/share/functions/ls.fish
@@ -7,16 +7,18 @@ function ls --description "List contents of directory"
     # Solaris 11's ls command takes a --color flag.
     # OpenBSD requires the separate colorls program for color support.
     # Also test -F because we'll want to define this function even with an ls that can't do colors (like NetBSD).
-    if not set -q __fish_ls_color_opt
-        set -g __fish_ls_color_opt
+    if not set -q __fish_ls_command
         set -g __fish_ls_command ls
+        set -g __fish_ls_color_opt
+        set -g __fish_ls_indicators_opt
         # OpenBSD ships a command called "colorls" that takes "-G" and "-F",
         # but there's also a ruby implementation that doesn't understand "-F".
         # Since that one's quite different, don't use it.
         if command -sq colorls
             and command colorls -GF >/dev/null 2>/dev/null
-            set -g __fish_ls_color_opt -G
             set -g __fish_ls_command colorls
+            set -g __fish_ls_color_opt -G
+            set -g __fish_ls_indicators_opt -F
         else
             for opt in --color=auto -G --color
                 if command ls $opt / >/dev/null 2>/dev/null
@@ -24,12 +26,16 @@ function ls --description "List contents of directory"
                     break
                 end
             end
+
+            if command ls -F / >/dev/null 2>/dev/null
+                set -g __fish_ls_indicators_opt -F
+            end
         end
     end
 
-    set -l opt
+    set -l indicators_opt
     isatty stdout
-    and set -a opt -F
+    and set -a indicators_opt $__fish_ls_indicators_opt
 
     # Terminal.app doesn't set $COLORTERM or $CLICOLOR,
     # but the new FreeBSD ls requires either to be set,
@@ -40,5 +46,5 @@ function ls --description "List contents of directory"
     test "$TERM_PROGRAM" = Apple_Terminal
     and set -lx CLICOLOR 1
 
-    command $__fish_ls_command $__fish_ls_color_opt $opt $argv
+    command $__fish_ls_command $__fish_ls_color_opt $indicators_opt $argv
 end

From 657c132deedc8b9c39548caf2ef7600f5f6ac7fb Mon Sep 17 00:00:00 2001
From: Fabian Boehm <FHomborg@gmail.com>
Date: Thu, 26 Oct 2023 21:26:42 +0200
Subject: [PATCH 123/200] docs: Fix link

(cherry picked from commit 8fea3cb56df6f120a760efd563391014f8557a86)
---
 doc_src/cmds/bind.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc_src/cmds/bind.rst b/doc_src/cmds/bind.rst
index 6c0181cbf..9b0be6d9d 100644
--- a/doc_src/cmds/bind.rst
+++ b/doc_src/cmds/bind.rst
@@ -382,4 +382,4 @@ Holding alt and something else also typically sends escape, for example holding
 fish waits for a period after receiving the escape character, to determine whether it is standalone or part of an escape sequence. While waiting, additional key presses make the escape key behave as a meta key. If no other key presses come in, it is handled as a standalone escape. The waiting period is set to 30 milliseconds (0.03 seconds). It can be configured by setting the ``fish_escape_delay_ms`` variable to a value between 10 and 5000 ms. This can be a universal variable that you set once from an interactive session.
 So the escape character has its own timeout configured with :envvar:`fish_escape_delay_ms`.
 
-See also :ref:`Key sequences`.
+See also :ref:`Key sequences <interactive-key-sequences>`.

From a7b96fc4abc5d7afb0d306a979f66cffbfc7be68 Mon Sep 17 00:00:00 2001
From: Fabian Boehm <FHomborg@gmail.com>
Date: Tue, 7 Nov 2023 17:39:53 +0100
Subject: [PATCH 124/200] completions/dnf: Remove "offline-upgrade upgrade"

Fixes #10081

(cherry picked from commit 676da369b48cdffadf9555de9dab7ce3f9cf0e46)
---
 share/completions/dnf.fish | 1 -
 1 file changed, 1 deletion(-)

diff --git a/share/completions/dnf.fish b/share/completions/dnf.fish
index 67723adee..832af79cc 100644
--- a/share/completions/dnf.fish
+++ b/share/completions/dnf.fish
@@ -175,7 +175,6 @@ complete -c dnf -n __fish_use_subcommand -xa offline-upgrade -d "Prepare offline
 complete -c dnf -n "__fish_seen_subcommand_from offline-upgrade" -xa download -d "Download updates for offline upgrade"
 complete -c dnf -n "__fish_seen_subcommand_from offline-upgrade" -xa clean -d "Remove cached packages"
 complete -c dnf -n "__fish_seen_subcommand_from offline-upgrade" -xa reboot -d "Reboot and install packages"
-complete -c dnf -n "__fish_seen_subcommand_from offline-upgrade" -xa upgrade -d "Install cached packages without reboot"
 complete -c dnf -n "__fish_seen_subcommand_from offline-upgrade" -xa log -d "Show logs of upgrade attempts"
 
 # Provides

From 80000ef4d5856e8e0f99412f08796b831dbf194d Mon Sep 17 00:00:00 2001
From: Fabian Boehm <FHomborg@gmail.com>
Date: Tue, 7 Nov 2023 17:43:20 +0100
Subject: [PATCH 125/200] Document $__fish_vendor_confdirs and
 __fish_build_paths

Fixes #10078

(cherry picked from commit ddd9d183e2226a374a751307cc972150801590e8)
---
 doc_src/language.rst | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/doc_src/language.rst b/doc_src/language.rst
index 164618f7c..e69a0f0f3 100644
--- a/doc_src/language.rst
+++ b/doc_src/language.rst
@@ -1836,7 +1836,7 @@ Configuration files are run in the following order:
 
   - ``$__fish_config_dir/conf.d`` (by default, ``~/.config/fish/conf.d/``)
   - ``$__fish_sysconf_dir/conf.d`` (by default, ``/etc/fish/conf.d/``)
-  - Directories for others to ship configuration snippets for their software. Fish searches the directories under ``$__fish_user_data_dir`` (usually ``~/.local/share/fish``, controlled by the ``XDG_DATA_HOME`` environment variable) and in the ``XDG_DATA_DIRS`` environment variable for a ``fish/vendor_conf.d`` directory; if not defined, the default value of ``XDG_DATA_DIRS`` is ``/usr/share/fish/vendor_conf.d`` and ``/usr/local/share/fish/vendor_conf.d``, unless your distribution customized this.
+  - Directories for others to ship configuration snippets for their software. Fish searches the directories under ``$__fish_user_data_dir`` (usually ``~/.local/share/fish``, controlled by the ``XDG_DATA_HOME`` environment variable) and in the ``XDG_DATA_DIRS`` environment variable for a ``fish/vendor_conf.d`` directory; if not defined, the default value of ``XDG_DATA_DIRS`` is ``/usr/share/fish/vendor_conf.d`` and ``/usr/local/share/fish/vendor_conf.d``, unless your distribution customized this. These directories are also accessible in ``$__fish_vendor_confdirs``. Note that changing them in a running fish won't do anything as by that point the directories have already been read.
 
   If there are multiple files with the same name in these directories, only the first will be executed.
   They are executed in order of their filename, sorted (like globs) in a natural order (i.e. "01" sorts before "2").
@@ -1850,6 +1850,8 @@ These files are all executed on the startup of every shell. If you want to run a
 
 If you are developing another program, you may want to add configuration for all users of fish on a system. This is discouraged; if not carefully written, they may have side-effects or slow the startup of the shell. Additionally, users of other shells won't benefit from the fish-specific configuration. However, if they are required, you can install them to the "vendor" configuration directory. As this path may vary from system to system, ``pkg-config`` should be used to discover it: ``pkg-config --variable confdir fish``.
 
+For system integration, fish also ships a file called ``__fish_build_paths.fish``. This can be customized during build, for instance because your system requires special paths to be used.
+
 .. _featureflags:
 
 Future feature flags

From 255653bf32dae4d2694658154304dcb669a0beef Mon Sep 17 00:00:00 2001
From: Fabian Boehm <FHomborg@gmail.com>
Date: Tue, 7 Nov 2023 17:55:36 +0100
Subject: [PATCH 126/200] docs: Make the vendor dirs a nested list

(cherry picked from commit f81c9cba50482fe6928bf04ba1c39cbead758e9d)
---
 doc_src/language.rst | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/doc_src/language.rst b/doc_src/language.rst
index e69a0f0f3..c5ee93b26 100644
--- a/doc_src/language.rst
+++ b/doc_src/language.rst
@@ -1836,7 +1836,13 @@ Configuration files are run in the following order:
 
   - ``$__fish_config_dir/conf.d`` (by default, ``~/.config/fish/conf.d/``)
   - ``$__fish_sysconf_dir/conf.d`` (by default, ``/etc/fish/conf.d/``)
-  - Directories for others to ship configuration snippets for their software. Fish searches the directories under ``$__fish_user_data_dir`` (usually ``~/.local/share/fish``, controlled by the ``XDG_DATA_HOME`` environment variable) and in the ``XDG_DATA_DIRS`` environment variable for a ``fish/vendor_conf.d`` directory; if not defined, the default value of ``XDG_DATA_DIRS`` is ``/usr/share/fish/vendor_conf.d`` and ``/usr/local/share/fish/vendor_conf.d``, unless your distribution customized this. These directories are also accessible in ``$__fish_vendor_confdirs``. Note that changing them in a running fish won't do anything as by that point the directories have already been read.
+  - Directories for others to ship configuration snippets for their software:
+
+    - the directories under ``$__fish_user_data_dir`` (usually ``~/.local/share/fish``, controlled by the ``XDG_DATA_HOME`` environment variable)
+    - a ``fish/vendor_conf.d`` directory in the directories listed in ``$XDG_DATA_DIRS`` (default ``/usr/share/fish/vendor_conf.d`` and ``/usr/local/share/fish/vendor_conf.d``)
+
+    These directories are also accessible in ``$__fish_vendor_confdirs``.
+    Note that changing that in a running fish won't do anything as by that point the directories have already been read.
 
   If there are multiple files with the same name in these directories, only the first will be executed.
   They are executed in order of their filename, sorted (like globs) in a natural order (i.e. "01" sorts before "2").

From 8d5d0c24aa0d9dd087d8b7d6c1e4cd8ec786c6c5 Mon Sep 17 00:00:00 2001
From: Fabian Boehm <FHomborg@gmail.com>
Date: Fri, 13 Oct 2023 16:27:35 +0200
Subject: [PATCH 127/200] expand_cmdsubst: Make more errors known

These printed "Unknown error while evaluating command substitution".

Now they print something like

```
fish: for: status: cannot overwrite read-only variable
for status in foo; end
    ^~~~~^
in command substitution
fish: Invalid arguments
echo (for status in foo; end)
     ^~~~~~~~~~~~~~~~~~~~~~~^
```

for `echo (for status in foo; end)`

This is, of course, still not *great*. Mostly the `fish: Invalid
arguments` is basically entirely redundant.

An alternative is to simply skip the error message, but that requires some
more scaffolding (describe_with_prefix adds some error messages on its
own, so we can't simply say "don't add the prefix if we don't have a
message")

(cherry picked from commit 1b5eec2af6e71998c2af31830be5236aeb15ffd6)
(cherry picked from commit 67faa107b0993564ebbb5c0dd0e94d0c35b47975)
---
 src/expand.cpp                          | 17 ++++++++++
 tests/checks/syntax-error-location.fish | 45 +++++++++++++++++++++++++
 2 files changed, 62 insertions(+)

diff --git a/src/expand.cpp b/src/expand.cpp
index e04077d2b..76e3ae8e7 100644
--- a/src/expand.cpp
+++ b/src/expand.cpp
@@ -665,6 +665,23 @@ static expand_result_t expand_cmdsubst(wcstring input, const operation_context_t
             case STATUS_NOT_EXECUTABLE:
                 err = L"Command not executable";
                 break;
+            case STATUS_INVALID_ARGS:
+                // TODO: Also overused
+                // This is sent for:
+                // invalid redirections or pipes (like `<&foo`),
+                // invalid variables (invalid name or read-only) for for-loops,
+                // switch $foo if $foo expands to more than one argument
+                // time in a background job.
+                err = L"Invalid arguments";
+                break;
+            case STATUS_EXPAND_ERROR:
+                // Sent in `for $foo in ...` if $foo expands to more than one word
+                err = L"Expansion error";
+                break;
+            case STATUS_UNMATCHED_WILDCARD:
+                // Sent in `for $foo in ...` if $foo expands to more than one word
+                err = L"Unmatched wildcard";
+                break;
             default:
                 err = L"Unknown error while evaluating command substitution";
                 break;
diff --git a/tests/checks/syntax-error-location.fish b/tests/checks/syntax-error-location.fish
index fb6fe03a8..e391bc13b 100644
--- a/tests/checks/syntax-error-location.fish
+++ b/tests/checks/syntax-error-location.fish
@@ -73,3 +73,48 @@ echo "bind -M" | $fish
 # CHECKERR: ^
 # CHECKERR: (Type 'help bind' for related documentation)
 
+$fish -c 'echo (for status in foo; end)'
+# CHECKERR: fish: for: status: cannot overwrite read-only variable
+# CHECKERR: for status in foo; end
+# CHECKERR: ^~~~~^
+# CHECKERR: in command substitution
+# CHECKERR: fish: Invalid arguments
+# CHECKERR: echo (for status in foo; end)
+# CHECKERR: ^~~~~~~~~~~~~~~~~~~~~~~^
+
+$fish -c 'echo (echo <&foo)'
+# CHECKERR: fish: Requested redirection to 'foo', which is not a valid file descriptor
+# CHECKERR: echo <&foo
+# CHECKERR: ^~~~^
+# CHECKERR: in command substitution
+# CHECKERR: fish: Invalid arguments
+# CHECKERR: echo (echo <&foo)
+# CHECKERR: ^~~~~~~~~~~^
+
+
+$fish -c 'echo (time echo foo &)'
+# CHECKERR: fish: 'time' is not supported for background jobs. Consider using 'command time'.
+# CHECKERR: time echo foo &
+# CHECKERR: ^~~~~~~~~~~~~~^
+# CHECKERR: in command substitution
+# CHECKERR: fish: Invalid arguments
+# CHECKERR: echo (time echo foo &)
+# CHECKERR: ^~~~~~~~~~~~~~~~^
+
+$fish -c 'echo (set -l foo 1 2 3; for $foo in foo; end)'
+# CHECKERR: fish: Unable to expand variable name ''
+# CHECKERR: set -l foo 1 2 3; for $foo in foo; end
+# CHECKERR: ^~~^
+# CHECKERR: in command substitution
+# CHECKERR: fish: Expansion error
+# CHECKERR: echo (set -l foo 1 2 3; for $foo in foo; end)
+# CHECKERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
+
+$fish -c 'echo (echo *nosuchname*)'
+# CHECKERR: fish: No matches for wildcard '*nosuchname*'. See `help wildcards-globbing`.
+# CHECKERR: echo *nosuchname*
+# CHECKERR: ^~~~~~~~~~~^
+# CHECKERR: in command substitution
+# CHECKERR: fish: Unmatched wildcard
+# CHECKERR: echo (echo *nosuchname*)
+# CHECKERR: ^~~~~~~~~~~~~~~~~~^

From efd5db4a85d074db31e365e86e188f5dc5a788b1 Mon Sep 17 00:00:00 2001
From: Alex Chan <alex@alexwlchan.net>
Date: Sun, 26 Nov 2023 02:39:51 +0000
Subject: [PATCH 128/200] Add a missing space after a comma

(cherry picked from commit ccc8308d41d7b578fe3102e942049b8e7d1a5228)
---
 doc_src/cmds/function.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc_src/cmds/function.rst b/doc_src/cmds/function.rst
index b4972d7d6..38874e21e 100644
--- a/doc_src/cmds/function.rst
+++ b/doc_src/cmds/function.rst
@@ -30,7 +30,7 @@ The following options are available:
     Inherit completions from the given *WRAPPED_COMMAND*. See the documentation for :doc:`complete <complete>` for more information.
 
 **-e** *EVENT_NAME* or **--on-event** *EVENT_NAME*
-    Run this function when the specified named event is emitted. Fish internally generates named events, for example,when showing the prompt. Custom events can be emitted using the :doc:`emit <emit>` command.
+    Run this function when the specified named event is emitted. Fish internally generates named events, for example, when showing the prompt. Custom events can be emitted using the :doc:`emit <emit>` command.
 
 **-v** *VARIABLE_NAME* or **--on-variable** *VARIABLE_NAME*
     Run this function when the variable *VARIABLE_NAME* changes value. Note that :program:`fish` makes no guarantees on any particular timing or even that the function will be run for every single ``set``. Rather it will be run when the variable has been set at least once, possibly skipping some values or being run when the variable has been set to the same value (except for universal variables set in other shells - only changes in the value will be picked up for those).

From 6295e32f25702b9af37b89ae491b9fc8e025a749 Mon Sep 17 00:00:00 2001
From: rymrg <54061433+rymrg@users.noreply.github.com>
Date: Wed, 15 Feb 2023 17:52:05 +0000
Subject: [PATCH 129/200] Improve fossil prompt execution time (#9528)

* Improve prompt execution time

* Change status to changes

* Remove grep/awk/sort

* Remove calls to grep/awk/sort
* Don't overwrite user defined colors

* Make look more consistent with git

(cherry picked from commit 43b1be0579a619dfb4a60b830d9a024faee489e9)
---
 share/functions/fish_fossil_prompt.fish | 140 +++++++++++++++++-------
 1 file changed, 100 insertions(+), 40 deletions(-)

diff --git a/share/functions/fish_fossil_prompt.fish b/share/functions/fish_fossil_prompt.fish
index 5c42f47e8..3ee12c349 100644
--- a/share/functions/fish_fossil_prompt.fish
+++ b/share/functions/fish_fossil_prompt.fish
@@ -4,50 +4,110 @@ function fish_fossil_prompt --description 'Write out the fossil prompt'
         return 1
     end
 
-    # Bail if not a fossil checkout
-    if not fossil ls &> /dev/null
-	return 127
-    end
+    # Read branch and bookmark (bail if not checkout)
+    set -l branch (fossil branch current 2>/dev/null)
+    or return 127
 
-    # Parse fossil info
-    set -l fossil_info (fossil info)
-    string match --regex --quiet \
-        '^project-name:\s*(?<fossil_project_name>.*)$' $fossil_info
-    string match --regex --quiet \
-        '^tags:\s*(?<fossil_tags>.*)$' $fossil_info
+    set -q fish_color_fossil_clean
+    or set -g fish_color_fossil_clean green
+    set -q fish_color_fossil_modified
+    or set -g fish_color_fossil_modified yellow
+    set -q fish_color_fossil_dirty
+    or set -g fish_color_fossil_dirty red
 
-    echo -n ' ['
-    set_color --bold magenta
-    echo -n $fossil_project_name
-    set_color normal
-    echo -n ':'
-    set_color --bold yellow
-    echo -n $fossil_tags
-    set_color normal
+    set -q fish_color_fossil_added
+    or set -g fish_color_fossil_added green
+    set -q fish_color_fossil_renamed
+    or set -g fish_color_fossil_renamed magenta
+    set -q fish_color_fossil_missing
+    or set -g fish_color_fossil_missing red
+    set -q fish_color_fossil_deleted
+    or set -g fish_color_fossil_deleted red
+    set -q fish_color_fossil_untracked
+    or set -g fish_color_fossil_untracked yellow
+    set -q fish_color_fossil_conflict
+    or set -g fish_color_fossil_conflict red
 
-    # Parse fossil status
-    set -l fossil_status (fossil status)
-    if string match --quiet 'ADDED*' $fossil_status
-        set_color --bold green
-        echo -n '+'
-    end
-    if string match --quiet 'DELETED*' $fossil_status
-        set_color --bold red
-        echo -n '-'
-    end
-    if string match --quiet 'MISSING*' $fossil_status
-        set_color --bold red
-        echo -n '!'
-    end
-    if string match --quiet 'RENAMED*' $fossil_status
-        set_color --bold yellow
-        echo -n '→'
-    end
-    if string match --quiet 'CONFLICT*' $fossil_status
-        set_color --bold green
-        echo -n '×'
+    set -q fish_prompt_fossil_status_added
+    or set -g fish_prompt_fossil_status_added '✚'
+    set -q fish_prompt_fossil_status_modified
+    or set -g fish_prompt_fossil_status_modified '*'
+    set -q fish_prompt_fossil_status_renamed
+    or set -g fish_prompt_fossil_status_renamed '⇒'
+    set -q fish_prompt_fossil_status_deleted
+    or set -g fish_prompt_fossil_status_deleted '-'
+    set -q fish_prompt_fossil_status_missing
+    or set -g fish_prompt_fossil_status_missing '✖'
+    set -q fish_prompt_fossil_status_untracked
+    or set -g fish_prompt_fossil_status_untracked '?'
+    set -q fish_prompt_fossil_status_conflict
+    or set -g fish_prompt_fossil_status_conflict '×'
+
+	set -q fish_prompt_fossil_status_order
+	or set -g fish_prompt_fossil_status_order added modified renamed deleted missing untracked conflict
+
+
+
+    echo -n ' ('
+	set_color magenta
+	echo -n "$branch"
+	set_color normal
+	echo -n '|'
+	#set -l repo_status (fossil changes --differ 2>/dev/null | string match -rv '\w:|^\s' | string split " " -f1 | sort -u)
+	set -l repo_status (fossil changes --differ 2>/dev/null | string match -rv '\w:|^\s' | string split " " -f1 | path sort -u)
+
+    # Show nice color for a clean repo
+    if test -z "$repo_status"
+        set_color $fish_color_fossil_clean
+        echo -n '✔'
+
+    # Handle modified or dirty (unknown state)
+    else
+        set -l fossil_statuses
+
+        # Take actions for the statuses of the files in the repo
+        for line in $repo_status
+
+            # Add a character for each file status if we have one
+            switch $line
+                case 'ADDED'
+                    set -a fossil_statuses added
+                case 'EDITED'
+                    set -a fossil_statuses modified
+                case 'EXTRA'
+                    set -a fossil_statuses untracked
+                case 'DELETED'
+                    set -a fossil_statuses deleted
+                case 'MISSING'
+                    set -a fossil_statuses missing
+                case 'RENAMED'
+                    set -a fossil_statuses renamed
+                case 'CONFLICT'
+                    set -a fossil_statuses conflict
+            end
+        end
+
+        if string match -qr '^(ADDED|EDITED|DELETED)' $repo_status
+            set_color $fish_color_fossil_modified
+        else
+            set_color --bold $fish_color_fossil_dirty
+        end
+
+        echo -n '⚡'
+		set_color normal
+
+        # Sort status symbols
+        for i in $fish_prompt_fossil_status_order
+            if contains -- $i $fossil_statuses
+                set -l color_name fish_color_fossil_$i
+                set -l status_name fish_prompt_fossil_status_$i
+
+                set_color $$color_name
+                echo -n $$status_name
+            end
+        end
     end
 
     set_color normal
-    echo -n ']'
+    echo -n ')'
 end

From 95c3a4045bbbc2f6c606c8d338edd257bc261da0 Mon Sep 17 00:00:00 2001
From: Quinten Roets <62651391+quintenroets@users.noreply.github.com>
Date: Tue, 14 Mar 2023 05:50:20 -0400
Subject: [PATCH 130/200] fish_vi_cursor: add new variable for external cursor
 mode (#9565)

* add new variable for external cursor mode

* fix backwards compatibility

* add documentation

* document change in changelog

(cherry picked from commit f5506803d795cabe1c3cbb8c15f446e4fc9ac435)
---
 CHANGELOG.rst                       | 1 +
 doc_src/interactive.rst             | 3 +++
 share/functions/fish_vi_cursor.fish | 5 ++++-
 3 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index 9c52dca73..7aeeb023b 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -47,6 +47,7 @@ Interactive improvements
 - The ``repaint-mode`` binding will now only move the cursor if there is repainting to be done. This fixes alt+something bindings in vi-mode (:issue:`7910`).
 - A new ``clear-screen`` bind function is used for :kbd:`Alt`\ +\ :kbd:`l` by default. This clears the screen and repaints the existing prompt at first,
   so it eliminates visible flicker unless the terminal is very slow (:issue:`10044`).
+- A new variable, :envvar:`fish_cursor_external`, can be used to specify to cursor shape when a command is launched. When unspecified, the value defaults to the value of :envvar:`fish_cursor_default` (:issue:`4656`).
 
 Improved prompts
 ^^^^^^^^^^^^^^^^
diff --git a/doc_src/interactive.rst b/doc_src/interactive.rst
index bab02a0a2..28fb2c737 100644
--- a/doc_src/interactive.rst
+++ b/doc_src/interactive.rst
@@ -421,6 +421,9 @@ The ``fish_vi_cursor`` function will be used to change the cursor's shape depend
    # Set the replace mode cursors to an underscore
    set fish_cursor_replace_one underscore
    set fish_cursor_replace underscore
+   # Set the external cursor to a line. The external cursor appears when a command is started. 
+   # The cursor shape takes the value of fish_cursor_default when fish_cursor_external is not specified.
+   set fish_cursor_external line
    # The following variable can be used to configure cursor shape in
    # visual mode, but due to fish_cursor_default, is redundant here
    set fish_cursor_visual block
diff --git a/share/functions/fish_vi_cursor.fish b/share/functions/fish_vi_cursor.fish
index 1ad23bc47..195a98cb1 100644
--- a/share/functions/fish_vi_cursor.fish
+++ b/share/functions/fish_vi_cursor.fish
@@ -92,7 +92,10 @@ function fish_vi_cursor -d 'Set cursor shape for different vi modes'
 
     echo "
           function fish_vi_cursor_handle_preexec --on-event fish_preexec
-              set -l varname fish_cursor_default
+              set -l varname fish_cursor_external
+              if not set -q \$varname
+                set varname fish_cursor_default
+              end
               if not set -q \$varname
                 set varname fish_cursor_unknown
               end

From 446a41e23a9619caacee14fff976a94cc35d7957 Mon Sep 17 00:00:00 2001
From: David Adam <zanchey@ucc.gu.uwa.edu.au>
Date: Wed, 20 Dec 2023 00:23:45 +0800
Subject: [PATCH 131/200] CHANGELOG: work on 3.7.0

---
 CHANGELOG.rst | 33 ++++++++++++++-------------------
 1 file changed, 14 insertions(+), 19 deletions(-)

diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index 7aeeb023b..da13eff1b 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -1,7 +1,7 @@
 fish 3.7.0 (released ???)
 ====================================
 
-This release of fish contains a number of fixes for problems identified in fish 3.6.1, as well as some enhancements.
+.. ignore: 5319 7375 9500 9515 9528 9538 9565 9667 9681 9690 9926 9932
 
 Notable improvements and fixes
 ------------------------------
@@ -14,7 +14,7 @@ Deprecations and removed features
 
 Scripting improvements
 ----------------------
-- Running ``exit`` with a negative number no longer crashes fish by hitting an assert() (:issue:`9659`).
+- Running ``exit`` with a negative number no longer crashes fish (:issue:`9659`).
 - ``fish -c`` will now return a non-zero status if parsing failed (:issue:`9888`).
 - Globbing will now use fewer system calls in some cases, especially with a trailing slash (``/path/a*/``), and for searching for commands.
   Some of this requires filesystem support - the d_type field in the dirent struct returned by readdir(3).
@@ -32,41 +32,36 @@ Interactive improvements
 - Closing the history pager with enter will now copy the search text to the commandline if there was no match, so you can continue editing the command you tried to find right away (:issue:`9934`).
 - Opening the history pager will now fill the search field with a search string if you're already in a search (:issue:`10005`). This makes it nicer to search something with up-arrow and then later decide to switch to the full pager.
 - ``read`` no longer enables bracketed paste so it doesn't stay enabled in combined commandlines like ``mysql -p(read --silent)`` (:issue:`8285`).
-- Vi-mode now uses :envvar:`fish_cursor_external` to set the cursor shape for external commands (:issue:`4656`, :issue:`9565`).
-- Vi-mode cursor shaping is now enabled in iterm2 (:issue:`9698`).
+- Vi mode now uses :envvar:`fish_cursor_external` to set the cursor shape for external commands (:issue:`4656`).
+- Vi mode cursor shaping is now enabled in iterm2 (:issue:`9698`).
 - Completing commands as root now finds commands not owned by root again (:issue:`9699`).
 - Selection now uses fish_color_selection for the foreground as well (:issue:`9717`).
 - The completion pager will no longer sometimes skip the last entry when moving through a long list (:issue:`9812`, :issue:`9833`).
 - The interactive ``history delete`` now allows specifying index ranges like "1..5" (:issue:`9736`).
 - Command completion will now call the stock manpath on macOS instead of a potential homebrew version. This prevents awkward error messages (:issue:`9817`).
-- A new bind function ``history-pager-delete`` will delete the current history pager item from history (:issue:`9454`, :issue:`9515`).
+- A new bind function ``history-pager-delete``, bound to :kbd:``Shift`` + :kbd:``Delete`` by default, will delete the currently-selected history pager item from history (:issue:`9454`).
 - ``fish_key_reader`` will now use printable characters as-is, so pressing "ö" no longer leads to it telling you to bind ``\u00F6`` (:issue:`9986`).
-- Fish can now wait for a timeout for a key sequence to complete instead of waiting indefinitely. This makes e.g. binding ``kj`` to switching modes in vi-mode possible.
-  The timeout can be set via the new :envvar:`fish_sequence_key_delay_ms` (:issue:`7401`, :issue:`9926`), and may be set by default in future versions.
+- fish can now be configured to wait a specified amount of time for a multi-key sequence to be completed,  instead of waiting indefinitely. For example, this makes binding ``kj`` to switching modes in vi mode possible.
+  The timeout can be set via the new :envvar:`fish_sequence_key_delay_ms` (:issue:`7401`), and may be set by default in future versions.
 - ``open`` no longer works around an xdg-open bug that was finally fixed and can be used to launch terminal programs again (:issue:`10045`).
-- The ``repaint-mode`` binding will now only move the cursor if there is repainting to be done. This fixes alt+something bindings in vi-mode (:issue:`7910`).
+- The ``repaint-mode`` binding will now only move the cursor if there is repainting to be done. This fixes :kbd:`Alt` combination bindings in vi mode (:issue:`7910`).
 - A new ``clear-screen`` bind function is used for :kbd:`Alt`\ +\ :kbd:`l` by default. This clears the screen and repaints the existing prompt at first,
   so it eliminates visible flicker unless the terminal is very slow (:issue:`10044`).
-- A new variable, :envvar:`fish_cursor_external`, can be used to specify to cursor shape when a command is launched. When unspecified, the value defaults to the value of :envvar:`fish_cursor_default` (:issue:`4656`).
+- The ``alias`` convenience function has better support for commands with unusual characters, like ``+`` (:issue:`8720`).
+- A longstanding issue where items in the pager would sometimes display without proper formatting has been fixed (:issue:`9617`).
 
 Improved prompts
 ^^^^^^^^^^^^^^^^
 - The default theme now only uses named colors, so it will track the terminal's palette (:issue:`9913`).
 - The Dracula theme has now been synced with upstream (:issue:`9807`).
-- ``fish_vcs_prompt`` now also supports fossil (:issue:`9497`, :issue:`9500`, :issue:`9528`).
+- ``fish_vcs_prompt`` now also supports fossil (:issue:`9497`).
 
 Completions
 ^^^^^^^^^^^
 - Added completions for:
-  - ``apkanalyzer`` (:issue:`9558`)
-  - ``neovim`` (:issue:`9543`)
-  - ``otool``
-  - ``pre-commit`` (:issue:`9521`)
-  - ``proxychains`` (:issue:`9486`)
-  - ``scrypt`` (:issue:`9583`)
-  - ``stow`` (:issue:`9571`)
-  - ``trash`` and helper utilities ``trash-empty``, ``trash-list``, ``trash-put``, ``trash-restore`` (:issue:`9560`)
-  - ``ssh-copy-id`` (:issue:`9675`)
+  - ``iwctl`` (:issue:`6884`)
+  - ``rpm-ostool`` (:issue:``9669``)
+  - ``zabbix`` (:issue:`9647`)
 - The ``zfs`` completions no longer print errors about setting a read-only variable (:issue:`9705`).
 - The ``kitty`` completions have been removed in favor of keeping them upstream (:issue:`9750`).
 - Improvements to many completions.

From c54d48f3f942cddd8f87e058d7d67919287e9ec4 Mon Sep 17 00:00:00 2001
From: Fabian Boehm <FHomborg@gmail.com>
Date: Sat, 10 Jun 2023 15:23:29 +0200
Subject: [PATCH 132/200] history: Allow deleting ranges

This allows giving a range like "5..7".

It works in combination with more (including overlapping) ranges or
single indices.

Fixes #9736

(cherry picked from commit 65769bf8c8352964826bd93e962e1a8fe84815ea)
---
 doc_src/cmds/history.rst     |  2 +-
 share/functions/history.fish | 49 ++++++++++++++++++++++++++++--------
 tests/pexpects/history.py    |  4 +--
 3 files changed, 41 insertions(+), 14 deletions(-)

diff --git a/doc_src/cmds/history.rst b/doc_src/cmds/history.rst
index 959d8ce30..0deebd795 100644
--- a/doc_src/cmds/history.rst
+++ b/doc_src/cmds/history.rst
@@ -29,7 +29,7 @@ The following operations (sub-commands) are available:
     Returns history items matching the search string. If no search string is provided it returns all history items. This is the default operation if no other operation is specified. You only have to explicitly say ``history search`` if you wish to search for one of the subcommands. The ``--contains`` search option will be used if you don't specify a different search option. Entries are ordered newest to oldest unless you use the ``--reverse`` flag. If stdout is attached to a tty the output will be piped through your pager by the history function. The history builtin simply writes the results to stdout.
 
 **delete**
-    Deletes history items. The ``--contains`` search option will be used if you don't specify a different search option. If you don't specify ``--exact`` a prompt will be displayed before any items are deleted asking you which entries are to be deleted. You can enter the word "all" to delete all matching entries. You can enter a single ID (the number in square brackets) to delete just that single entry. You can enter more than one ID separated by a space to delete multiple entries. Just press [enter] to not delete anything. Note that the interactive delete behavior is a feature of the history function. The history builtin only supports ``--exact --case-sensitive`` deletion.
+    Deletes history items. The ``--contains`` search option will be used if you don't specify a different search option. If you don't specify ``--exact`` a prompt will be displayed before any items are deleted asking you which entries are to be deleted. You can enter the word "all" to delete all matching entries. You can enter a single ID (the number in square brackets) to delete just that single entry. You can enter more than one ID, or an ID range separated by a space to delete multiple entries. Just press [enter] to not delete anything. Note that the interactive delete behavior is a feature of the history function. The history builtin only supports ``--exact --case-sensitive`` deletion.
 
 **merge**
     Immediately incorporates history changes from other sessions. Ordinarily ``fish`` ignores history changes from sessions started after the current one. This command applies those changes immediately.
diff --git a/share/functions/history.fish b/share/functions/history.fish
index 767207dcf..4b261ae2e 100644
--- a/share/functions/history.fish
+++ b/share/functions/history.fish
@@ -132,12 +132,13 @@ function history --description "display or manipulate interactive command histor
                 for i in (seq $found_items_count)
                     printf "[%s] %s\n" $i $found_items[$i]
                 end
-                echo ""
+                echo
                 echo "Enter nothing to cancel the delete, or"
-                echo "Enter one or more of the entry IDs separated by a space, or"
-                echo "Enter \"all\" to delete all the matching entries."
-                echo ""
-                read --local --prompt "echo 'Delete which entries? > '" choice
+                echo "Enter one or more of the entry IDs or ranges like '5..12', separated by a space."
+                echo "For example '7 10..15 35 788..812'."
+                echo "Enter 'all' to delete all the matching entries."
+                echo
+                read --local --prompt "echo 'Delete which entries? '" choice
                 echo ''
 
                 if test -z "$choice"
@@ -154,16 +155,42 @@ function history --description "display or manipulate interactive command histor
                     return
                 end
 
+                set -l choices
                 for i in (string split " " -- $choice)
-                    if test -z "$i"
-                        or not string match -qr '^[1-9][0-9]*$' -- $i
-                        or test $i -gt $found_items_count
-                        printf "Ignoring invalid history entry ID \"%s\"\n" $i
+                    # Expand ranges like 577..580
+                    if set -l inds (string match -rg '^([1-9][0-9]*)\.\.([1-9][0-9]*)' -- $i)
+                        if test $inds[1] -gt $found_items_count
+                            or test $inds[1] -gt $inds[2]
+                            printf (_ "Ignoring invalid history entry ID \"%s\"\n") $i
+                            continue
+                        end
+
+                        set -l indexes (seq $inds[1] 1 $inds[2])
+                        if set -q indexes[1]
+                            set -a choices $indexes
+                        end
                         continue
                     end
 
-                    printf "Deleting history entry %s: \"%s\"\n" $i $found_items[$i]
-                    builtin history delete --exact --case-sensitive -- "$found_items[$i]"
+                    if string match -qr '^[1-9][0-9]*$' -- $i
+                        and test $i -lt $found_items_count
+                        set -a choices $i
+                    else
+                        printf (_ "Ignoring invalid history entry ID \"%s\"\n") $i
+                        continue
+                    end
+                end
+
+                if not set -q choices[1]
+                    return 1
+                end
+
+                set choices (path sort -u -- $choices)
+
+                echo Deleting choices: $choices
+                for x in $choices
+                    printf "Deleting history entry %s: \"%s\"\n" $x $found_items[$x]
+                    builtin history delete --exact --case-sensitive -- "$found_items[$x]"
                 end
                 builtin history save
             end
diff --git a/tests/pexpects/history.py b/tests/pexpects/history.py
index 8713f7199..5d01a7445 100644
--- a/tests/pexpects/history.py
+++ b/tests/pexpects/history.py
@@ -111,9 +111,9 @@ expect_re("history delete -p 'echo hello'\r\n")
 expect_re("\[1\] echo hello AGAIN\r\n")
 expect_re("\[2\] echo hello again\r\n\r\n")
 expect_re(
-    'Enter nothing to cancel.*\r\nEnter "all" to delete all the matching entries\.\r\n'
+    'Enter nothing to cancel the delete, or\r\nEnter one or more of the entry IDs or ranges like \'5..12\', separated by a space.\r\nFor example \'7 10..15 35 788..812\'.\r\nEnter \'all\' to delete all the matching entries.\r\n'
 )
-expect_re("Delete which entries\? >")
+expect_re("Delete which entries\? ")
 sendline("1")
 expect_prompt('Deleting history entry 1: "echo hello AGAIN"\r\n')
 

From b12c36e72d57115b86dc56b0f1566c36514748ae Mon Sep 17 00:00:00 2001
From: David Adam <zanchey@ucc.gu.uwa.edu.au>
Date: Sat, 23 Dec 2023 23:24:45 +0800
Subject: [PATCH 133/200] CHANGELOG: work on 3.7.0

---
 CHANGELOG.rst | 27 +++++++++++++++------------
 1 file changed, 15 insertions(+), 12 deletions(-)

diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index da13eff1b..41d5468d5 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -1,16 +1,16 @@
 fish 3.7.0 (released ???)
 ====================================
 
-.. ignore: 5319 7375 9500 9515 9528 9538 9565 9667 9681 9690 9926 9932
+.. ignore: 5319 7375 9500 9515 9528 9538 9565 9667 9681 9690 9692 9704 9706 9707 9713 9718 9719 9721 9722 9728 9732 9734 9738 9741 9742 9743 9926 9932
 
 Notable improvements and fixes
 ------------------------------
-- ``LS_COLORS`` is no longer set automatically by ``ls`` (:issue:`10080`). Users
-  that set ``.dircolors`` should manually import it using other means.
+
 
 Deprecations and removed features
 ---------------------------------
-- 
+- ``LS_COLORS`` is no longer set automatically by the ``ls`` function (:issue:`10080`). Users
+  that set ``.dircolors`` should manually import it using other means.
 
 Scripting improvements
 ----------------------
@@ -33,11 +33,12 @@ Interactive improvements
 - Opening the history pager will now fill the search field with a search string if you're already in a search (:issue:`10005`). This makes it nicer to search something with up-arrow and then later decide to switch to the full pager.
 - ``read`` no longer enables bracketed paste so it doesn't stay enabled in combined commandlines like ``mysql -p(read --silent)`` (:issue:`8285`).
 - Vi mode now uses :envvar:`fish_cursor_external` to set the cursor shape for external commands (:issue:`4656`).
-- Vi mode cursor shaping is now enabled in iterm2 (:issue:`9698`).
-- Completing commands as root now finds commands not owned by root again (:issue:`9699`).
-- Selection now uses fish_color_selection for the foreground as well (:issue:`9717`).
+- Vi mode cursor shaping is now enabled in iTerm2 (:issue:`9698`).
+- Working directory reporting is enabled for iTerm2 (:issue:`9955`).
+- Completing commands as root includes commands not owned by root, fixing a regression introduced in fish 3.2.0 (:issue:`9699`).
+- Selection uses ``fish_color_selection`` for the foreground and background colors, as intended, rather than just the background (:issue:`9717`).
 - The completion pager will no longer sometimes skip the last entry when moving through a long list (:issue:`9812`, :issue:`9833`).
-- The interactive ``history delete`` now allows specifying index ranges like "1..5" (:issue:`9736`).
+- The interactive ``history delete`` interface now allows specifying index ranges like "1..5" (:issue:`9736`).
 - Command completion will now call the stock manpath on macOS instead of a potential homebrew version. This prevents awkward error messages (:issue:`9817`).
 - A new bind function ``history-pager-delete``, bound to :kbd:``Shift`` + :kbd:``Delete`` by default, will delete the currently-selected history pager item from history (:issue:`9454`).
 - ``fish_key_reader`` will now use printable characters as-is, so pressing "ö" no longer leads to it telling you to bind ``\u00F6`` (:issue:`9986`).
@@ -59,15 +60,17 @@ Improved prompts
 Completions
 ^^^^^^^^^^^
 - Added completions for:
+  - ``ar`` (:issue:`9720`)
+  - ``gojq`` (:issue:`9740`)
   - ``iwctl`` (:issue:`6884`)
-  - ``rpm-ostool`` (:issue:``9669``)
+  - ``qjs`` (:issue:`9723`)
+  - ``qjsc`` (:issue:`9731`)
+  - ``rpm-ostool`` (:issue:`9669`)
   - ``zabbix`` (:issue:`9647`)
 - The ``zfs`` completions no longer print errors about setting a read-only variable (:issue:`9705`).
 - The ``kitty`` completions have been removed in favor of keeping them upstream (:issue:`9750`).
 - Improvements to many completions.
-- The manpage completion generator will no longer sometimes parse a manpage of the same name in two different directories (:issue:`9787`).
-- The manpage completion generator won't cause up-to-date python versions to spew SyntaxWarnings about invalid backslash sequences anymore (:issue:`9814`)
-- The manpage completion generator will replace a few more roff escapes (:issue:`9961`).
+- Improvements to the manual page completion generator (:issue:`9787`, :issue:`9814`, :issue:`9961`).
 
 Other improvements
 ------------------

From 8319011f24893af6f0b3371637232cf52e2b878e Mon Sep 17 00:00:00 2001
From: Rocka <i@rocka.me>
Date: Sat, 6 May 2023 16:04:03 +0800
Subject: [PATCH 134/200] completions: fix qdbus Q_NOREPLY method completion

(cherry picked from commit c21e13e62ec4459a3de82e8c021223e7bf0b290c)
---
 share/completions/qdbus.fish | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/share/completions/qdbus.fish b/share/completions/qdbus.fish
index f8e48bb6e..b22f7ae69 100644
--- a/share/completions/qdbus.fish
+++ b/share/completions/qdbus.fish
@@ -11,7 +11,7 @@ function __fish_qdbus_complete
     set argc (count $argv)
     if test $argc -le 3
         # avoid completion of property value
-        qdbus $qdbus_flags $argv[2] $argv[3] | string replace --regex '^(?<kind>property\ (read)?(write)?|signal|method) (?<type>(\{.+\})|([^\ ]+)) (?<name>[^\(]+)(?<arguments>\(.+?\))?' '$name\t$kind $type $arguments' | string trim
+        qdbus $qdbus_flags $argv[2] $argv[3] | string replace --regex '^(?<kind>property\ (read)?(write)?|signal|method( Q_NOREPLY)?) (?<type>(\{.+\})|([^\ ]+)) (?<name>[^\(]+)(?<arguments>\(.+?\))?' '$name\t$kind $type $arguments' | string trim
     end
 end
 

From f7ce49a3a9b7a85cfc65806bf1164afb842ee5e6 Mon Sep 17 00:00:00 2001
From: Fabian Boehm <FHomborg@gmail.com>
Date: Tue, 20 Jun 2023 19:43:09 +0200
Subject: [PATCH 135/200] docs: Add "Writing your own prompt" doc (#9841)

* docs: Add "Writing your own prompt" doc

* Remove a space from the "output"

* some teensy adjustments

* Address feedback

* envvar one more PWD

* More html warning

(cherry picked from commit c385027ecab985bf6e1e4c6ec388deb8cbb74243)
---
 doc_src/conf.py                               |   1 +
 doc_src/index.rst                             |   1 +
 doc_src/prompt.rst                            | 172 ++++++++++++++++++
 .../python_docs_theme/static/pydoctheme.css   |   1 +
 share/functions/help.fish                     |   2 +
 5 files changed, 177 insertions(+)
 create mode 100644 doc_src/prompt.rst

diff --git a/doc_src/conf.py b/doc_src/conf.py
index b5aeb5e95..55f9c7cfd 100644
--- a/doc_src/conf.py
+++ b/doc_src/conf.py
@@ -187,6 +187,7 @@ man_pages = [
     ("interactive", "fish-interactive", "", [author], 1),
     ("relnotes", "fish-releasenotes", "", [author], 1),
     ("completions", "fish-completions", "", [author], 1),
+    ("prompt", "fish-prompt-tutorial", "", [author], 1),
     (
         "fish_for_bash_users",
         "fish-for-bash-users",
diff --git a/doc_src/index.rst b/doc_src/index.rst
index 70043e79c..86ffcfdb8 100644
--- a/doc_src/index.rst
+++ b/doc_src/index.rst
@@ -171,6 +171,7 @@ Other help pages
    fish_for_bash_users
    tutorial
    completions
+   prompt
    design
    relnotes
    license
diff --git a/doc_src/prompt.rst b/doc_src/prompt.rst
new file mode 100644
index 000000000..76757dfa9
--- /dev/null
+++ b/doc_src/prompt.rst
@@ -0,0 +1,172 @@
+Writing your own prompt
+=======================
+
+.. only:: builder_man
+
+   .. warning::
+      This document uses formatting to show what a prompt would look like. If you are viewing this in the man page,
+      you probably want to switch to looking at the html version instead. Run ``help custom-prompt`` to view it in a web browser.
+
+Fish ships a number of prompts that you can view with the :doc:`fish_config <cmds/fish_config>` command, and many users have shared their prompts online.
+
+However, you can also write your own, or adjust an existing prompt. This is a good way to get used to fish's :doc:`scripting language <language>`.
+
+Unlike other shells, fish's prompt is built by running a function - :doc:`fish_prompt <cmds/fish_prompt>`. Or, more specifically, three functions:
+
+- :doc:`fish_prompt <cmds/fish_prompt>`, which is the main prompt function
+- :doc:`fish_right_prompt <cmds/fish_right_prompt>`, which is shown on the right side of the terminal.
+- :doc:`fish_mode_prompt <cmds/fish_mode_prompt>`, which is shown if :ref:`vi-mode <vi-mode>` is used.
+
+These functions are run, and whatever they print is displayed as the prompt (minus one trailing newline).
+
+Here, we will just be writing a simple fish_prompt.
+
+Our first prompt
+----------------
+
+Let's look at a very simple example::
+
+  function fish_prompt
+      echo $PWD '>'
+  end
+
+This prints the current working directory (:envvar:`PWD`) and a ``>`` symbol to show where the prompt ends. The ``>`` is :ref:`quoted <quotes>` because otherwise it would signify a :ref:`redirection <redirects>`.
+
+Because we've used :doc:`echo <cmds/echo>`, it adds spaces between the two so it ends up looking like (assuming ``_`` is your cursor):
+
+.. role:: white
+.. parsed-literal::
+    :class: highlight
+
+    :white:`/home/tutorial >`\ _
+
+Formatting
+----------
+
+``echo`` adds spaces between its arguments. If you don't want those, you can use :doc:`string join <cmds/string-join>` like this::
+
+  function fish_prompt
+      string join '' -- $PWD '>'
+  end
+
+The ``--`` indicates to ``string`` that no options can come after it, in case we extend this with something that can start with a ``-``.
+
+There are other ways to remove the space, including ``echo -s`` and :doc:`printf <cmds/printf>`.
+
+Adding colo(u)r
+---------------
+
+This prompt is functional, but a bit boring. We could add some color.
+
+Fortunately, fish offers the :doc:`set_color <cmds/set_color>` command, so you can do::
+
+  echo (set_color red)foo
+
+``set_color`` can also handle RGB colors like ``set_color 23b455``, and other formatting options including bold and italics.
+
+So, taking our previous prompt and adding some color::
+
+  function fish_prompt
+      string join '' -- (set_color green) $PWD (set_color normal) '>'
+  end
+
+A "normal" color tells the terminal to go back to its normal formatting options.
+
+What ``set_color`` does internally is to print an escape sequence that tells the terminal to change color. So if you see something like::
+
+  echo \e\[31mfoo
+
+that could just be ``set_color red``.
+
+Shortening the working directory
+--------------------------------
+
+This is fine, but our :envvar:`PWD` can be a bit long, and we are typically only interested in the last few directories. We can shorten this with the :doc:`prompt_pwd <cmds/prompt_pwd>` helper that will give us a shortened working directory::
+
+  function fish_prompt
+      string join '' -- (set_color green) (prompt_pwd) (set_color normal) '>'
+  end
+
+``prompt_pwd`` takes options to control how much to shorten. For instance, if we want to display the last two directories, we'd use ``prompt_pwd --full-length-dirs 2``::
+
+  function fish_prompt
+      string join '' -- (set_color green) (prompt_pwd --full-length-dirs 2) (set_color normal) '>'
+  end
+
+With a current directory of "/home/tutorial/Music/Lena Raine/Oneknowing", this would print
+
+.. role:: green
+.. parsed-literal::
+    :class: highlight
+
+    :green:`~/M/Lena Raine/Oneknowing`>_
+
+Status
+------
+
+One important bit of information that every command returns is the :ref:`status <variables-status>`. This is a whole number from 0 to 255, and usually it is used as an error code - 0 if the command returned successfully, or a number from 1 to 255 if not.
+
+It's useful to display this in your prompt, but showing it when it's 0 seems kind of wasteful.
+
+First of all, since every command (except for :doc:`set <cmds/set>`) changes the status, you need to store it for later use as the first thing in your prompt. Use a :ref:`local variable <variables-scope>` so it will be confined to your prompt function::
+
+  set -l last_status $status
+  
+And after that, you can set a string if it not zero::
+  
+  # Prompt status only if it's not 0
+  set -l stat
+  if test $last_status -ne 0
+      set stat (set_color red)"[$last_status]"(set_color normal)
+  end
+
+And to print it, we add it to our ``string join``::
+
+  string join '' -- (set_color green) (prompt_pwd) (set_color normal) $stat '>'
+  
+If ``$last_status`` was 0, ``$stat`` is empty, and so it will simply disappear.
+
+So our entire prompt is now::
+
+  function fish_prompt
+      set -l last_status $status
+      # Prompt status only if it's not 0
+      set -l stat
+      if test $last_status -ne 0
+          set stat (set_color red)"[$last_status]"(set_color normal)
+      end
+
+      string join '' -- (set_color green) (prompt_pwd) (set_color normal) $stat '>'
+  end
+
+And it looks like:
+
+.. role:: green
+.. role:: red
+.. parsed-literal::
+    :class: highlight
+
+    :green:`~/M/L/Oneknowing`\ :red:`[1]`>_
+
+after we run ``false`` (which returns 1).
+
+Where to go from here?
+----------------------
+
+We have now built a simple but working and usable prompt, but of course more can be done.
+
+- Fish offers more helper functions:
+  - ``prompt_login`` to describe the user/hostname/container or ``prompt_hostname`` to describe just the host
+  - ``fish_is_root_user`` to help with changing the symbol for root.
+  - ``fish_vcs_prompt`` to show version control information (or ``fish_git_prompt`` / ``fish_hg_prompt`` / ``fish_svn_prompt`` to limit it to specific systems)
+- You can add a right prompt by changing :doc:`fish_right_prompt <cmds/fish_right_prompt>` or a vi-mode prompt by changing :doc:`fish_mode_prompt <cmds/fish_mode_prompt>`.
+- Some prompts have interesting or advanced features
+  - Add the time when the prompt was printed
+  - Show various integrations like python's venv
+  - Color the parts differently.
+
+You can look at fish's sample prompts for inspiration. Open up :doc:`fish_config <cmds/fish_config>`, find one you like and pick it. For example::
+
+  fish_config prompt show # <- shows all the sample prompts
+  fish_config prompt choose disco # <- this picks the "disco" prompt for this session
+  funced fish_prompt # <- opens fish_prompt in your editor, and reloads it once the editor exits
diff --git a/doc_src/python_docs_theme/static/pydoctheme.css b/doc_src/python_docs_theme/static/pydoctheme.css
index 6d478f8a7..4f8b625da 100644
--- a/doc_src/python_docs_theme/static/pydoctheme.css
+++ b/doc_src/python_docs_theme/static/pydoctheme.css
@@ -617,6 +617,7 @@ div.documentwrapper {
 .gray { color: #777 }
 .purple { color: #551a8b; font-weight: bold; }
 .red { color: #FF0000; }
+.green { color: #00FF00; }
 
 /* Color based on the Name.Function (.nf) class from pygments.css. */
 .command { color: #005fd7 }
diff --git a/share/functions/help.fish b/share/functions/help.fish
index 4990d9062..4c99d34f6 100644
--- a/share/functions/help.fish
+++ b/share/functions/help.fish
@@ -149,6 +149,8 @@ function help --description 'Show help for the fish shell'
             set fish_help_page faq.html
         case fish-for-bash-users
             set fish_help_page fish_for_bash_users.html
+        case custom-prompt
+            set fish_help_page prompt.html
         case $faqpages
             set fish_help_page "faq.html#$fish_help_item"
         case $for_bash_pages

From 1ab24e4048b1486877b5c657383fc83f16221d11 Mon Sep 17 00:00:00 2001
From: elyashiv <elyashi.horovitz@gmail.com>
Date: Wed, 5 Jul 2023 16:58:48 +0000
Subject: [PATCH 136/200] [jobs.cpp] add escaping for job comamnd

(cherry picked from commit 4ea867bc55c6953a48ca5010328bc6136c74b61a)
---
 src/builtins/jobs.cpp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/builtins/jobs.cpp b/src/builtins/jobs.cpp
index 994eade9c..deac2bcfe 100644
--- a/src/builtins/jobs.cpp
+++ b/src/builtins/jobs.cpp
@@ -72,7 +72,10 @@ static void builtin_jobs_print(const job_t *j, int mode, int header, io_streams_
 
             out.append(j->is_stopped() ? _(L"stopped") : _(L"running"));
             out.append(L"\t");
-            out.append(j->command_wcstr());
+
+            wcstring cmd = escape_string(j->command(), ESCAPE_NO_PRINTABLES);
+            out.append(cmd);
+
             out.append(L"\n");
             streams.out.append(out);
             break;

From 51d5764fb277e1d291f861ed7a60e8786f0c1eb0 Mon Sep 17 00:00:00 2001
From: elyashiv <elyashi.horovitz@gmail.com>
Date: Sun, 9 Jul 2023 16:44:08 +0000
Subject: [PATCH 137/200] [jobs.cpp] added const to escaped cmd string

(cherry picked from commit 4a2c7e38d069cbc7d06988236994d7b88654b423)
---
 src/builtins/jobs.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/builtins/jobs.cpp b/src/builtins/jobs.cpp
index deac2bcfe..d319dd05f 100644
--- a/src/builtins/jobs.cpp
+++ b/src/builtins/jobs.cpp
@@ -73,7 +73,7 @@ static void builtin_jobs_print(const job_t *j, int mode, int header, io_streams_
             out.append(j->is_stopped() ? _(L"stopped") : _(L"running"));
             out.append(L"\t");
 
-            wcstring cmd = escape_string(j->command(), ESCAPE_NO_PRINTABLES);
+            const wcstring cmd = escape_string(j->command(), ESCAPE_NO_PRINTABLES);
             out.append(cmd);
 
             out.append(L"\n");

From 2d1a6561e193c02b9007df6cd0ad7c10ee32216c Mon Sep 17 00:00:00 2001
From: elyashiv <elyashi.horovitz@gmail.com>
Date: Sun, 9 Jul 2023 16:44:25 +0000
Subject: [PATCH 138/200] [tests] added test for escaped job summary

(cherry picked from commit 3fbff14e9b22545eb8c49711202c557383f1ce17)
---
 tests/checks/jobs-are-escaped.fish | 11 +++++++++++
 1 file changed, 11 insertions(+)
 create mode 100644 tests/checks/jobs-are-escaped.fish

diff --git a/tests/checks/jobs-are-escaped.fish b/tests/checks/jobs-are-escaped.fish
new file mode 100644
index 000000000..76a8722c1
--- /dev/null
+++ b/tests/checks/jobs-are-escaped.fish
@@ -0,0 +1,11 @@
+# RUN: %fish %s
+
+# Ensure that jobs are printed with new lines escaped
+
+sleep \
+100 &
+
+jobs
+#CHECK: Job	Group{{.*}}
+# CHECK: 1{{.*\t}}sleep \\\n100 &
+kill %1

From ef43069a06a981cd7cc429be4531633f2f701ace Mon Sep 17 00:00:00 2001
From: Fabian Boehm <FHomborg@gmail.com>
Date: Wed, 19 Jul 2023 18:07:03 +0200
Subject: [PATCH 139/200] completions/pactl: Fix matching objects

This didn't work for something like `pactl set-card-profile foo
<TAB>`,
because it didn't allow for the card name, as it would just print the
index again and again.

(cherry picked from commit 5f26c56ed546b3a63adc4dfeca1767e5cf3463ce)
---
 share/completions/pactl.fish | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/share/completions/pactl.fish b/share/completions/pactl.fish
index 67bc4cf42..6da1b8872 100644
--- a/share/completions/pactl.fish
+++ b/share/completions/pactl.fish
@@ -18,15 +18,15 @@ else
 end
 
 function __fish_pa_complete_type
-    pactl list short $argv
-    # The default is to show the number, then the name and then some info - also show the name, then the number as it's a bit friendlier
-    pactl list short $argv | string replace -r '(\w+)\t([-\w]+)' '$2\t$1'
+    # Print a completion candidate for the object type (like "card" or "sink"),
+    # with a description.
+    # Pa allows both a numerical index and a name
+    pactl list short $argv | string replace -rf '(\d+)\s+(\S+)(\s+.*)?' '$2\t$1$3\n$1\t$2$3'
 end
 
 function __fish_pa_print_type
-    pactl list short $argv
-    # Pa allows both a numerical index and a name
-    pactl list short $argv | string replace -r '(\w+)\t.*' '$1'
+    # Print just the object, without description
+    __fish_pa_complete_type $argv | string replace -r '\t.*' ''
 end
 
 function __fish_pa_list_ports

From f116a81250a46493267a2a6ceb8f6b086a346cbf Mon Sep 17 00:00:00 2001
From: Fabian Boehm <FHomborg@gmail.com>
Date: Tue, 25 Jul 2023 16:42:24 +0200
Subject: [PATCH 140/200] Make default theme use named colors only

This gives us the biggest chance that these are *visible* in the
terminal, which allows people to choose something nicer.

It changes two colors - the autosuggestion and the pager
description (i.e. the completion descriptions in the pager).

In a bunch of terminals I've tested these are pretty similar - for the
most part brblack for the suggestions is a bit brighter than 555, and
yellow for the descriptions is less blue
than the original.

We could also make the descriptions brblack, but that's for later.

Technically we are a bit naughty in having a few foreground and
background pairs that might not be visible,
but there's nothing we can do if someone makes white invisible on brblack.

Fixes #9913
Fixes #3443

(cherry picked from commit ed881bcdd8d7351c5b48daf22ca6e3d9344c2d5d)
---
 share/functions/__fish_config_interactive.fish   | 10 ++++++----
 share/tools/web_config/themes/fish default.theme |  7 +++++--
 2 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/share/functions/__fish_config_interactive.fish b/share/functions/__fish_config_interactive.fish
index a0872ac5b..ccb84dce8 100644
--- a/share/functions/__fish_config_interactive.fish
+++ b/share/functions/__fish_config_interactive.fish
@@ -31,6 +31,10 @@ if status is-interactive
 end" >$__fish_config_dir/config.fish
 
         # Regular syntax highlighting colors
+        # NOTE: These should only use named colors
+        # to give us the maximum chance they are
+        # visible in whatever terminal setup.
+        #
         __init_uvar fish_color_normal normal
         __init_uvar fish_color_command blue
         __init_uvar fish_color_param cyan
@@ -41,7 +45,7 @@ end" >$__fish_config_dir/config.fish
         __init_uvar fish_color_operator brcyan
         __init_uvar fish_color_end green
         __init_uvar fish_color_quote yellow
-        __init_uvar fish_color_autosuggestion 555 brblack
+        __init_uvar fish_color_autosuggestion brblack
         __init_uvar fish_color_user brgreen
         __init_uvar fish_color_host normal
         __init_uvar fish_color_host_remote yellow
@@ -57,14 +61,12 @@ end" >$__fish_config_dir/config.fish
         # Background color for selections
         __init_uvar fish_color_selection white --bold --background=brblack
 
-        # XXX fish_color_cancel was added in 2.6, but this was added to post-2.3 initialization
-        # when 2.4 and 2.5 were already released
         __init_uvar fish_color_cancel -r
 
         # Pager colors
         __init_uvar fish_pager_color_prefix normal --bold --underline
         __init_uvar fish_pager_color_completion normal
-        __init_uvar fish_pager_color_description B3A06D yellow -i
+        __init_uvar fish_pager_color_description yellow -i
         __init_uvar fish_pager_color_progress brwhite --background=cyan
         __init_uvar fish_pager_color_selected_background -r
 
diff --git a/share/tools/web_config/themes/fish default.theme b/share/tools/web_config/themes/fish default.theme
index 380ed306d..d6cacbf5e 100644
--- a/share/tools/web_config/themes/fish default.theme	
+++ b/share/tools/web_config/themes/fish default.theme	
@@ -1,4 +1,7 @@
 # name: fish default
+# NOTE: These should only use named colors
+# to give us the maximum chance they are
+# visible in whatever terminal setup.
 
 fish_color_normal normal
 fish_color_command blue
@@ -18,10 +21,10 @@ fish_color_cwd green
 fish_color_valid_path --underline
 fish_color_cwd_root red
 fish_color_user brgreen
-fish_color_autosuggestion 555 brblack
+fish_color_autosuggestion brblack
 fish_pager_color_completion normal
 fish_color_host normal
-fish_pager_color_description B3A06D yellow -i
+fish_pager_color_description yellow -i
 fish_color_cancel -r
 fish_pager_color_prefix normal --bold --underline
 fish_pager_color_progress brwhite --background=cyan

From 6df2fac13223d99df4baa6fb49d9bfd67f867fca Mon Sep 17 00:00:00 2001
From: Fabian Boehm <FHomborg@gmail.com>
Date: Mon, 25 Dec 2023 18:46:23 +0100
Subject: [PATCH 141/200] prompt_pwd: Fix missing --

Fixes #10169

(cherry picked from commit b1a1a3b0a72211310e96d5f14631519df8bd3438)
---
 share/functions/prompt_pwd.fish | 2 +-
 tests/checks/prompt.fish        | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/share/functions/prompt_pwd.fish b/share/functions/prompt_pwd.fish
index 31d10dee6..89d66b40e 100644
--- a/share/functions/prompt_pwd.fish
+++ b/share/functions/prompt_pwd.fish
@@ -45,7 +45,7 @@ function prompt_pwd --description 'short CWD for the prompt'
                 continue
             end
 
-            string join / (string replace -ar '(\.?[^/]{'"$fish_prompt_pwd_dir_length"'})[^/]*/' '$1/' $tmp) $full
+            string join / -- (string replace -ar -- '(\.?[^/]{'"$fish_prompt_pwd_dir_length"'})[^/]*/' '$1/' $tmp) $full
         end
     end
 end
diff --git a/tests/checks/prompt.fish b/tests/checks/prompt.fish
index d2ddf492a..a600dfff0 100644
--- a/tests/checks/prompt.fish
+++ b/tests/checks/prompt.fish
@@ -11,3 +11,6 @@ prompt_pwd -D 2 /usr/share/fish/tools/web_config/sample_prompts
 
 prompt_pwd -D 0 /usr/share/fish/tools/web_config/sample_prompts
 # CHECK: /u/s/f/t/w/s
+
+prompt_pwd -d1 -D 3 /usr/share/fish/tools/web_config/-sample_prompts
+# CHECK: /u/s/f/tools/web_config/-sample_prompts

From ecf8ac6f6663c9a06bfd2f3a062f9c7539c045b5 Mon Sep 17 00:00:00 2001
From: David Adam <zanchey@ucc.gu.uwa.edu.au>
Date: Tue, 26 Dec 2023 23:24:00 +0800
Subject: [PATCH 142/200] CHANGELOG: work on 3.7.0

---
 CHANGELOG.rst | 26 +++++++++++++++-----------
 1 file changed, 15 insertions(+), 11 deletions(-)

diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index 41d5468d5..dcc31141c 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -1,11 +1,11 @@
 fish 3.7.0 (released ???)
 ====================================
 
-.. ignore: 5319 7375 9500 9515 9528 9538 9565 9667 9681 9690 9692 9704 9706 9707 9713 9718 9719 9721 9722 9728 9732 9734 9738 9741 9742 9743 9926 9932
+.. ignore: 3443 5319 7375 9500 9515 9528 9538 9565 9667 9681 9690 9692 9704 9706 9707 9713 9718 9719 9721 9722 9728 9732 9734 9738 9741 9742 9743 9753 9759 9776 9783 9804 9812 9825 9848 9850 9871 9875 9878 9880 9882 9899 9910 9914 9915 9919 9926 9932
 
 Notable improvements and fixes
 ------------------------------
-
+- Performance improvements for command completions and globbing, where supported by the operating system, especially on slow filesystems such as NFS (:issue:`9891`, :issue:`9931`, :issue:`10032`, :issue:`10052`).
 
 Deprecations and removed features
 ---------------------------------
@@ -15,11 +15,8 @@ Deprecations and removed features
 Scripting improvements
 ----------------------
 - Running ``exit`` with a negative number no longer crashes fish (:issue:`9659`).
-- ``fish -c`` will now return a non-zero status if parsing failed (:issue:`9888`).
-- Globbing will now use fewer system calls in some cases, especially with a trailing slash (``/path/a*/``), and for searching for commands.
-  Some of this requires filesystem support - the d_type field in the dirent struct returned by readdir(3).
-  This improves performance for command completions and globbing, especially on slow filesystems like NFS (:issue:`9891`, :issue:`9931`, :issue:`10032`, :issue:`10052`).
-- The ``jobs`` builtin will now escape the commands it prints (:issue:`9875`, :issue:`9808`).
+- ``fish --command`` will now return a non-zero status if parsing failed (:issue:`9888`).
+- The ``jobs`` builtin will now escape the commands it prints (:issue:`9808`).
 - ``string repeat`` no longer overflows if the count is a multiple of the chunk size (:issue:`9900`).
 - The ``builtin`` builtin will now properly error out with invalid arguments instead of doing nothing and returning true (:issue:`9942`).
 - ``command time`` in a pipeline is allowed again, as is ``command and`` and ``command or`` (:issue:`9985`).
@@ -37,9 +34,9 @@ Interactive improvements
 - Working directory reporting is enabled for iTerm2 (:issue:`9955`).
 - Completing commands as root includes commands not owned by root, fixing a regression introduced in fish 3.2.0 (:issue:`9699`).
 - Selection uses ``fish_color_selection`` for the foreground and background colors, as intended, rather than just the background (:issue:`9717`).
-- The completion pager will no longer sometimes skip the last entry when moving through a long list (:issue:`9812`, :issue:`9833`).
+- The completion pager will no longer sometimes skip the last entry when moving through a long list (:issue:`9833`).
 - The interactive ``history delete`` interface now allows specifying index ranges like "1..5" (:issue:`9736`).
-- Command completion will now call the stock manpath on macOS instead of a potential homebrew version. This prevents awkward error messages (:issue:`9817`).
+- Command completion will now call the stock ``manpath`` on macOS, instead of a potential Homebrew version. This prevents awkward error messages (:issue:`9817`).
 - A new bind function ``history-pager-delete``, bound to :kbd:``Shift`` + :kbd:``Delete`` by default, will delete the currently-selected history pager item from history (:issue:`9454`).
 - ``fish_key_reader`` will now use printable characters as-is, so pressing "ö" no longer leads to it telling you to bind ``\u00F6`` (:issue:`9986`).
 - fish can now be configured to wait a specified amount of time for a multi-key sequence to be completed,  instead of waiting indefinitely. For example, this makes binding ``kj`` to switching modes in vi mode possible.
@@ -54,15 +51,20 @@ Interactive improvements
 Improved prompts
 ^^^^^^^^^^^^^^^^
 - The default theme now only uses named colors, so it will track the terminal's palette (:issue:`9913`).
-- The Dracula theme has now been synced with upstream (:issue:`9807`).
+- The Dracula theme has now been synced with upstream (:issue:`9807`); use ``fish_config`` to re-apply it to pick up the changes.
 - ``fish_vcs_prompt`` now also supports fossil (:issue:`9497`).
 
 Completions
 ^^^^^^^^^^^
 - Added completions for:
+  - ``age`` and ``age-keygen`` (:issue:`9813`)
   - ``ar`` (:issue:`9720`)
+  - ``blender`` (:issue:`9905`)
+  - ``gimp`` (:issue:`9904`)
   - ``gojq`` (:issue:`9740`)
+  - ``horcrux`` (:issue:`9922`)
   - ``iwctl`` (:issue:`6884`)
+  - ``krita`` (:issue:`9903`)
   - ``qjs`` (:issue:`9723`)
   - ``qjsc`` (:issue:`9731`)
   - ``rpm-ostool`` (:issue:`9669`)
@@ -75,10 +77,12 @@ Completions
 Other improvements
 ------------------
 - Improvements and corrections to the documentation.
+- The Web-based configuration now uses a more readable style when printed, such as for a keybinding reference (:issue:`9828`)
+- Updates to the German translations (:issue:`9824`)
 
 For distributors
 ----------------
-- Fish will now also look for libterminfo, which is what NetBSD curses calls libtinfo (:issue:`9794`).
+- The CMake configure step will now also look for libterminfo as an alternative name for libtinfo, as used in NetBSD curses (:issue:`9794`).
 
 fish 3.6.4 (released December 5, 2023)
 ======================================

From 7c21e9c36e6ef2be92b654353e497bec0a7b720a Mon Sep 17 00:00:00 2001
From: figurantpp <figurantpp@protonmail.com>
Date: Fri, 18 Aug 2023 21:45:42 -0300
Subject: [PATCH 143/200] Removed type declarations from node descriptions

(cherry picked from commit 5a934e7ae313fba50d6336bfa910e578f0fefc49)
---
 share/completions/node.fish | 318 ++++++++++++++++++------------------
 1 file changed, 159 insertions(+), 159 deletions(-)

diff --git a/share/completions/node.fish b/share/completions/node.fish
index e1e73d851..ffe63c4e6 100644
--- a/share/completions/node.fish
+++ b/share/completions/node.fish
@@ -17,172 +17,172 @@ complete -c node -l trace-deprecation -d 'Show stack traces on deprecations'
 complete -c node -l throw-deprecation -d 'Throw errors on deprecations'
 complete -c node -l v8-options -d 'Print v8 command line options'
 complete -c node -l max-stack-size -d 'Set max v8 stack size (bytes)'
-complete -c node -l use_strict -d 'enforce strict mode. type: bool default: false'
-complete -c node -l es5_readonly -d 'activate correct semantics for inheriting readonliness. type: bool default: false'
-complete -c node -l es52_globals -d 'activate new semantics for global var declarations. type: bool default: false'
-complete -c node -l harmony_typeof -d 'enable harmony semantics for typeof. type: bool default: false'
-complete -c node -l harmony_scoping -d 'enable harmony block scoping. type: bool default: false'
-complete -c node -l harmony_modules -d 'enable harmony modules (implies block scoping). type: bool default: false'
-complete -c node -l harmony_proxies -d 'enable harmony proxies. type: bool default: false'
-complete -c node -l harmony_collections -d 'enable harmony collections (sets, maps, and weak maps). type: bool default: false'
-complete -c node -l harmony -d 'enable all harmony features (except typeof). type: bool default: false'
-complete -c node -l packed_arrays -d 'optimizes arrays that have no holes. type: bool default: false'
-complete -c node -l smi_only_arrays -d 'tracks arrays with only smi values. type: bool default: true'
-complete -c node -l clever_optimizations -d 'Optimize object size, Array shift, DOM strings and string +. type: bool default: true'
-complete -c node -l unbox_double_arrays -d 'automatically unbox arrays of doubles. type: bool default: true'
-complete -c node -l string_slices -d 'use string slices. type: bool default: true'
-complete -c node -l crankshaft -d 'use crankshaft. type: bool default: true'
-complete -c node -l hydrogen_filter -d 'optimization filter. type: string default:'
-complete -c node -l use_range -d 'use hydrogen range analysis. type: bool default: true'
-complete -c node -l eliminate_dead_phis -d 'eliminate dead phis. type: bool default: true'
-complete -c node -l use_gvn -d 'use hydrogen global value numbering. type: bool default: true'
-complete -c node -l use_canonicalizing -d 'use hydrogen instruction canonicalizing. type: bool default: true'
-complete -c node -l use_inlining -d 'use function inlining. type: bool default: true'
-complete -c node -l max_inlined_source_size -d 'maximum source size in bytes considered for a single inlining. type: int default: 600'
-complete -c node -l max_inlined_nodes -d 'maximum number of AST nodes considered for a single inlining. type: int default: 196'
-complete -c node -l max_inlined_nodes_cumulative -d 'maximum cumulative number of AST nodes considered for inlining. type: int default: 196'
-complete -c node -l loop_invariant_code_motion -d 'loop invariant code motion. type: bool default: true'
-complete -c node -l collect_megamorphic_maps_from_stub_cache -d 'crankshaft harvests type feedback from stub cache. type: bool default: true'
-complete -c node -l hydrogen_stats -d 'print statistics for hydrogen. type: bool default: false'
-complete -c node -l trace_hydrogen -d 'trace generated hydrogen to file. type: bool default: false'
-complete -c node -l trace_phase -d 'trace generated IR for specified phases. type: string default: Z'
-complete -c node -l trace_inlining -d 'trace inlining decisions. type: bool default: false'
-complete -c node -l trace_alloc -d 'trace register allocator. type: bool default: false'
-complete -c node -l trace_all_uses -d 'trace all use positions. type: bool default: false'
-complete -c node -l trace_range -d 'trace range analysis. type: bool default: false'
-complete -c node -l trace_gvn -d 'trace global value numbering. type: bool default: false'
-complete -c node -l trace_representation -d 'trace representation types. type: bool default: false'
-complete -c node -l stress_pointer_maps -d 'pointer map for every instruction. type: bool default: false'
-complete -c node -l stress_environments -d 'environment for every instruction. type: bool default: false'
-complete -c node -l deopt_every_n_times -d 'deoptimize every n times a deopt point is passed. type: int default: 0'
-complete -c node -l trap_on_deopt -d 'put a break point before deoptimizing. type: bool default: false'
-complete -c node -l deoptimize_uncommon_cases -d 'deoptimize uncommon cases. type: bool default: true'
-complete -c node -l polymorphic_inlining -d 'polymorphic inlining. type: bool default: true'
-complete -c node -l use_osr -d 'use on-stack replacement. type: bool default: true'
-complete -c node -l array_bounds_checks_elimination -d 'perform array bounds checks elimination. type: bool default: false'
-complete -c node -l array_index_dehoisting -d 'perform array index dehoisting. type: bool default: false'
-complete -c node -l trace_osr -d 'trace on-stack replacement. type: bool default: false'
-complete -c node -l stress_runs -d 'number of stress runs. type: int default: 0'
-complete -c node -l optimize_closures -d 'optimize closures. type: bool default: true'
-complete -c node -l inline_construct -d 'inline constructor calls. type: bool default: true'
-complete -c node -l inline_arguments -d 'inline functions with arguments object. type: bool default: true'
-complete -c node -l loop_weight -d 'loop weight for representation inference. type: int default: 1'
-complete -c node -l optimize_for_in -d 'optimize functions containing for-in loops. type: bool default: true'
-complete -c node -l experimental_profiler -d 'enable all profiler experiments. type: bool default: true'
-complete -c node -l watch_ic_patching -d 'profiler considers IC stability. type: bool default: false'
-complete -c node -l frame_count -d 'number of stack frames inspected by the profiler. type: int default: 1'
-complete -c node -l self_optimization -d 'primitive functions trigger their own optimization. type: bool default: false'
-complete -c node -l direct_self_opt -d 'call recompile stub directly when self-optimizing. type: bool default: false'
-complete -c node -l retry_self_opt -d 're-try self-optimization if it failed. type: bool default: false'
-complete -c node -l count_based_interrupts -d 'trigger profiler ticks based on counting instead of timing. type: bool default: false'
-complete -c node -l interrupt_at_exit -d 'insert an interrupt check at function exit. type: bool default: false'
-complete -c node -l weighted_back_edges -d 'weight back edges by jump distance for interrupt triggering. type: bool default: false'
-complete -c node -l interrupt_budget -d 'execution budget before interrupt is triggered. type: int default: 5900'
-complete -c node -l type_info_threshold -d 'percentage of ICs that must have type info to allow optimization. type: int default: 15'
-complete -c node -l self_opt_count -d 'call count before self-optimization. type: int default: 130'
-complete -c node -l trace_opt_verbose -d 'extra verbose compilation tracing. type: bool default: false'
-complete -c node -l debug_code -d 'generate extra code (assertions) for debugging. type: bool default: false'
-complete -c node -l code_comments -d 'emit comments in code disassembly. type: bool default: false'
-complete -c node -l enable_sse2 -d 'enable use of SSE2 instructions if available. type: bool default: true'
-complete -c node -l enable_sse3 -d 'enable use of SSE3 instructions if available. type: bool default: true'
+complete -c node -l use_strict -d 'enforce strict mode'
+complete -c node -l es5_readonly -d 'activate correct semantics for inheriting readonliness'
+complete -c node -l es52_globals -d 'activate new semantics for global var declarations'
+complete -c node -l harmony_typeof -d 'enable harmony semantics for typeof'
+complete -c node -l harmony_scoping -d 'enable harmony block scoping'
+complete -c node -l harmony_modules -d 'enable harmony modules (implies block scoping)'
+complete -c node -l harmony_proxies -d 'enable harmony proxies'
+complete -c node -l harmony_collections -d 'enable harmony collections (sets, maps, and weak maps)'
+complete -c node -l harmony -d 'enable all harmony features (except typeof)'
+complete -c node -l packed_arrays -d 'optimizes arrays that have no holes'
+complete -c node -l smi_only_arrays -d 'tracks arrays with only smi values'
+complete -c node -l clever_optimizations -d 'Optimize object size, Array shift, DOM strings and string +'
+complete -c node -l unbox_double_arrays -d 'automatically unbox arrays of doubles'
+complete -c node -l string_slices -d 'use string slices'
+complete -c node -l crankshaft -d 'use crankshaft'
+complete -c node -l hydrogen_filter -d 'optimization filter'
+complete -c node -l use_range -d 'use hydrogen range analysis'
+complete -c node -l eliminate_dead_phis -d 'eliminate dead phis'
+complete -c node -l use_gvn -d 'use hydrogen global value numbering'
+complete -c node -l use_canonicalizing -d 'use hydrogen instruction canonicalizing'
+complete -c node -l use_inlining -d 'use function inlining'
+complete -c node -l max_inlined_source_size -d 'maximum source size in bytes considered for a single inlining'
+complete -c node -l max_inlined_nodes -d 'maximum number of AST nodes considered for a single inlining'
+complete -c node -l max_inlined_nodes_cumulative -d 'maximum cumulative number of AST nodes considered for inlining'
+complete -c node -l loop_invariant_code_motion -d 'loop invariant code motion'
+complete -c node -l collect_megamorphic_maps_from_stub_cache -d 'crankshaft harvests type feedback from stub cache'
+complete -c node -l hydrogen_stats -d 'print statistics for hydrogen'
+complete -c node -l trace_hydrogen -d 'trace generated hydrogen to file'
+complete -c node -l trace_phase -d 'trace generated IR for specified phases'
+complete -c node -l trace_inlining -d 'trace inlining decisions'
+complete -c node -l trace_alloc -d 'trace register allocator'
+complete -c node -l trace_all_uses -d 'trace all use positions'
+complete -c node -l trace_range -d 'trace range analysis'
+complete -c node -l trace_gvn -d 'trace global value numbering'
+complete -c node -l trace_representation -d 'trace representation types'
+complete -c node -l stress_pointer_maps -d 'pointer map for every instruction'
+complete -c node -l stress_environments -d 'environment for every instruction'
+complete -c node -l deopt_every_n_times -d 'deoptimize every n times a deopt point is passed'
+complete -c node -l trap_on_deopt -d 'put a break point before deoptimizing'
+complete -c node -l deoptimize_uncommon_cases -d 'deoptimize uncommon cases'
+complete -c node -l polymorphic_inlining -d 'polymorphic inlining'
+complete -c node -l use_osr -d 'use on-stack replacement'
+complete -c node -l array_bounds_checks_elimination -d 'perform array bounds checks elimination'
+complete -c node -l array_index_dehoisting -d 'perform array index dehoisting'
+complete -c node -l trace_osr -d 'trace on-stack replacement'
+complete -c node -l stress_runs -d 'number of stress runs'
+complete -c node -l optimize_closures -d 'optimize closures'
+complete -c node -l inline_construct -d 'inline constructor calls'
+complete -c node -l inline_arguments -d 'inline functions with arguments object'
+complete -c node -l loop_weight -d 'loop weight for representation inference'
+complete -c node -l optimize_for_in -d 'optimize functions containing for-in loops'
+complete -c node -l experimental_profiler -d 'enable all profiler experiments'
+complete -c node -l watch_ic_patching -d 'profiler considers IC stability'
+complete -c node -l frame_count -d 'number of stack frames inspected by the profiler'
+complete -c node -l self_optimization -d 'primitive functions trigger their own optimization'
+complete -c node -l direct_self_opt -d 'call recompile stub directly when self-optimizing'
+complete -c node -l retry_self_opt -d 're-try self-optimization if it failed'
+complete -c node -l count_based_interrupts -d 'trigger profiler ticks based on counting instead of timing'
+complete -c node -l interrupt_at_exit -d 'insert an interrupt check at function exit'
+complete -c node -l weighted_back_edges -d 'weight back edges by jump distance for interrupt triggering'
+complete -c node -l interrupt_budget -d 'execution budget before interrupt is triggered'
+complete -c node -l type_info_threshold -d 'percentage of ICs that must have type info to allow optimization'
+complete -c node -l self_opt_count -d 'call count before self-optimization'
+complete -c node -l trace_opt_verbose -d 'extra verbose compilation tracing'
+complete -c node -l debug_code -d 'generate extra code (assertions) for debugging'
+complete -c node -l code_comments -d 'emit comments in code disassembly'
+complete -c node -l enable_sse2 -d 'enable use of SSE2 instructions if available'
+complete -c node -l enable_sse3 -d 'enable use of SSE3 instructions if available'
 complete -c node -l enable_sse4_1 -d 'enable use of SSE4'
-complete -c node -l enable_cmov -d 'enable use of CMOV instruction if available. type: bool default: true'
-complete -c node -l enable_rdtsc -d 'enable use of RDTSC instruction if available. type: bool default: true'
-complete -c node -l enable_sahf -d 'enable use of SAHF instruction if available (X64 only). type: bool default: true'
-complete -c node -l enable_vfp3 -d 'enable use of VFP3 instructions if available - this implies enabling ARMv7 instructions (ARM only). type: bool default: true'
-complete -c node -l enable_armv7 -d 'enable use of ARMv7 instructions if available (ARM only). type: bool default: true'
-complete -c node -l enable_fpu -d 'enable use of MIPS FPU instructions if available (MIPS only). type: bool default: true'
-complete -c node -l expose_natives_as -d 'expose natives in global object. type: string default: NULL'
-complete -c node -l expose_debug_as -d 'expose debug in global object. type: string default: NULL'
-complete -c node -l expose_gc -d 'expose gc extension. type: bool default: false'
-complete -c node -l expose_externalize_string -d 'expose externalize string extension. type: bool default: false'
-complete -c node -l stack_trace_limit -d 'number of stack frames to capture. type: int default: 10'
-complete -c node -l builtins_in_stack_traces -d 'show built-in functions in stack traces. type: bool default: false'
-complete -c node -l disable_native_files -d 'disable builtin natives files. type: bool default: false'
-complete -c node -l inline_new -d 'use fast inline allocation. type: bool default: true'
-complete -c node -l stack_trace_on_abort -d 'print a stack trace if an assertion failure occurs. type: bool default: true'
-complete -c node -l trace -d 'trace function calls. type: bool default: false'
-complete -c node -l mask_constants_with_cookie -d 'use random jit cookie to mask large constants. type: bool default: true'
-complete -c node -l lazy -d 'use lazy compilation. type: bool default: true'
-complete -c node -l trace_opt -d 'trace lazy optimization. type: bool default: false'
-complete -c node -l trace_opt_stats -d 'trace lazy optimization statistics. type: bool default: false'
-complete -c node -l opt -d 'use adaptive optimizations. type: bool default: true'
-complete -c node -l always_opt -d 'always try to optimize functions. type: bool default: false'
-complete -c node -l prepare_always_opt -d 'prepare for turning on always opt. type: bool default: false'
-complete -c node -l sparkplug -d 'use non-optimizing sparkplug compiler. type: bool default: false'
-complete -c node -l always_sparkplug -d 'always use non-optimizing sparkplug compiler. type: bool default: false'
-complete -c node -l trace_deopt -d 'trace deoptimization. type: bool default: false'
-complete -c node -l min_preparse_length -d 'minimum length for automatic enable preparsing. type: int default: 1024'
-complete -c node -l always_full_compiler -d 'try to use the dedicated run-once backend for all code. type: bool default: false'
-complete -c node -l trace_bailout -d 'print reasons for falling back to using the classic V8 backend. type: bool default: false'
-complete -c node -l compilation_cache -d 'enable compilation cache. type: bool default: true'
-complete -c node -l cache_prototype_transitions -d 'cache prototype transitions. type: bool default: true'
-complete -c node -l trace_debug_json -d 'trace debugging JSON request/response. type: bool default: false'
-complete -c node -l debugger_auto_break -d 'automatically set the debug break flag when debugger commands are in the queue. type: bool default: true'
-complete -c node -l enable_liveedit -d 'enable liveedit experimental feature. type: bool default: true'
-complete -c node -l break_on_abort -d 'always cause a debug break before aborting. type: bool default: true'
-complete -c node -l stack_size -d 'default size of stack region v8 is allowed to use (in kBytes). type: int default: 984'
+complete -c node -l enable_cmov -d 'enable use of CMOV instruction if available'
+complete -c node -l enable_rdtsc -d 'enable use of RDTSC instruction if available'
+complete -c node -l enable_sahf -d 'enable use of SAHF instruction if available (X64 only)'
+complete -c node -l enable_vfp3 -d 'enable use of VFP3 instructions if available - this implies enabling ARMv7 instructions (ARM only)'
+complete -c node -l enable_armv7 -d 'enable use of ARMv7 instructions if available (ARM only)'
+complete -c node -l enable_fpu -d 'enable use of MIPS FPU instructions if available (MIPS only)'
+complete -c node -l expose_natives_as -d 'expose natives in global object'
+complete -c node -l expose_debug_as -d 'expose debug in global object'
+complete -c node -l expose_gc -d 'expose gc extension'
+complete -c node -l expose_externalize_string -d 'expose externalize string extension'
+complete -c node -l stack_trace_limit -d 'number of stack frames to capture'
+complete -c node -l builtins_in_stack_traces -d 'show built-in functions in stack traces'
+complete -c node -l disable_native_files -d 'disable builtin natives files'
+complete -c node -l inline_new -d 'use fast inline allocation'
+complete -c node -l stack_trace_on_abort -d 'print a stack trace if an assertion failure occurs'
+complete -c node -l trace -d 'trace function calls'
+complete -c node -l mask_constants_with_cookie -d 'use random jit cookie to mask large constants'
+complete -c node -l lazy -d 'use lazy compilation'
+complete -c node -l trace_opt -d 'trace lazy optimization'
+complete -c node -l trace_opt_stats -d 'trace lazy optimization statistics'
+complete -c node -l opt -d 'use adaptive optimizations'
+complete -c node -l always_opt -d 'always try to optimize functions'
+complete -c node -l prepare_always_opt -d 'prepare for turning on always opt'
+complete -c node -l sparkplug -d 'use non-optimizing sparkplug compiler'
+complete -c node -l always_sparkplug -d 'always use non-optimizing sparkplug compiler'
+complete -c node -l trace_deopt -d 'trace deoptimization'
+complete -c node -l min_preparse_length -d 'minimum length for automatic enable preparsing'
+complete -c node -l always_full_compiler -d 'try to use the dedicated run-once backend for all code'
+complete -c node -l trace_bailout -d 'print reasons for falling back to using the classic V8 backend'
+complete -c node -l compilation_cache -d 'enable compilation cache'
+complete -c node -l cache_prototype_transitions -d 'cache prototype transitions'
+complete -c node -l trace_debug_json -d 'trace debugging JSON request/response'
+complete -c node -l debugger_auto_break -d 'automatically set the debug break flag when debugger commands are in the queue'
+complete -c node -l enable_liveedit -d 'enable liveedit experimental feature'
+complete -c node -l break_on_abort -d 'always cause a debug break before aborting'
+complete -c node -l stack_size -d 'default size of stack region v8 is allowed to use (in kBytes)'
 complete -c node -l max_stack_trace_source_length -d 'maximum length of function source code printed in a stack trace'
-complete -c node -l always_inline_smi_code -d 'always inline smi code in non-opt code. type: bool default: false'
-complete -c node -l max_new_space_size -d 'max size of the new generation (in kBytes). type: int default: 0'
-complete -c node -l max_old_space_size -d 'max size of the old generation (in Mbytes). type: int default: 0'
-complete -c node -l max_executable_size -d 'max size of executable memory (in Mbytes). type: int default: 0'
-complete -c node -l gc_global -d 'always perform global GCs. type: bool default: false'
-complete -c node -l gc_interval -d 'garbage collect after <n> allocations. type: int default: -1'
-complete -c node -l trace_gc -d 'print one trace line following each garbage collection. type: bool default: false'
-complete -c node -l trace_gc_nvp -d 'print one detailed trace line in name=value format after each garbage collection. type: bool default: false'
-complete -c node -l print_cumulative_gc_stat -d 'print cumulative GC statistics in name=value format on exit. type: bool default: false'
-complete -c node -l trace_gc_verbose -d 'print more details following each garbage collection. type: bool default: false'
-complete -c node -l trace_fragmentation -d 'report fragmentation for old pointer and data pages. type: bool default: false'
-complete -c node -l collect_maps -d 'garbage collect maps from which no objects can be reached. type: bool default: true'
-complete -c node -l flush_code -d 'flush code that we expect not to use again before full gc. type: bool default: true'
-complete -c node -l incremental_marking -d 'use incremental marking. type: bool default: true'
-complete -c node -l incremental_marking_steps -d 'do incremental marking steps. type: bool default: true'
-complete -c node -l trace_incremental_marking -d 'trace progress of the incremental marking. type: bool default: false'
+complete -c node -l always_inline_smi_code -d 'always inline smi code in non-opt code'
+complete -c node -l max_new_space_size -d 'max size of the new generation (in kBytes)'
+complete -c node -l max_old_space_size -d 'max size of the old generation (in Mbytes)'
+complete -c node -l max_executable_size -d 'max size of executable memory (in Mbytes)'
+complete -c node -l gc_global -d 'always perform global GCs'
+complete -c node -l gc_interval -d 'garbage collect after <n> allocations'
+complete -c node -l trace_gc -d 'print one trace line following each garbage collection'
+complete -c node -l trace_gc_nvp -d 'print one detailed trace line in name=value format after each garbage collection'
+complete -c node -l print_cumulative_gc_stat -d 'print cumulative GC statistics in name=value format on exit'
+complete -c node -l trace_gc_verbose -d 'print more details following each garbage collection'
+complete -c node -l trace_fragmentation -d 'report fragmentation for old pointer and data pages'
+complete -c node -l collect_maps -d 'garbage collect maps from which no objects can be reached'
+complete -c node -l flush_code -d 'flush code that we expect not to use again before full gc'
+complete -c node -l incremental_marking -d 'use incremental marking'
+complete -c node -l incremental_marking_steps -d 'do incremental marking steps'
+complete -c node -l trace_incremental_marking -d 'trace progress of the incremental marking'
 complete -c node -l use_idle_notification -d 'Use idle notification to reduce memory footprint'
 complete -c node -l send_idle_notification -d 'Send idle notification between stress runs'
-complete -c node -l use_ic -d 'use inline caching. type: bool default: true'
-complete -c node -l native_code_counters -d 'generate extra code for manipulating stats counters. type: bool default: false'
-complete -c node -l always_compact -d 'Perform compaction on every full GC. type: bool default: false'
-complete -c node -l lazy_sweeping -d 'Use lazy sweeping for old pointer and data spaces. type: bool default: true'
-complete -c node -l never_compact -d 'Never perform compaction on full GC - testing only. type: bool default: false'
-complete -c node -l compact_code_space -d 'Compact code space on full non-incremental collections. type: bool default: true'
+complete -c node -l use_ic -d 'use inline caching'
+complete -c node -l native_code_counters -d 'generate extra code for manipulating stats counters'
+complete -c node -l always_compact -d 'Perform compaction on every full GC'
+complete -c node -l lazy_sweeping -d 'Use lazy sweeping for old pointer and data spaces'
+complete -c node -l never_compact -d 'Never perform compaction on full GC - testing only'
+complete -c node -l compact_code_space -d 'Compact code space on full non-incremental collections'
 complete -c node -l cleanup_code_caches_at_gc -d 'Flush inline caches prior to mark compact collection and flush code caches in maps during mark compact cycle'
 complete -c node -l random_seed -d 'Default seed for initializing random generator (0, the default, means to use system random)'
-complete -c node -l use_verbose_printer -d 'allows verbose printing. type: bool default: true'
-complete -c node -l allow_natives_syntax -d 'allow natives syntax. type: bool default: false'
-complete -c node -l trace_sim -d 'Trace simulator execution. type: bool default: false'
-complete -c node -l check_icache -d 'Check icache flushes in ARM and MIPS simulator. type: bool default: false'
-complete -c node -l stop_sim_at -d 'Simulator stop after x number of instructions. type: int default: 0'
-complete -c node -l sim_stack_alignment -d 'Stack alignment in bytes in simulator (4 or 8, 8 is default). type: int default: 8'
-complete -c node -l trace_exception -d 'print stack trace when throwing exceptions. type: bool default: false'
+complete -c node -l use_verbose_printer -d 'allows verbose printing'
+complete -c node -l allow_natives_syntax -d 'allow natives syntax'
+complete -c node -l trace_sim -d 'Trace simulator execution'
+complete -c node -l check_icache -d 'Check icache flushes in ARM and MIPS simulator'
+complete -c node -l stop_sim_at -d 'Simulator stop after x number of instructions'
+complete -c node -l sim_stack_alignment -d 'Stack alignment in bytes in simulator (4 or 8, 8 is default)'
+complete -c node -l trace_exception -d 'print stack trace when throwing exceptions'
 complete -c node -l preallocate_message_memory -d 'preallocate some memory to build stack traces'
-complete -c node -l randomize_hashes -d 'randomize hashes to avoid predictable hash collisions (with snapshots this option cannot override the baked-in seed). type: bool default: true'
-complete -c node -l hash_seed -d 'Fixed seed to use to hash property keys (0 means random) (with snapshots this option cannot override the baked-in seed). type: int default: 0'
-complete -c node -l preemption -d 'activate a 100ms timer that switches between V8 threads. type: bool default: false'
-complete -c node -l regexp_optimization -d 'generate optimized regexp code. type: bool default: true'
-complete -c node -l testing_bool_flag -d 'testing_bool_flag. type: bool default: true'
-complete -c node -l testing_int_flag -d 'testing_int_flag. type: int default: 13'
-complete -c node -l testing_float_flag -d 'float-flag. type: float default: 2'
-complete -c node -l testing_string_flag -d 'string-flag. type: string default: Hello, world!'
-complete -c node -l testing_prng_seed -d 'Seed used for threading test randomness. type: int default: 42'
-complete -c node -l testing_serialization_file -d 'file in which to serialize heap. type: string default: /tmp/serdes'
-complete -c node -l help -d 'Print usage message, including flags, on console. type: bool default: true'
-complete -c node -l dump_counters -d 'Dump counters on exit. type: bool default: false'
-complete -c node -l debugger -d 'Enable JavaScript debugger. type: bool default: false'
-complete -c node -l remote_debugger -d 'Connect JavaScript debugger to the debugger agent in another process. type: bool default: false'
-complete -c node -l debugger_agent -d 'Enable debugger agent. type: bool default: false'
-complete -c node -l debugger_port -d 'Port to use for remote debugging. type: int default: 5858'
-complete -c node -l map_counters -d 'Map counters to a file. type: string default:'
+complete -c node -l randomize_hashes -d 'randomize hashes to avoid predictable hash collisions (with snapshots this option cannot override the baked-in seed)'
+complete -c node -l hash_seed -d 'Fixed seed to use to hash property keys (0 means random) (with snapshots this option cannot override the baked-in seed)'
+complete -c node -l preemption -d 'activate a 100ms timer that switches between V8 threads'
+complete -c node -l regexp_optimization -d 'generate optimized regexp code'
+complete -c node -l testing_bool_flag -d 'testing_bool_flag'
+complete -c node -l testing_int_flag -d 'testing_int_flag'
+complete -c node -l testing_float_flag -d 'float-flag'
+complete -c node -l testing_string_flag -d 'string-flag'
+complete -c node -l testing_prng_seed -d 'Seed used for threading test randomness'
+complete -c node -l testing_serialization_file -d 'file in which to serialize heap'
+complete -c node -l help -d 'Print usage message, including flags, on console'
+complete -c node -l dump_counters -d 'Dump counters on exit'
+complete -c node -l debugger -d 'Enable JavaScript debugger'
+complete -c node -l remote_debugger -d 'Connect JavaScript debugger to the debugger agent in another process'
+complete -c node -l debugger_agent -d 'Enable debugger agent'
+complete -c node -l debugger_port -d 'Port to use for remote debugging'
+complete -c node -l map_counters -d 'Map counters to a file'
 complete -c node -l js_arguments -d 'Pass all remaining arguments to the script'
-complete -c node -l debug_compile_events -d 'Enable debugger compile events. type: bool default: true'
-complete -c node -l debug_script_collected_events -d 'Enable debugger script collected events. type: bool default: true'
-complete -c node -l gdbjit -d 'enable GDBJIT interface (disables compacting GC). type: bool default: false'
-complete -c node -l gdbjit_full -d 'enable GDBJIT interface for all code objects. type: bool default: false'
-complete -c node -l gdbjit_dump -d 'dump elf objects with debug info to disk. type: bool default: false'
-complete -c node -l gdbjit_dump_filter -d 'dump only objects containing this substring. type: string default:'
-complete -c node -l force_marking_deque_overflows -d 'force overflows of marking deque by reducing its size to 64 words. type: bool default: false'
-complete -c node -l stress_compaction -d 'stress the GC compactor to flush out bugs (implies --force_marking_deque_overflows). type: bool default: false'
+complete -c node -l debug_compile_events -d 'Enable debugger compile events'
+complete -c node -l debug_script_collected_events -d 'Enable debugger script collected events'
+complete -c node -l gdbjit -d 'enable GDBJIT interface (disables compacting GC)'
+complete -c node -l gdbjit_full -d 'enable GDBJIT interface for all code objects'
+complete -c node -l gdbjit_dump -d 'dump elf objects with debug info to disk'
+complete -c node -l gdbjit_dump_filter -d 'dump only objects containing this substring'
+complete -c node -l force_marking_deque_overflows -d 'force overflows of marking deque by reducing its size to 64 words'
+complete -c node -l stress_compaction -d 'stress the GC compactor to flush out bugs (implies --force_marking_deque_overflows)'
 complete -c node -l log -d 'Minimal logging (no API, code, GC, suspect, or handles samples)'
 complete -c node -l log_all -d 'Log all events to the log file'
 complete -c node -l log_runtime -d 'Activate runtime system %Log call'
@@ -193,7 +193,7 @@ complete -c node -l log_handles -d 'Log global handle events'
 complete -c node -l log_snapshot_positions -d 'log positions of (de)serialized objects in the snapshot'
 complete -c node -l log_suspect -d 'Log suspect operations'
 complete -c node -l prof -d 'Log statistical profiling information (implies --log-code)'
-complete -c node -l prof_auto -d 'Used with --prof, starts profiling automatically) type: bool default: true'
+complete -c node -l prof_auto -d 'Used with --prof, starts profiling automatically)'
 complete -c node -l prof_lazy -d 'Used with --prof, only does sampling and logging when profiler is active (implies --noprof_auto)'
 complete -c node -l prof_browser_mode -d 'Used with --prof, turns on browser-compatible mode for profiling'
 complete -c node -l log_regexp -d 'Log regular expression execution'

From 8707c05b7bcd770c45ab4d4f1f21429232c73c18 Mon Sep 17 00:00:00 2001
From: David Adam <zanchey@ucc.gu.uwa.edu.au>
Date: Wed, 27 Dec 2023 22:58:33 +0800
Subject: [PATCH 144/200] CHANGELOG: work on 3.7.0

---
 CHANGELOG.rst | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index dcc31141c..af378bbbe 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -1,7 +1,7 @@
 fish 3.7.0 (released ???)
 ====================================
 
-.. ignore: 3443 5319 7375 9500 9515 9528 9538 9565 9667 9681 9690 9692 9704 9706 9707 9713 9718 9719 9721 9722 9728 9732 9734 9738 9741 9742 9743 9753 9759 9776 9783 9804 9812 9825 9848 9850 9871 9875 9878 9880 9882 9899 9910 9914 9915 9919 9926 9932
+.. ignore: 3443 5319 7375 9500 9515 9528 9538 9565 9667 9681 9690 9692 9704 9706 9707 9713 9718 9719 9721 9722 9728 9732 9734 9738 9741 9742 9743 9753 9759 9776 9783 9804 9812 9825 9848 9850 9871 9875 9878 9880 9882 9899 9910 9914 9915 9919 9926 9932 9939 9943 9956 9960 9965 9970 9972 9975 9976 9977 9982 9983
 
 Notable improvements and fixes
 ------------------------------
@@ -43,10 +43,11 @@ Interactive improvements
   The timeout can be set via the new :envvar:`fish_sequence_key_delay_ms` (:issue:`7401`), and may be set by default in future versions.
 - ``open`` no longer works around an xdg-open bug that was finally fixed and can be used to launch terminal programs again (:issue:`10045`).
 - The ``repaint-mode`` binding will now only move the cursor if there is repainting to be done. This fixes :kbd:`Alt` combination bindings in vi mode (:issue:`7910`).
-- A new ``clear-screen`` bind function is used for :kbd:`Alt`\ +\ :kbd:`l` by default. This clears the screen and repaints the existing prompt at first,
+- A new ``clear-screen`` bind function is used for :kbd:`Ctrl`\ +\ :kbd:`l` by default. This clears the screen and repaints the existing prompt at first,
   so it eliminates visible flicker unless the terminal is very slow (:issue:`10044`).
 - The ``alias`` convenience function has better support for commands with unusual characters, like ``+`` (:issue:`8720`).
 - A longstanding issue where items in the pager would sometimes display without proper formatting has been fixed (:issue:`9617`).
+- The :kbd:`Alt` +\ :kbd:`l` binding, which lists the directory of the token under the cursor, correctly expands tilde (``~``) to the home directory (:issue:`9954`).
 
 Improved prompts
 ^^^^^^^^^^^^^^^^

From 7008e0eec2c5463144b3bf7124ba973e3849046c Mon Sep 17 00:00:00 2001
From: Christian Fersch <git@chron.visiondesigns.de>
Date: Fri, 24 Nov 2023 17:03:02 +0100
Subject: [PATCH 145/200] git completion: Handle aliases referencing other
 aliases (#9992)

(cherry picked from commit 1980a225223bc8bd1ba65b5013a8b4a3e16cf096)
---
 CHANGELOG.rst              |  1 +
 share/completions/git.fish | 27 ++++++++++++++++++++++++++-
 2 files changed, 27 insertions(+), 1 deletion(-)

diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index af378bbbe..deaded63a 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -72,6 +72,7 @@ Completions
   - ``zabbix`` (:issue:`9647`)
 - The ``zfs`` completions no longer print errors about setting a read-only variable (:issue:`9705`).
 - The ``kitty`` completions have been removed in favor of keeping them upstream (:issue:`9750`).
+- ``git`` completions now support aliases that reference other aliases (:issue:`9992`).
 - Improvements to many completions.
 - Improvements to the manual page completion generator (:issue:`9787`, :issue:`9814`, :issue:`9961`).
 
diff --git a/share/completions/git.fish b/share/completions/git.fish
index 04b97cad6..54b3e4cff 100644
--- a/share/completions/git.fish
+++ b/share/completions/git.fish
@@ -625,7 +625,7 @@ end
 #                                                  but a command can be aliased multiple times)
 
 # Approximately duplicates the logic from https://github.com/git/git/blob/d486ca60a51c9cb1fe068803c3f540724e95e83a/contrib/completion/git-completion.bash#L1130
-# The Git script also finds aliases that reference other aliases via a loop but this is fine for a PoC
+# The bash script also finds aliases that reference other aliases via a loop but we handle that separately
 function __fish_git_aliased_command
     for word in (string split ' ' -- $argv)
         switch $word
@@ -648,6 +648,31 @@ git config -z --get-regexp 'alias\..*' | while read -lz alias cmdline
     # Git aliases can contain chars that variable names can't - escape them.
     set -l alias (string replace 'alias.' '' -- $alias | string escape --style=var)
     set -g __fish_git_alias_$alias $command $cmdline
+    set --append -g __fish_git_aliases $alias
+end
+
+# Resolve aliases that call another alias
+for alias in $__fish_git_aliases
+    set -l handled $alias
+
+    while true
+        set -l alias_varname __fish_git_alias_$alias
+        set -l aliased_command $$alias_varname[1][1]
+        set -l aliased_escaped (string escape --style=var -- $aliased_command)
+        set -l aliased_varname __fish_git_alias_$aliased_escaped
+        set -q $aliased_varname
+        or break
+
+        # stop infinite recursion
+        contains $aliased_escaped $handled
+        and break
+
+        # expand alias in cmdline
+        set -l aliased_cmdline $$alias_varname[1][2]
+        set -l aliased_cmdline (string replace " $aliased_command " " $$aliased_varname[1][2..-1] " -- " $aliased_cmdline ")
+        set -g $alias_varname $$aliased_varname[1][1] (string trim "$aliased_cmdline")
+        set --append handled $aliased_escaped
+    end
 end
 
 function __fish_git_using_command

From 2fe8b5d31311965f4ad9a0513333f856c3c24dfb Mon Sep 17 00:00:00 2001
From: Fabian Boehm <FHomborg@gmail.com>
Date: Thu, 28 Dec 2023 10:15:08 +0100
Subject: [PATCH 146/200] Don't replace tilde for error messages if we have no
 $HOME

This was an issue with "--no-execute", which has no variables and
therefore no $HOME:

```fish
fish --no-execute /path/to/file
```

would say the error is in `~/path/to/file`.

Instead, since this is just for a message, we simply return the
filename without doing the replacement.

Fixes #10171

Port of e3185850213b64fa6d93546e5b6b466fd14eb4e7
---
 src/expand.cpp               | 3 +++
 tests/checks/no-execute.fish | 9 +++++++++
 2 files changed, 12 insertions(+)

diff --git a/src/expand.cpp b/src/expand.cpp
index 76e3ae8e7..d28b0e9bd 100644
--- a/src/expand.cpp
+++ b/src/expand.cpp
@@ -881,6 +881,9 @@ wcstring replace_home_directory_with_tilde(const wcstring &str, const environmen
     if (string_prefixes_string(L"/", result)) {
         wcstring home_directory = L"~";
         expand_tilde(home_directory, vars);
+        // If we can't get a home directory, don't replace anything.
+        // This is the case e.g. with --no-execute.
+        if (home_directory.empty()) return result;
         if (!string_suffixes_string(L"/", home_directory)) {
             home_directory.push_back(L'/');
         }
diff --git a/tests/checks/no-execute.fish b/tests/checks/no-execute.fish
index 93241c58a..1e5f54e01 100644
--- a/tests/checks/no-execute.fish
+++ b/tests/checks/no-execute.fish
@@ -23,5 +23,14 @@ echo "begin; echo oops" | $fish -n
 echo $status
 #CHECK: 127
 
+echo "begin" > broken
+$fish -n $PWD/broken
+#CHECKERR: /{{.*}}broken (line 1): Missing end to balance this begin
+#CHECKERR: begin
+#CHECKERR: ^~~~^
+#CHECKERR: warning: Error while reading file /{{.*}}broken
+
+rm broken
+
 # Littlecheck assumes a status of 127 means the shebang was invalid.
 exit 0

From 6a7d93d9c59633ae19a5d66bd81f9a0b37ff8dba Mon Sep 17 00:00:00 2001
From: Marcelo Mendes Spessoto Junior <marcelospe@shinji.linux.ime.usp.br>
Date: Mon, 28 Aug 2023 13:21:17 -0300
Subject: [PATCH 147/200] Shortening node.fish completions

Signed-off-by: Marcelo Mendes Spessoto Junior <marcelospe@shinji.linux.ime.usp.br>
(cherry picked from commit 7534572d9953fa855ad75ad52502d6fec2014e24)
---
 share/completions/node.fish | 46 ++++++++++++++++++-------------------
 1 file changed, 23 insertions(+), 23 deletions(-)

diff --git a/share/completions/node.fish b/share/completions/node.fish
index ffe63c4e6..7900d3ab0 100644
--- a/share/completions/node.fish
+++ b/share/completions/node.fish
@@ -38,9 +38,9 @@ complete -c node -l eliminate_dead_phis -d 'eliminate dead phis'
 complete -c node -l use_gvn -d 'use hydrogen global value numbering'
 complete -c node -l use_canonicalizing -d 'use hydrogen instruction canonicalizing'
 complete -c node -l use_inlining -d 'use function inlining'
-complete -c node -l max_inlined_source_size -d 'maximum source size in bytes considered for a single inlining'
-complete -c node -l max_inlined_nodes -d 'maximum number of AST nodes considered for a single inlining'
-complete -c node -l max_inlined_nodes_cumulative -d 'maximum cumulative number of AST nodes considered for inlining'
+complete -c node -l max_inlined_source_size -d 'max source size in bytes considered for single inlining'
+complete -c node -l max_inlined_nodes -d 'max number of AST nodes considered for single inlining'
+complete -c node -l max_inlined_nodes_cumulative -d 'max cumulative number of AST nodes considered for inlining'
 complete -c node -l loop_invariant_code_motion -d 'loop invariant code motion'
 complete -c node -l collect_megamorphic_maps_from_stub_cache -d 'crankshaft harvests type feedback from stub cache'
 complete -c node -l hydrogen_stats -d 'print statistics for hydrogen'
@@ -78,7 +78,7 @@ complete -c node -l count_based_interrupts -d 'trigger profiler ticks based on c
 complete -c node -l interrupt_at_exit -d 'insert an interrupt check at function exit'
 complete -c node -l weighted_back_edges -d 'weight back edges by jump distance for interrupt triggering'
 complete -c node -l interrupt_budget -d 'execution budget before interrupt is triggered'
-complete -c node -l type_info_threshold -d 'percentage of ICs that must have type info to allow optimization'
+complete -c node -l type_info_threshold -d '% of ICs that must have type info to allow optimization'
 complete -c node -l self_opt_count -d 'call count before self-optimization'
 complete -c node -l trace_opt_verbose -d 'extra verbose compilation tracing'
 complete -c node -l debug_code -d 'generate extra code (assertions) for debugging'
@@ -89,7 +89,7 @@ complete -c node -l enable_sse4_1 -d 'enable use of SSE4'
 complete -c node -l enable_cmov -d 'enable use of CMOV instruction if available'
 complete -c node -l enable_rdtsc -d 'enable use of RDTSC instruction if available'
 complete -c node -l enable_sahf -d 'enable use of SAHF instruction if available (X64 only)'
-complete -c node -l enable_vfp3 -d 'enable use of VFP3 instructions if available - this implies enabling ARMv7 instructions (ARM only)'
+complete -c node -l enable_vfp3 -d 'enable use of VFP3 instructions if available (ARM only)'
 complete -c node -l enable_armv7 -d 'enable use of ARMv7 instructions if available (ARM only)'
 complete -c node -l enable_fpu -d 'enable use of MIPS FPU instructions if available (MIPS only)'
 complete -c node -l expose_natives_as -d 'expose natives in global object'
@@ -114,24 +114,24 @@ complete -c node -l always_sparkplug -d 'always use non-optimizing sparkplug com
 complete -c node -l trace_deopt -d 'trace deoptimization'
 complete -c node -l min_preparse_length -d 'minimum length for automatic enable preparsing'
 complete -c node -l always_full_compiler -d 'try to use the dedicated run-once backend for all code'
-complete -c node -l trace_bailout -d 'print reasons for falling back to using the classic V8 backend'
+complete -c node -l trace_bailout -d 'print reasons for falling back to the classic V8 backend'
 complete -c node -l compilation_cache -d 'enable compilation cache'
 complete -c node -l cache_prototype_transitions -d 'cache prototype transitions'
 complete -c node -l trace_debug_json -d 'trace debugging JSON request/response'
-complete -c node -l debugger_auto_break -d 'automatically set the debug break flag when debugger commands are in the queue'
+complete -c node -l debugger_auto_break -d 'autoset debug break flag when debugger commands are in queue'
 complete -c node -l enable_liveedit -d 'enable liveedit experimental feature'
 complete -c node -l break_on_abort -d 'always cause a debug break before aborting'
-complete -c node -l stack_size -d 'default size of stack region v8 is allowed to use (in kBytes)'
-complete -c node -l max_stack_trace_source_length -d 'maximum length of function source code printed in a stack trace'
+complete -c node -l stack_size -d 'default size of stack region v8 is allowed to use (in kBs)'
+complete -c node -l max_stack_trace_source_length -d 'max length of function source code printed in stack trace'
 complete -c node -l always_inline_smi_code -d 'always inline smi code in non-opt code'
 complete -c node -l max_new_space_size -d 'max size of the new generation (in kBytes)'
 complete -c node -l max_old_space_size -d 'max size of the old generation (in Mbytes)'
 complete -c node -l max_executable_size -d 'max size of executable memory (in Mbytes)'
 complete -c node -l gc_global -d 'always perform global GCs'
 complete -c node -l gc_interval -d 'garbage collect after <n> allocations'
-complete -c node -l trace_gc -d 'print one trace line following each garbage collection'
-complete -c node -l trace_gc_nvp -d 'print one detailed trace line in name=value format after each garbage collection'
-complete -c node -l print_cumulative_gc_stat -d 'print cumulative GC statistics in name=value format on exit'
+complete -c node -l trace_gc -d 'print 1 trace line following each garbage collection'
+complete -c node -l trace_gc_nvp -d 'print 1 full trace(w/ name=value) after garbage collections'
+complete -c node -l print_cumulative_gc_stat -d 'print cumulative GC statistics(w/ name=value) on exit'
 complete -c node -l trace_gc_verbose -d 'print more details following each garbage collection'
 complete -c node -l trace_fragmentation -d 'report fragmentation for old pointer and data pages'
 complete -c node -l collect_maps -d 'garbage collect maps from which no objects can be reached'
@@ -148,17 +148,17 @@ complete -c node -l lazy_sweeping -d 'Use lazy sweeping for old pointer and data
 complete -c node -l never_compact -d 'Never perform compaction on full GC - testing only'
 complete -c node -l compact_code_space -d 'Compact code space on full non-incremental collections'
 complete -c node -l cleanup_code_caches_at_gc -d 'Flush inline caches prior to mark compact collection and flush code caches in maps during mark compact cycle'
-complete -c node -l random_seed -d 'Default seed for initializing random generator (0, the default, means to use system random)'
+complete -c node -l random_seed -d 'Default seed for random generator init(0:default-sys random)'
 complete -c node -l use_verbose_printer -d 'allows verbose printing'
 complete -c node -l allow_natives_syntax -d 'allow natives syntax'
 complete -c node -l trace_sim -d 'Trace simulator execution'
 complete -c node -l check_icache -d 'Check icache flushes in ARM and MIPS simulator'
 complete -c node -l stop_sim_at -d 'Simulator stop after x number of instructions'
-complete -c node -l sim_stack_alignment -d 'Stack alignment in bytes in simulator (4 or 8, 8 is default)'
+complete -c node -l sim_stack_alignment -d 'Stack alignment in bytes in simulator (4/8, 8 is default)'
 complete -c node -l trace_exception -d 'print stack trace when throwing exceptions'
 complete -c node -l preallocate_message_memory -d 'preallocate some memory to build stack traces'
-complete -c node -l randomize_hashes -d 'randomize hashes to avoid predictable hash collisions (with snapshots this option cannot override the baked-in seed)'
-complete -c node -l hash_seed -d 'Fixed seed to use to hash property keys (0 means random) (with snapshots this option cannot override the baked-in seed)'
+complete -c node -l randomize_hashes -d 'randomize hashes(w/ snapshots cannot override baked-in seed)'
+complete -c node -l hash_seed -d 'Fix seed to hash prop. key(w/ snapshots no BI seed overr.)'
 complete -c node -l preemption -d 'activate a 100ms timer that switches between V8 threads'
 complete -c node -l regexp_optimization -d 'generate optimized regexp code'
 complete -c node -l testing_bool_flag -d 'testing_bool_flag'
@@ -170,7 +170,7 @@ complete -c node -l testing_serialization_file -d 'file in which to serialize he
 complete -c node -l help -d 'Print usage message, including flags, on console'
 complete -c node -l dump_counters -d 'Dump counters on exit'
 complete -c node -l debugger -d 'Enable JavaScript debugger'
-complete -c node -l remote_debugger -d 'Connect JavaScript debugger to the debugger agent in another process'
+complete -c node -l remote_debugger -d 'Connect JS debugger to the debugger agent in another process'
 complete -c node -l debugger_agent -d 'Enable debugger agent'
 complete -c node -l debugger_port -d 'Port to use for remote debugging'
 complete -c node -l map_counters -d 'Map counters to a file'
@@ -181,9 +181,9 @@ complete -c node -l gdbjit -d 'enable GDBJIT interface (disables compacting GC)'
 complete -c node -l gdbjit_full -d 'enable GDBJIT interface for all code objects'
 complete -c node -l gdbjit_dump -d 'dump elf objects with debug info to disk'
 complete -c node -l gdbjit_dump_filter -d 'dump only objects containing this substring'
-complete -c node -l force_marking_deque_overflows -d 'force overflows of marking deque by reducing its size to 64 words'
-complete -c node -l stress_compaction -d 'stress the GC compactor to flush out bugs (implies --force_marking_deque_overflows)'
-complete -c node -l log -d 'Minimal logging (no API, code, GC, suspect, or handles samples)'
+complete -c node -l force_marking_deque_overflows -d 'force overflow of marking deque by reducing size to 64 words'
+complete -c node -l stress_compaction -d 'stress the GC compactor to flush out bugs'
+complete -c node -l log -d 'Minimal logging (no API,code,GC,suspect,or handles samples)'
 complete -c node -l log_all -d 'Log all events to the log file'
 complete -c node -l log_runtime -d 'Activate runtime system %Log call'
 complete -c node -l log_api -d 'Log API events to the log file'
@@ -193,9 +193,9 @@ complete -c node -l log_handles -d 'Log global handle events'
 complete -c node -l log_snapshot_positions -d 'log positions of (de)serialized objects in the snapshot'
 complete -c node -l log_suspect -d 'Log suspect operations'
 complete -c node -l prof -d 'Log statistical profiling information (implies --log-code)'
-complete -c node -l prof_auto -d 'Used with --prof, starts profiling automatically)'
-complete -c node -l prof_lazy -d 'Used with --prof, only does sampling and logging when profiler is active (implies --noprof_auto)'
-complete -c node -l prof_browser_mode -d 'Used with --prof, turns on browser-compatible mode for profiling'
+complete -c node -l prof_auto -d 'Used w/ --prof,starts profiling automatically)'
+complete -c node -l prof_lazy -d 'Used w/ --prof,only samples and logs w/ active profiler'
+complete -c node -l prof_browser_mode -d 'Used w/ --prof,set on browser-compatible mode for profiling'
 complete -c node -l log_regexp -d 'Log regular expression execution'
 complete -c node -l sliding_state_window -d 'Update sliding state window counters'
 complete -c node -l logfile -d 'Specify the name of the log file'

From 83185774dbba714a76e781d1cdf1d03cc40d3cef Mon Sep 17 00:00:00 2001
From: NextAlone <12210746+NextAlone@users.noreply.github.com>
Date: Thu, 19 Oct 2023 00:36:54 +0800
Subject: [PATCH 148/200] completion(loginctl): fix sessions with ssh or other
 states (#10038)

Signed-off-by: Next Alone <12210746+NextAlone@users.noreply.github.com>
(cherry picked from commit 7250e6fa6a1647b6d6f264b86352953fdfc78e25)
---
 share/completions/loginctl.fish | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/share/completions/loginctl.fish b/share/completions/loginctl.fish
index 887a4a7a5..e3b883937 100644
--- a/share/completions/loginctl.fish
+++ b/share/completions/loginctl.fish
@@ -30,7 +30,7 @@ complete -c loginctl -f -n "not $seen $commands" -l version -d "Show package ver
 
 
 function __fish_loginctl_list_sessions
-    loginctl list-sessions --no-legend --no-pager --output=short | string replace -r '(\d+) \d+ (\S+) \S+ (\S+) .*' '$1\t$2 at $3'
+    loginctl list-sessions --no-legend --no-pager --output=short | string replace -r '^\s*(\d+)\s+\d+\s+(\S+)\s+(\S+\s+)?(\S+\d+).*' '$1\t$2 at $4'
 end
 
 

From ced76a45760611901bf3f3a9cbf9ab225e3464f1 Mon Sep 17 00:00:00 2001
From: Nunzio Cicone <johncicone@northwesternmutual.com>
Date: Tue, 10 Oct 2023 13:47:07 -0400
Subject: [PATCH 149/200] update entr completions

(cherry picked from commit 85deb76c5f42c80fff0a3b63def4e1e176daf002)
---
 share/completions/entr.fish | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/share/completions/entr.fish b/share/completions/entr.fish
index ca020a476..c3fe788ab 100644
--- a/share/completions/entr.fish
+++ b/share/completions/entr.fish
@@ -1,5 +1,9 @@
+complete -c entr -s a -d 'Respond to all events'
+complete -c entr -s c -d 'Clear the screen before running'
+complete -c entr -s d -d 'Track directories and exit if new file added'
+complete -c entr -s n -d 'Run in non-interactive mode'
+complete -c entr -s p -d 'Postpone execution of utility until a file is modified'
 complete -c entr -s r -d 'Launch utility at startup and reload on file change'
-complete -c entr -s c -d 'Clears the screen before running the utility'
-complete -c entr -s h -l help -d 'Display help'
-complete -c entr -s v -l version -d 'Output version information'
+complete -c entr -s s -d 'Evaluate using the interpreter in SHELL env variable'
+complete -c entr -s z -d 'Exit after utility completes'
 complete -c entr -x -a '(__fish_complete_subcommand)'

From a976589e933bc3c6ffb616295cec0f42ea922bc7 Mon Sep 17 00:00:00 2001
From: Oliver Schrenk <oschrenk@users.noreply.github.com>
Date: Sun, 15 Oct 2023 10:44:49 +0200
Subject: [PATCH 150/200] fix typo in set -U option

(Partially cherry picked from commit 631f2c073c35b66e69ee09a5f7a38ec4412ffd52)
---
 doc_src/cmds/set.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc_src/cmds/set.rst b/doc_src/cmds/set.rst
index 9650c39b1..d529b4d51 100644
--- a/doc_src/cmds/set.rst
+++ b/doc_src/cmds/set.rst
@@ -38,7 +38,7 @@ The following options control variable scope:
 
 **-U** or **--universal**
     Sets a universal variable.
-    The variable will be immediately available to all the user's ``fish`` instances on the machine, and will be persist across restarts of the shell.
+    The variable will be immediately available to all the user's ``fish`` instances on the machine, and will be persisted across restarts of the shell.
 
 **-f** or **--function**
     Sets a variable scoped to the executing function.

From 7d1090b6def75d76dcd30f80a9651a4ba56844d2 Mon Sep 17 00:00:00 2001
From: exploide <me@exploide.net>
Date: Mon, 16 Oct 2023 18:39:54 +0200
Subject: [PATCH 151/200] completions: added userdel from shadow-utils

(cherry picked from commit 5d0efbf2e8a049c8ab56ae889e9c9964faa77ea9)
---
 share/completions/userdel.fish | 8 ++++++++
 1 file changed, 8 insertions(+)
 create mode 100644 share/completions/userdel.fish

diff --git a/share/completions/userdel.fish b/share/completions/userdel.fish
new file mode 100644
index 000000000..f75acb659
--- /dev/null
+++ b/share/completions/userdel.fish
@@ -0,0 +1,8 @@
+complete -c userdel -xa "(__fish_complete_users)"
+
+complete -c userdel -s f -l force -d "force the removal"
+complete -c userdel -s h -l help -d "display help message"
+complete -c userdel -s r -l remove -d "remove user's home and mail directories"
+complete -c userdel -s R -l root -xa "(__fish_complete_directories)" -d "apply changes in a chroot directory"
+complete -c userdel -s P -l prefix -xa "(__fish_complete_directories)" -d "apply changes in a prefix directory"
+complete -c userdel -s Z -l selinux-user -d "remove SELinux user mappings"

From 3a86ce87c0a8d8fcc4d4d9e4091933923408bc03 Mon Sep 17 00:00:00 2001
From: Kid <44045911+kidonng@users.noreply.github.com>
Date: Fri, 20 Oct 2023 01:38:03 +0800
Subject: [PATCH 152/200] Add `--verbose` completion to `fish_key_reader`

This was missing from #8467.

(cherry picked from commit 84e6344c9140b99b280a854532b5285248528982)
---
 share/completions/fish_key_reader.fish | 1 +
 1 file changed, 1 insertion(+)

diff --git a/share/completions/fish_key_reader.fish b/share/completions/fish_key_reader.fish
index bab66cac0..0eeff233a 100644
--- a/share/completions/fish_key_reader.fish
+++ b/share/completions/fish_key_reader.fish
@@ -1,3 +1,4 @@
 complete -c fish_key_reader -s h -l help -d 'Display help and exit'
 complete -c fish_key_reader -s v -l version -d 'Display version and exit'
 complete -c fish_key_reader -s c -l continuous -d 'Start a continuous session'
+complete -c fish_key_reader -s V -l verbose -d 'Output timing and explain sequence'

From 6871f5d6e4b2f21768472dc82787854b00210601 Mon Sep 17 00:00:00 2001
From: Husam Harazi <husam999h@gmail.com>
Date: Fri, 24 Nov 2023 18:59:01 +0300
Subject: [PATCH 153/200] Add `wpctl` completions (#10043)

* Add wpctl completions

* Reviewed comments

(cherry picked from commit 3c814bf53d7d58fb5cfb297e3aabbee2694de6c8)
---
 share/completions/wpctl.fish | 58 ++++++++++++++++++++++++++++++++++++
 1 file changed, 58 insertions(+)
 create mode 100644 share/completions/wpctl.fish

diff --git a/share/completions/wpctl.fish b/share/completions/wpctl.fish
new file mode 100644
index 000000000..92a62c18a
--- /dev/null
+++ b/share/completions/wpctl.fish
@@ -0,0 +1,58 @@
+set -l commands status get-volume inspect set-default set-volume set-mute set-profile clear-default
+
+function __wpctl_get_nodes -a section -a type
+    set -l havesection
+    set -l havetype
+    wpctl status | while read -l line
+        if set -q havesection[1]
+            test -z "$line"; and break
+            if set -q havetype[1]
+                string match -rq '^\s*\│\s*$' -- $line; and break
+                printf '%s\t%s\n' (string match -r '\d+' $line) (string match -rg '\d+\. ([^\[]*)' $line)
+            else
+                string match -q "*$type*" -- $line
+                and set havetype 1
+            end
+        else
+            string match -q "$section*" -- $line
+            and set havesection 1
+        end
+    end
+end
+
+function __wpctl_command_shape
+    set -l shape $argv
+    set -l command (commandline -poc)
+    set -e command[1] # Remove command name
+
+    # Remove flags as we won't count them with the shape
+    set -l command (string match -v -- '-*' $command)
+
+    if test (count $command) != (count $shape)
+        return 1
+    end
+
+    while set -q command[1]
+        string match -q -- $shape[1] $command[1]; or return 1
+        set -e shape[1] command[1]
+    end
+end
+
+complete -c wpctl -f
+
+complete -c wpctl -s h -l help -d "Show help options"
+complete -c wpctl -n "__fish_seen_subcommand_from status" -s k -l nick -d "Display device and node nicknames instead of descriptions"
+complete -c wpctl -n "__fish_seen_subcommand_from status" -s n -l name -d "Display device and node names instead of descriptions"
+complete -c wpctl -n "__fish_seen_subcommand_from inspect" -s r -l referenced -d "Show objects that are referenced in properties"
+complete -c wpctl -n "__fish_seen_subcommand_from inspect" -s a -l associated -d "Show associated objects"
+complete -c wpctl -n "__fish_seen_subcommand_from set-volume" -s p -l pid -d "Selects all nodes associated to the given PID"
+complete -c wpctl -n "__fish_seen_subcommand_from set-volume" -s l -l limit -d "Limit volume to below this value"
+complete -c wpctl -n "__fish_seen_subcommand_from set-mute" -s p -l pid -d "Selects all nodes associated to the given PID"
+
+complete -c wpctl -n __wpctl_command_shape -a "$commands"
+complete -c wpctl -n '__wpctl_command_shape "*"' -n "__fish_seen_subcommand_from get-volume inspect set-volume set-mute set-profile" -a "@DEFAULT_AUDIO_SOURCE@" -d "Default Microphone"
+complete -c wpctl -n '__wpctl_command_shape "*"' -n "__fish_seen_subcommand_from get-volume inspect set-volume set-mute set-profile" -a "@DEFAULT_AUDIO_SINK@" -d "Default Speakers"
+complete -c wpctl -n '__wpctl_command_shape "*"' -n "__fish_seen_subcommand_from inspect set-profile" -a "@DEFAULT_VIDEO_SOURCE@" -d "Default Camera"
+complete -c wpctl -n '__wpctl_command_shape "*"' -n "__fish_seen_subcommand_from get-volume inspect set-volume set-mute set-profile" -a "(__wpctl_get_nodes Audio Sources) (__wpctl_get_nodes Audio Sinks)"
+complete -c wpctl -n '__wpctl_command_shape "*"' -n "__fish_seen_subcommand_from inspect set-profile" -a "(__wpctl_get_nodes Audio Sources) (__wpctl_get_nodes Audio Sinks) (__wpctl_get_nodes Video Source)"
+complete -c wpctl -n '__wpctl_command_shape set-mute "*"' -a "0 1 toggle"

From 09ac6f87033f2acd6178ce388dbce0708fac7bbd Mon Sep 17 00:00:00 2001
From: may <63159454+m4rch3n1ng@users.noreply.github.com>
Date: Tue, 30 May 2023 11:22:18 +0200
Subject: [PATCH 154/200] update npm completions (#9800)

* update npm install completions

* update npm uninstall

* init npm dep rewrite

+ init npm

* npm uninstall complete global packages

* add npm pack completions

* add npm publish completions

* add npm init completions

* add missing commands, remove outdated, add missing aliases

* add npm audit completions

* implement requested changes

* rename __yarn_ to __npm_

* add missing commands / aliases

* slightly less verbose options, reword dry-run description (meh)

* more commands and options

* add and update completions for several commands

* access, adduser, bugs, ci, config, cache
* dedupe, deprecate, dist-tag, diff, docs, doctor
* edit, exec, explain, explore, find-dupes, fund
* hooks, help-search, install, ls, publish, search
* version, view

* more commands, fixes

* fish_indent

* remove most aliases from command suggestions

* add most other commands

* npm help, --help

* minor fixes

* remove npm builtin completion, new install option, fish_indent

* add completions for npm set, npm get

(cherry picked from commit d19a08cd8cc6b939a000a4ef31b5cf6c5f97c2d7)
---
 share/completions/npm.fish             | 750 +++++++++++++++++++++----
 share/completions/yarn.fish            |   4 +-
 share/functions/__fish_npm_helper.fish |  34 +-
 3 files changed, 664 insertions(+), 124 deletions(-)

diff --git a/share/completions/npm.fish b/share/completions/npm.fish
index 1aa28a61f..82936715f 100644
--- a/share/completions/npm.fish
+++ b/share/completions/npm.fish
@@ -1,4 +1,4 @@
-# NPM (https://npmjs.org) completions for Fish shell
+# npm (https://npmjs.org) completions for Fish shell
 # __fish_npm_needs_* and __fish_npm_using_* taken from:
 # https://stackoverflow.com/questions/16657803/creating-autocomplete-script-with-sub-commands
 # see also Fish's large set of completions for examples:
@@ -21,7 +21,7 @@ function __fish_npm_using_command
     set -l cmd (commandline -opc)
 
     if test (count $cmd) -gt 1
-        if test $argv[1] = $cmd[2]
+        if contains -- $cmd[2] $argv
             return 0
         end
     end
@@ -37,42 +37,6 @@ function __fish_npm_needs_option
     return 1
 end
 
-function __fish_complete_npm -d "Complete the commandline using npm's 'completion' tool"
-    # Note that this function will generate undescribed completion options, and current fish
-    # will sometimes pick these over versions with descriptions.
-    # However, this seems worth it because it means automatically getting _some_ completions if npm updates.
-
-    # Defining an npm alias that automatically calls nvm if necessary is a popular convenience measure.
-    # Because that is a function, these local variables won't be inherited and the completion would fail
-    # with weird output on stdout (!). But before the function is called, no npm command is defined,
-    # so calling the command would fail.
-    # So we'll only try if we have an npm command.
-    if command -sq npm
-        # npm completion is bash-centric, so we need to translate fish's "commandline" stuff to bash's $COMP_* stuff
-        # COMP_LINE is an array with the words in the commandline
-        set -lx COMP_LINE (commandline -opc)
-        # COMP_CWORD is the index of the current word in COMP_LINE
-        # bash starts arrays with 0, so subtract 1
-        set -lx COMP_CWORD (math (count $COMP_LINE) - 1)
-        # COMP_POINT is the index of point/cursor when the commandline is viewed as a string
-        set -lx COMP_POINT (commandline -C)
-        # If the cursor is after the last word, the empty token will disappear in the expansion
-        # Readd it
-        if test -z (commandline -ct)
-            set COMP_CWORD (math $COMP_CWORD + 1)
-            set COMP_LINE $COMP_LINE ""
-        end
-        command npm completion -- $COMP_LINE 2>/dev/null
-    end
-end
-
-# use npm completion for most of the things,
-# except options completion (because it sucks at it)
-# and run-script completion (reading package.json is faster).
-# see: https://github.com/npm/npm/issues/9524
-# and: https://github.com/fish-shell/fish-shell/pull/2366
-complete -f -c npm -n 'not __fish_npm_needs_option; and not __fish_npm_using_command run; and not __fish_npm_using_command run-script' -a "(__fish_complete_npm)"
-
 # list available npm scripts and their parial content
 function __fish_parse_npm_run_completions
     while read -l name
@@ -102,106 +66,664 @@ for k,v in data["scripts"].items(): print(k + "\t" + v[:18])' <package.json 2>/d
 end
 
 # run
-for c in run run-script
+complete -f -c npm -n __fish_npm_needs_command -a 'run-script run' -d 'Run arbitrary package scripts'
+for c in run-script run rum urn
     complete -f -c npm -n "__fish_npm_using_command $c" -a "(__fish_npm_run)"
+    complete -f -c npm -n "__fish_npm_using_command $c" -l if-present -d "Don't error on nonexistant script"
+    complete -f -c npm -n "__fish_npm_using_command $c" -l ignore-scripts -d "Don't run pre-, post- and life-cycle scripts"
+    complete -x -c npm -n "__fish_npm_using_command $c" -s script-shell -d 'The shell to use for scripts'
+    complete -f -c npm -n "__fish_npm_using_command $c" -l foreground-scripts -d 'Run all build scripts in the foreground'
+end
+
+# access
+set -l access_commands 'list get set grant revoke'
+complete -f -c npm -n __fish_npm_needs_command -a access -d 'Set access level on published packages'
+complete -x -c npm -n '__fish_npm_using_command access' -n "not __fish_seen_subcommand_from $access_commands" -a list -d 'List access info'
+complete -x -c npm -n '__fish_npm_using_command access' -n "not __fish_seen_subcommand_from $access_commands" -a get -d 'Get access level'
+complete -x -c npm -n '__fish_npm_using_command access' -n "not __fish_seen_subcommand_from $access_commands" -a grant -d 'Grant access to users'
+complete -x -c npm -n '__fish_npm_using_command access' -n "not __fish_seen_subcommand_from $access_commands" -a revoke -d 'Revoke access from users'
+complete -x -c npm -n '__fish_npm_using_command access' -n "not __fish_seen_subcommand_from $access_commands" -a set -d 'Set access level'
+complete -x -c npm -n '__fish_npm_using_command access' -n '__fish_seen_subcommand_from list' -a 'packages collaborators'
+complete -x -c npm -n '__fish_npm_using_command access' -n '__fish_seen_subcommand_from get' -a status
+complete -x -c npm -n '__fish_npm_using_command access' -n '__fish_seen_subcommand_from grant' -a 'read-only read-write'
+complete -x -c npm -n '__fish_npm_using_command access' -n '__fish_seen_subcommand_from set' -a 'status=public status=private' -d 'Set package status'
+complete -x -c npm -n '__fish_npm_using_command access' -n '__fish_seen_subcommand_from set' -a 'mfa=none mfa=publish mfa=automation' -d 'Set package MFA'
+complete -x -c npm -n '__fish_npm_using_command access' -n '__fish_seen_subcommand_from set' -a '2fa=none 2fa=publish 2fa=automation' -d 'Set package MFA'
+complete -f -c npm -n '__fish_npm_using_command access' -l json -d 'Output JSON'
+complete -x -c npm -n '__fish_npm_using_command access' -l otp -d '2FA one-time password'
+complete -x -c npm -n '__fish_npm_using_command access' -l registry -d 'Registry base URL'
+complete -f -c npm -n '__fish_npm_using_command access' -s h -l help -d 'Display help'
+
+# adduser
+complete -f -c npm -n __fish_npm_needs_command -a adduser -d 'Add a registry user account'
+complete -f -c npm -n __fish_npm_needs_command -a login -d 'Login to a registry user account'
+for c in adduser add-user login
+    complete -x -c npm -n "__fish_npm_using_command $c" -l registry -d 'Registry base URL'
+    complete -x -c npm -n "__fish_npm_using_command $c" -l scope -d 'Log into a private repository'
+    complete -x -c npm -n "__fish_npm_using_command $c" -l auth-type -a 'legacy web' -d 'Authentication strategy'
+    complete -f -c npm -n "__fish_npm_using_command $c" -s h -l help -d 'Display help'
+end
+
+# audit
+complete -f -c npm -n __fish_npm_needs_command -a audit -d 'Run a security audit'
+complete -f -c npm -n '__fish_npm_using_command audit' -a signatures -d 'Verify registry signatures'
+complete -f -c npm -n '__fish_npm_using_command audit' -a fix -d 'Install compatible updates to vulnerable deps'
+complete -x -c npm -n '__fish_npm_using_command audit' -l audit-level -a 'info low moderate high critical none' -d 'Audit level'
+complete -f -c npm -n '__fish_npm_using_command audit' -l dry-run -d 'Do not make any changes'
+complete -f -c npm -n '__fish_npm_using_command audit' -s f -l force -d 'Removes various protections'
+complete -f -c npm -n '__fish_npm_using_command audit' -l json -d 'Output JSON'
+complete -f -c npm -n '__fish_npm_using_command audit' -l package-lock-only -d 'Only use package-lock.json, ignore node_modules'
+complete -x -c npm -n '__fish_npm_using_command audit' -l omit -a 'dev optional peer' -d 'Omit dependency type'
+complete -f -c npm -n '__fish_npm_using_command audit' -l foreground-scripts -d 'Run all build scripts in the foreground'
+complete -f -c npm -n '__fish_npm_using_command audit' -l ignore-scripts -d "Don't run pre-, post- and life-cycle scripts"
+complete -f -c npm -n '__fish_npm_using_command audit' -l install-links -d 'Install file: protocol deps as regular deps'
+complete -f -c npm -n '__fish_npm_using_command audit' -s h -l help -d 'Display help'
+
+# bugs
+for c in bugs issues
+    complete -f -c npm -n __fish_npm_needs_command -a "$c" -d 'Report bugs for a package in a web browser'
+    complete -x -c npm -n "__fish_npm_using_command $c" -l browser -d 'Set browser'
+    complete -x -c npm -n "__fish_npm_using_command $c" -l no-browser -d 'Print to stdout'
+    complete -x -c npm -n "__fish_npm_using_command $c" -l registry -d 'Registry base URL'
+    complete -f -c npm -n "__fish_npm_using_command $c" -s h -l help -d 'Display help'
 end
 
 # cache
 complete -f -c npm -n __fish_npm_needs_command -a cache -d "Manipulates package's cache"
 complete -f -c npm -n '__fish_npm_using_command cache' -a add -d 'Add the specified package to the local cache'
-complete -f -c npm -n '__fish_npm_using_command cache' -a clean -d 'Delete  data  out of the cache folder'
+complete -f -c npm -n '__fish_npm_using_command cache' -a clean -d 'Delete data out of the cache folder'
 complete -f -c npm -n '__fish_npm_using_command cache' -a ls -d 'Show the data in the cache'
+complete -f -c npm -n '__fish_npm_using_command cache' -a verify -d 'Verify the contents of the cache folder'
+complete -x -c npm -n '__fish_npm_using_command cache' -l cache -a '(__fish_complete_directories)' -d 'Cache location'
+complete -f -c npm -n '__fish_npm_using_command cache' -s h -l help -d 'Display help'
+
+# ci
+# install-ci-test
+complete -f -c npm -n __fish_npm_needs_command -a 'ci clean-install' -d 'Clean install a project'
+complete -f -c npm -n __fish_npm_needs_command -a 'install-ci-test cit' -d 'Install a project with a clean slate and run tests'
+for c in ci clean-install ic install-clean isntall-clean install-ci-test cit clean-install-test sit
+    complete -x -c npm -n "__fish_npm_using_command $c" -l install-strategy -a 'hoisted nested shallow linked' -d 'Install strategy'
+    complete -x -c npm -n "__fish_npm_using_command $c" -l omit -a 'dev optional peer' -d 'Omit dependency type'
+    complete -x -c npm -n "__fish_npm_using_command $c" -l strict-peer-deps -d 'Treat conflicting peerDependencies as failure'
+    complete -f -c npm -n "__fish_npm_using_command $c" -l foreground-scripts -d 'Run all build scripts in the foreground'
+    complete -f -c npm -n "__fish_npm_using_command $c" -l ignore-scripts -d "Don't run pre-, post- and life-cycle scripts"
+    complete -f -c npm -n "__fish_npm_using_command $c" -l no-audit -d "Don't submit audit reports"
+    complete -f -c npm -n "__fish_npm_using_command $c" -l no-bin-links -d "Don't symblink package executables"
+    complete -f -c npm -n "__fish_npm_using_command $c" -l no-fund -d "Don't display funding info"
+    complete -f -c npm -n "__fish_npm_using_command $c" -l dry-run -d 'Do not make any changes'
+    complete -f -c npm -n "__fish_npm_using_command $c" -l install-links -d 'Install file: protocol deps as regular deps'
+    complete -f -c npm -n "__fish_npm_using_command $c" -s h -l help -d 'Display help'
+end
+
+# completion
+complete -f -c npm -n __fish_npm_needs_command -a completion -d 'Tab Completion for npm'
+complete -f -c npm -n '__fish_npm_using_command completion' -s h -l help -d 'Display help'
 
 # config
-for c in c config
-    complete -f -c npm -n __fish_npm_needs_command -a "$c" -d 'Manage the npm configuration files'
-    complete -f -c npm -n "__fish_npm_using_command $c" -a set -d 'Sets the config key to the value'
-    complete -f -c npm -n "__fish_npm_using_command $c" -a get -d 'Echo the config value to stdout'
-    complete -f -c npm -n "__fish_npm_using_command $c" -a delete -d 'Deletes the key from all configuration files'
-    complete -f -c npm -n "__fish_npm_using_command $c" -a list -d 'Show all the config settings'
-    complete -f -c npm -n "__fish_npm_using_command $c" -a ls -d 'Show all the config settings'
-    complete -f -c npm -n "__fish_npm_using_command $c" -a edit -d 'Opens the config file in an editor'
+complete -f -c npm -n __fish_npm_needs_command -a config -d 'Manage the npm configuration files'
+for c in config c
+    set -l config_commands 'set get delete list edit fix'
+    complete -x -c npm -n "__fish_npm_using_command $c" -n "not __fish_seen_subcommand_from $config_commands" -a set -d 'Sets the config keys to the values'
+    complete -x -c npm -n "__fish_npm_using_command $c" -n "not __fish_seen_subcommand_from $config_commands" -a get -d 'Echo the config value(s) to stdout'
+    complete -x -c npm -n "__fish_npm_using_command $c" -n "not __fish_seen_subcommand_from $config_commands" -a delete -d 'Deletes the key from all config files'
+    complete -x -c npm -n "__fish_npm_using_command $c" -n "not __fish_seen_subcommand_from $config_commands" -a list -d 'Show all config settings'
+    complete -x -c npm -n "__fish_npm_using_command $c" -n "not __fish_seen_subcommand_from $config_commands" -a edit -d 'Opens the config file in an editor'
+    complete -x -c npm -n "__fish_npm_using_command $c" -n "not __fish_seen_subcommand_from $config_commands" -a fix -d 'Attempts to repair invalid config items'
+    complete -f -c npm -n "__fish_npm_using_command $c" -l json -d 'Output JSON'
+    complete -f -c npm -n "__fish_npm_using_command $c" -s g -l global -d 'Edit global config'
+    complete -x -c npm -n "__fish_npm_using_command $c" -l editor -d 'Specify the editor'
+    complete -x -c npm -n "__fish_npm_using_command $c" -s L -l location -a 'global user project' -d 'Which config file'
+    complete -f -c npm -n "__fish_npm_using_command $c" -s l -l long -d 'Show extended information'
+    complete -f -c npm -n "__fish_npm_using_command $c" -s h -l help -d 'Display help'
 end
 # get, set also exist as shorthands
-complete -f -c npm -n __fish_npm_needs_command -a get -d 'Echo the config value to stdout'
-complete -f -c npm -n __fish_npm_needs_command -a set -d 'Sets the config key to the value'
+complete -f -c npm -n __fish_npm_needs_command -a get -d 'Get a value from the npm configuration'
+complete -f -c npm -n '__fish_npm_using_command get' -s l -l long -d 'Show extended information'
+complete -f -c npm -n '__fish_npm_using_command get' -s h -l help -d 'Display help'
+# set
+complete -f -c npm -n __fish_npm_needs_command -a set -d 'Set a value in the npm configuration'
+complete -x -c npm -n '__fish_npm_using_command set' -s L -l location -a 'global user project' -d 'Which config file'
+complete -f -c npm -n '__fish_npm_using_command set' -s g -l global -d 'Edit global config'
+complete -f -c npm -n '__fish_npm_using_command set' -s h -l help -d 'Display help'
 
-# install
-for c in install isntall i
-    complete -c npm -n __fish_npm_needs_command -a "$c" -d 'install a package'
-    complete -c npm -n "__fish_npm_using_command $c" -l save-dev -d 'Save to devDependencies in package.json'
-    complete -c npm -n "__fish_npm_using_command $c" -l save -d 'Save to dependencies in package.json'
-    complete -c npm -n "__fish_npm_using_command $c" -s g -l global -d 'Install package globally'
+# dedupe
+complete -f -c npm -n __fish_npm_needs_command -a dedupe -d 'Reduce duplication'
+complete -f -c npm -n __fish_npm_needs_command -a find-dupes -d 'Find duplication'
+for c in dedupe ddp find-dupes
+    complete -x -c npm -n "__fish_npm_using_command $c" -l install-strategy -a 'hoisted nested shallow linked' -d 'Install strategy'
+    complete -x -c npm -n "__fish_npm_using_command $c" -l strict-peer-deps -d 'Treat conflicting peerDependencies as failure'
+    complete -x -c npm -n "__fish_npm_using_command $c" -l no-package-lock -d 'Ignore package-lock.json'
+    complete -x -c npm -n "__fish_npm_using_command $c" -l omit -a 'dev optional peer' -d 'Omit dependency type'
+    complete -f -c npm -n "__fish_npm_using_command $c" -l ignore-scripts -d "Don't run pre-, post- and life-cycle scripts"
+    complete -f -c npm -n "__fish_npm_using_command $c" -l no-audit -d "Don't submit audit reports"
+    complete -f -c npm -n "__fish_npm_using_command $c" -l no-bin-links -d "Don't symblink package executables"
+    complete -f -c npm -n "__fish_npm_using_command $c" -l no-fund -d "Don't display funding info"
+    complete -f -c npm -n "__fish_npm_using_command $c" -l install-links -d 'Install file: protocol deps as regular deps'
+    complete -f -c npm -n "__fish_npm_using_command $c" -s h -l help -d 'Display help'
+
+    if test $c != find-dupes
+        complete -f -c npm -n "__fish_npm_using_command $c" -l dry-run -d "Don't display funding info"
+    end
 end
 
-# list
-for c in la list ll ls
-    complete -f -c npm -n __fish_npm_needs_command -a "$c" -d 'List installed packages'
-    complete -f -c npm -n "__fish_npm_using_command $c" -s g -l global -d 'List packages in the global install prefix instead of in the current project'
-    complete -f -c npm -n "__fish_npm_using_command $c" -l json -d 'Show information in JSON format'
-    complete -f -c npm -n "__fish_npm_using_command $c" -l long -d 'Show extended information'
-    complete -f -c npm -n "__fish_npm_using_command $c" -l parseable -d 'Show parseable output instead of tree view'
-    complete -x -c npm -n "__fish_npm_using_command $c" -l depth -d 'Max display depth of the dependency tree'
+# deprecate
+complete -f -c npm -n __fish_npm_needs_command -a deprecate -d 'Deprecate a version of a package'
+complete -x -c npm -n '__fish_npm_using_command deprecate' -l registry -d 'Registry base URL'
+complete -x -c npm -n '__fish_npm_using_command deprecate' -l otp -d '2FA one-time password'
+complete -f -c npm -n '__fish_npm_using_command deprecate' -s h -l help -d 'Display help'
+
+# diff
+complete -f -c npm -n __fish_npm_needs_command -a diff -d 'The registry diff command'
+complete -x -c npm -n '__fish_npm_using_command diff' -l diff -d 'Arguments to compare'
+complete -f -c npm -n '__fish_npm_using_command diff' -l diff-name-only -d 'Prints only filenames'
+complete -x -c npm -n '__fish_npm_using_command diff' -l diff-unified -d 'The number of lines to print'
+complete -f -c npm -n '__fish_npm_using_command diff' -l diff-ignore-all-space -d 'Ignore whitespace'
+complete -f -c npm -n '__fish_npm_using_command diff' -l diff-no-prefix -d 'Do not show any prefix'
+complete -x -c npm -n '__fish_npm_using_command diff' -l diff-src-prefix -d 'Source prefix'
+complete -x -c npm -n '__fish_npm_using_command diff' -l diff-dst-prefix -d 'Destination prefix'
+complete -f -c npm -n '__fish_npm_using_command diff' -l diff-text -d 'Treat all files as text'
+complete -f -c npm -n '__fish_npm_using_command diff' -s g -l global -d 'Operates in "global" mode'
+complete -x -c npm -n '__fish_npm_using_command diff' -l tag -d 'The tag used to fetch the tarball'
+complete -f -c npm -n '__fish_npm_using_command diff' -s h -l help -d 'Display help'
+
+# dist-tag
+complete -f -c npm -n __fish_npm_needs_command -a dist-tag -d 'Modify package distribution tags'
+for c in dist-tag dist-tags
+    complete -f -c npm -n "__fish_npm_using_command $c" -a add -d 'Tag the package'
+    complete -f -c npm -n "__fish_npm_using_command $c" -a rm -d 'Clear a tag from the package'
+    complete -f -c npm -n "__fish_npm_using_command $c" -a ls -d 'List all dist-tags'
+    complete -f -c npm -n "__fish_npm_using_command $c" -s h -l help -d 'Display help'
+end
+
+# docs
+complete -f -c npm -n __fish_npm_needs_command -a docs -d 'Open docs for a package in a web browser'
+for c in docs home
+    complete -x -c npm -n "__fish_npm_using_command $c" -l browser -d 'Set browser'
+    complete -x -c npm -n "__fish_npm_using_command $c" -l registry -d 'Registry base URL'
+    complete -f -c npm -n "__fish_npm_using_command $c" -s h -l help -d 'Display help'
+end
+
+# doctor
+complete -f -c npm -n __fish_npm_needs_command -a doctor -d 'Check your npm environment'
+complete -f -c npm -n '__fish_npm_using_command doctor' -a ping -d 'Check npm ping'
+complete -f -c npm -n '__fish_npm_using_command doctor' -a registry -d 'Check registry'
+complete -f -c npm -n '__fish_npm_using_command doctor' -a versions -d 'Check installed versions'
+complete -f -c npm -n '__fish_npm_using_command doctor' -a environment -d 'Check PATH'
+complete -f -c npm -n '__fish_npm_using_command doctor' -a permissions -d 'Check file permissions'
+complete -f -c npm -n '__fish_npm_using_command doctor' -a cache -d 'Verify cache'
+complete -f -c npm -n '__fish_npm_using_command doctor' -s h -l help -d 'Display help'
+
+# edit
+complete -f -c npm -n __fish_npm_needs_command -a edit -d 'Edit an installed package'
+complete -f -c npm -n '__fish_npm_using_command edit' -l editor -d 'Specify the editor'
+complete -f -c npm -n '__fish_npm_using_command edit' -s h -l help -d 'Display help'
+
+# exec
+complete -f -c npm -n __fish_npm_needs_command -a exec -d 'Run a command from a local or remote npm package'
+for c in exec x
+    complete -x -c npm -n "__fish_npm_using_command $c" -l package -d 'The package(s) to install'
+    complete -x -c npm -n "__fish_npm_using_command $c" -l call -d 'Specify a custom command'
+    complete -f -c npm -n "__fish_npm_using_command $c" -s h -l help -d 'Display help'
+end
+
+# explain
+for c in explain why
+    complete -f -c npm -n __fish_npm_needs_command -a "$c" -d 'Explain installed packages'
+    complete -f -c npm -n "__fish_npm_using_command $c" -l json -d 'Output JSON'
+    complete -f -c npm -n "__fish_npm_using_command $c" -s h -l help -d 'Display help'
+end
+
+# explore
+complete -f -c npm -n __fish_npm_needs_command -a explore -d 'Browse an installed package'
+complete -f -c npm -n '__fish_npm_using_command explore' -a shell -d 'The shell to open'
+complete -f -c npm -n '__fish_npm_using_command explore' -s h -l help -d 'Display help'
+
+# fund
+complete -f -c npm -n __fish_npm_needs_command -a fund -d 'Retrieve funding information'
+complete -f -c npm -n '__fish_npm_using_command fund' -l json -d 'Output JSON'
+complete -x -c npm -n '__fish_npm_using_command fund' -l browser -d 'Set browser'
+complete -f -c npm -n '__fish_npm_using_command fund' -l no-browser -d 'Print to stdout'
+complete -f -c npm -n '__fish_npm_using_command fund' -l unicode -d 'Use unicode characters in the output'
+complete -f -c npm -n '__fish_npm_using_command fund' -l no-unicode -d 'Use ascii characters over unicode glyphs'
+complete -x -c npm -n '__fish_npm_using_command fund' -l which -d 'Which source URL to open (1-indexed)'
+complete -f -c npm -n '__fish_npm_using_command fund' -s h -l help -d 'Display help'
+
+# help
+complete -f -c npm -n __fish_npm_needs_command -a help -d 'Get help on npm'
+for c in help hlep
+    complete -f -c npm -n "__fish_npm_using_command $c" -l viewer -a 'browser man' -d 'Program to view content'
+    complete -f -c npm -n "__fish_npm_using_command $c" -s h -l help -d 'Display help'
+    complete -f -c npm -n "__fish_npm_using_command $c" -a registry -d 'The JavaScript Package Registry'
+    complete -f -c npm -n "__fish_npm_using_command $c" -a removal -d 'Cleaning the Slate'
+    complete -f -c npm -n "__fish_npm_using_command $c" -a logging -d 'Why, What & How We Log'
+    complete -f -c npm -n "__fish_npm_using_command $c" -a scope -d 'How npm handles the "scripts" field'
+    complete -f -c npm -n "__fish_npm_using_command $c" -a dependency-selectors -d 'Dependency Selector Syntax & Querying'
+    complete -f -c npm -n "__fish_npm_using_command $c" -a npm -d 'javascript package manager'
+    complete -f -c npm -n "__fish_npm_using_command $c" -a npmrc -d 'The npm config files'
+    complete -f -c npm -n "__fish_npm_using_command $c" -a shrinkwrap -d 'A publishable lockfile'
+    complete -f -c npm -n "__fish_npm_using_command $c" -a developers -d 'Developer Guide'
+    complete -f -c npm -n "__fish_npm_using_command $c" -a npx -d 'Run a command from a local or remote npm package'
+    complete -f -c npm -n "__fish_npm_using_command $c" -a package-json -d "Specifics of npm's package.json handling"
+    complete -f -c npm -n "__fish_npm_using_command $c" -a package-lock-json -d 'A manifestation of the manifest'
+    complete -f -c npm -n "__fish_npm_using_command $c" -a package-spec -d 'Package name specifier'
+    complete -f -c npm -n "__fish_npm_using_command $c" -a folders -d 'Folder Structures Used by npm'
+    complete -f -c npm -n "__fish_npm_using_command $c" -a global -d 'Folder Structures Used by npm'
+    complete -f -c npm -n "__fish_npm_using_command $c" -a workspaces -d 'FolderWorking with workspaces'
+    complete -f -c npm -n "__fish_npm_using_command $c" -a 'run-script run' -d 'Run arbitrary package scripts'
+    complete -f -c npm -n "__fish_npm_using_command $c" -a access -d 'Set access level on published packages'
+    complete -f -c npm -n "__fish_npm_using_command $c" -a adduser -d 'Add a registry user account'
+    complete -f -c npm -n "__fish_npm_using_command $c" -a login -d 'Login to a registry user account'
+    complete -f -c npm -n "__fish_npm_using_command $c" -a audit -d 'Run a security audit'
+    complete -f -c npm -n "__fish_npm_using_command $c" -a 'bugs issues' -d 'Report bugs for a package in a web browser'
+    complete -f -c npm -n "__fish_npm_using_command $c" -a cache -d "Manipulates package's cache"
+    complete -f -c npm -n "__fish_npm_using_command $c" -a 'ci clean-install' -d 'Clean install a project'
+    complete -f -c npm -n "__fish_npm_using_command $c" -a 'install-ci-test cit' -d 'Install a project with a clean slate and run tests'
+    complete -f -c npm -n "__fish_npm_using_command $c" -a config -d 'Manage the npm configuration files'
+    complete -f -c npm -n "__fish_npm_using_command $c" -a dedupe -d 'Reduce duplication'
+    complete -f -c npm -n "__fish_npm_using_command $c" -a find-dupes -d 'Find duplication'
+    complete -f -c npm -n "__fish_npm_using_command $c" -a deprecate -d 'Deprecate a version of a package'
+    complete -f -c npm -n "__fish_npm_using_command $c" -a diff -d 'The registry diff command'
+    complete -f -c npm -n "__fish_npm_using_command $c" -a dist-tag -d 'Modify package distribution tags'
+    complete -f -c npm -n "__fish_npm_using_command $c" -a docs -d 'Open docs for a package in a web browser'
+    complete -f -c npm -n "__fish_npm_using_command $c" -a doctor -d 'Check your npm environment'
+    complete -f -c npm -n "__fish_npm_using_command $c" -a edit -d 'Edit an installed package'
+    complete -f -c npm -n "__fish_npm_using_command $c" -a exec -d 'Run a command from a local or remote npm package'
+    complete -f -c npm -n "__fish_npm_using_command $c" -a 'explaiin why' -d 'Explain installed packages'
+    complete -f -c npm -n "__fish_npm_using_command $c" -a explore -d 'Browse an installed package'
+    complete -f -c npm -n "__fish_npm_using_command $c" -a fund -d 'Retrieve funding information'
+    complete -f -c npm -n "__fish_npm_using_command $c" -a help -d 'Get help on npm'
+    complete -f -c npm -n "__fish_npm_using_command $c" -a help-search -d 'Search npm help documentation'
+    complete -f -c npm -n "__fish_npm_using_command $c" -a hook -d 'Manage registry hooks'
+    complete -f -c npm -n "__fish_npm_using_command $c" -a 'init create' -d 'Create a package.json file'
+    complete -f -c npm -n "__fish_npm_using_command $c" -a 'install add i' -d 'Install a package'
+    complete -f -c npm -n "__fish_npm_using_command $c" -a 'install-test it' -d 'Install package(s) and run tests'
+    complete -f -c npm -n "__fish_npm_using_command $c" -a logout -d 'Log out of the registry'
+    complete -f -c npm -n "__fish_npm_using_command $c" -a 'ls list' -d 'List installed packages'
+    complete -f -c npm -n "__fish_npm_using_command $c" -a outdated -d 'Check for outdated packages'
+    complete -f -c npm -n "__fish_npm_using_command $c" -a org -d 'Manage orgs'
+    complete -f -c npm -n "__fish_npm_using_command $c" -a 'owner author' -d 'Manage package owners'
+    complete -f -c npm -n "__fish_npm_using_command $c" -a pack -d 'Create a tarball from a package'
+    complete -f -c npm -n "__fish_npm_using_command $c" -a ping -d 'Ping npm registry'
+    complete -f -c npm -n "__fish_npm_using_command $c" -a pkg -d 'Manages your package.json'
+    complete -f -c npm -n "__fish_npm_using_command $c" -a prefix -d 'Display npm prefix'
+    complete -f -c npm -n "__fish_npm_using_command $c" -a publish -d 'Publish a package'
+    complete -f -c npm -n "__fish_npm_using_command $c" -a query -d 'Dependency selector query'
+    complete -f -c npm -n "__fish_npm_using_command $c" -a 'uninstall remove un' -d 'Remove a package'
+    complete -f -c npm -n "__fish_npm_using_command $c" -a repo -d 'Open package repository page in the browser'
+    complete -f -c npm -n "__fish_npm_using_command $c" -a restart -d 'Restart a package'
+    complete -f -c npm -n "__fish_npm_using_command $c" -a start -d 'Start a package'
+    complete -f -c npm -n "__fish_npm_using_command $c" -a stop -d 'Stop a package'
+    complete -f -c npm -n "__fish_npm_using_command $c" -a test -d 'Test a package'
+    complete -f -c npm -n "__fish_npm_using_command $c" -a root -d 'Display npm root'
+    complete -f -c npm -n "__fish_npm_using_command $c" -a 'search find' -d 'Search for packages'
+    complete -f -c npm -n "__fish_npm_using_command $c" -a star -d 'Mark your favorite packages'
+    complete -f -c npm -n "__fish_npm_using_command $c" -a stars -d 'View packages marked as favorites'
+    complete -f -c npm -n "__fish_npm_using_command $c" -a 'update up upgrade' -d 'Update package(s)'
+    complete -f -c npm -n "__fish_npm_using_command $c" -a unstar -d 'Remove star from a package'
+    complete -f -c npm -n "__fish_npm_using_command $c" -a version -d 'Bump a package version'
+    complete -f -c npm -n "__fish_npm_using_command $c" -a 'view info' -d 'View registry info'
+    complete -f -c npm -n "__fish_npm_using_command $c" -a whoami -d 'Display npm username'
+    complete -f -c npm -n "__fish_npm_using_command $c" -a 'link ln' -d 'Symlink a package folder'
+    complete -f -c npm -n "__fish_npm_using_command $c" -a profile -d 'Change settings on your registry profile'
+    complete -f -c npm -n "__fish_npm_using_command $c" -a prune -d 'Remove extraneous packages'
+    complete -f -c npm -n "__fish_npm_using_command $c" -a rebuild -d 'Rebuild a package'
+    complete -f -c npm -n "__fish_npm_using_command $c" -a team -d 'Manage organization teams and team memberships'
+    complete -f -c npm -n "__fish_npm_using_command $c" -a token -d 'Manage your authentication tokens'
+    complete -f -c npm -n "__fish_npm_using_command $c" -a unpublish -d 'Remove a package from the registry'
+    complete -f -c npm -n "__fish_npm_using_command $c" -a completion -d 'Tab Completion for npm'
+    complete -f -c npm -n "__fish_npm_using_command $c" -a shrinkwrap -d 'Lock down dependency versions'
+end
+
+# help-search
+complete -f -c npm -n __fish_npm_needs_command -a help-search -d 'Search npm help documentation'
+complete -f -c npm -n '__fish_npm_using_command help-search' -s l -l long -d 'Show extended information'
+complete -f -c npm -n '__fish_npm_using_command help-search' -s h -l help -d 'Display help'
+
+# hook
+set -l hook_commands 'add ls update rm'
+complete -f -c npm -n __fish_npm_needs_command -a hook -d 'Manage registry hooks'
+complete -f -c npm -n '__fish_npm_using_command hook' -n "not __fish_seen_subcommand_from $hook_commands" -a add -d 'Add a hook'
+complete -f -c npm -n '__fish_npm_using_command hook' -n "not __fish_seen_subcommand_from $hook_commands" -a ls -d 'List all active hooks'
+complete -f -c npm -n '__fish_npm_using_command hook' -n "not __fish_seen_subcommand_from $hook_commands" -a update -d 'Update an existing hook'
+complete -f -c npm -n '__fish_npm_using_command hook' -n "not __fish_seen_subcommand_from $hook_commands" -a rm -d 'Remove a hook'
+complete -f -c npm -n '__fish_npm_using_command hook' -n '__fish_seen_subcommand_from add' -l type -d 'Hook type'
+complete -x -c npm -n '__fish_npm_using_command hook' -l registry -d 'Registry base URL'
+complete -x -c npm -n '__fish_npm_using_command hook' -l otp -d '2FA one-time password'
+complete -f -c npm -n '__fish_npm_using_command hook' -s h -l help -d 'Display help'
+
+# init
+complete -c npm -n __fish_npm_needs_command -a 'init create' -d 'Create a package.json file'
+for c in init create innit
+    complete -f -c npm -n "__fish_npm_using_command $c" -s y -l yes -d 'Automatically answer "yes" to all prompts'
+    complete -f -c npm -n "__fish_npm_using_command $c" -s f -l force -d 'Removes various protections'
+    complete -x -c npm -n "__fish_npm_using_command $c" -l scope -d 'Create a scoped package'
+    complete -f -c npm -n "__fish_npm_using_command $c" -s h -l help -d 'Display help'
+end
+
+# install
+# install-test
+# link
+complete -c npm -n __fish_npm_needs_command -a 'install add i' -d 'Install a package'
+complete -f -c npm -n __fish_npm_needs_command -a 'install-test it' -d 'Install package(s) and run tests'
+complete -f -c npm -n __fish_npm_needs_command -a 'link ln' -d 'Symlink a package folder'
+for c in install add i 'in' ins inst insta instal isnt isnta isntal isntall install-test it link ln
+    complete -f -c npm -n "__fish_npm_using_command $c" -s S -l save -d 'Save to dependencies'
+    complete -f -c npm -n "__fish_npm_using_command $c" -l no-save -d 'Prevents saving to dependencies'
+    complete -f -c npm -n "__fish_npm_using_command $c" -s P -l save-prod -d 'Save to dependencies'
+    complete -f -c npm -n "__fish_npm_using_command $c" -s D -l save-dev -d 'Save to devDependencies'
+    complete -f -c npm -n "__fish_npm_using_command $c" -s O -l save-optional -d 'Save to optionalDependencies'
+    complete -f -c npm -n "__fish_npm_using_command $c" -s B -l save-bundle -d 'Also save to bundleDependencies'
+    complete -f -c npm -n "__fish_npm_using_command $c" -s E -l save-exact -d 'Save dependency with exact version'
+    complete -f -c npm -n "__fish_npm_using_command $c" -s g -l global -d 'Install package globally'
+    complete -x -c npm -n "__fish_npm_using_command $c" -l install-strategy -a 'hoisted nested shallow linked' -d 'Install strategy'
+    complete -x -c npm -n "__fish_npm_using_command $c" -l omit -a 'dev optional peer' -d 'Omit dependency type'
+    complete -x -c npm -n "__fish_npm_using_command $c" -l strict-peer-deps -d 'Treat conflicting peerDependencies as failure'
+    complete -x -c npm -n "__fish_npm_using_command $c" -l no-package-lock -d 'Ignore package-lock.json'
+    complete -f -c npm -n "__fish_npm_using_command $c" -l ignore-scripts -d "Don't run pre-, post- and life-cycle scripts"
+    complete -f -c npm -n "__fish_npm_using_command $c" -l no-audit -d "Don't submit audit reports"
+    complete -f -c npm -n "__fish_npm_using_command $c" -l no-bin-links -d "Don't symblink package executables"
+    complete -f -c npm -n "__fish_npm_using_command $c" -l no-fund -d "Don't display funding info"
+    complete -f -c npm -n "__fish_npm_using_command $c" -l dry-run -d 'Do not make any changes'
+    complete -f -c npm -n "__fish_npm_using_command $c" -l install-links -d 'Install file: protocol deps as regular deps'
+    complete -f -c npm -n "__fish_npm_using_command $c" -s h -l help -d 'Display help'
+
+    if test $c != link -a $c != ln
+        complete -f -c npm -n "__fish_npm_using_command $c" -l foreground-scripts -d 'Run all build scripts in the foreground'
+        complete -f -c npm -n "__fish_npm_using_command $c" -l prefer-dedupe -d 'Prefer to deduplicate packages'
+    end
+end
+
+# logout
+complete -f -c npm -n __fish_npm_needs_command -a logout -d 'Log out of the registry'
+complete -x -c npm -n '__fish_npm_using_command logout' -l registry -d 'Registry base URL'
+complete -x -c npm -n '__fish_npm_using_command logout' -l scope -d 'Log out of private repository'
+complete -f -c npm -n '__fish_npm_using_command logout' -s h -l help -d 'Display help'
+
+# ls
+# ll, la
+complete -f -c npm -n __fish_npm_needs_command -a 'ls list ll' -d 'List installed packages'
+for c in ls list ll la
+    complete -f -c npm -n "__fish_npm_using_command $c" -s a -l all -d 'Also show indirect dependencies'
+    complete -f -c npm -n "__fish_npm_using_command $c" -l json -d 'Output JSON'
+    complete -f -c npm -n "__fish_npm_using_command $c" -s l -l long -d 'Show extended information'
+    complete -f -c npm -n "__fish_npm_using_command $c" -s p -l parseable -d 'Output parseable results'
+    complete -f -c npm -n "__fish_npm_using_command $c" -s g -l global -d 'List global packages'
+    complete -x -c npm -n "__fish_npm_using_command $c" -l depth -d 'Dependency recursion depth'
+    complete -x -c npm -n "__fish_npm_using_command $c" -l omit -a 'dev optional peer' -d 'Omit dependency type'
+    complete -f -c npm -n "__fish_npm_using_command $c" -l linked -d 'Only show linked packages'
+    complete -f -c npm -n "__fish_npm_using_command $c" -l package-lock-only -d 'Only use package-lock.json, ignore node_modules'
+    complete -f -c npm -n "__fish_npm_using_command $c" -l unicode -d 'Use unicode characters in the output'
+    complete -f -c npm -n "__fish_npm_using_command $c" -l no-unicode -d 'Use ascii characters over unicode glyphs'
+    complete -f -c npm -n "__fish_npm_using_command $c" -l install-links -d 'Install file: protocol deps as regular deps'
+    complete -f -c npm -n "__fish_npm_using_command $c" -s h -l help -d 'Display help'
+end
+
+# outdated
+complete -f -c npm -n __fish_npm_needs_command -a outdated -d 'Check for outdated packages'
+complete -f -c npm -n '__fish_npm_using_command outdated' -s a -l all -d 'Also show indirect dependencies'
+complete -f -c npm -n '__fish_npm_using_command outdated' -l json -d 'Output JSON'
+complete -f -c npm -n '__fish_npm_using_command outdated' -s l -l long -d 'Show extended information'
+complete -f -c npm -n '__fish_npm_using_command outdated' -l parseable -d 'Output parseable results'
+complete -f -c npm -n '__fish_npm_using_command outdated' -s g -l global -d 'Check global packages'
+complete -f -c npm -n '__fish_npm_using_command outdated' -s h -l help -d 'Display help'
+
+# org
+complete -f -c npm -n __fish_npm_needs_command -a org -d 'Manage orgs'
+for c in org ogr
+    complete -f -c npm -n "__fish_npm_using_command $c" -n '__fish_is_nth_token 2' -a set -d 'Add a new user'
+    complete -f -c npm -n "__fish_npm_using_command $c" -n '__fish_is_nth_token 2' -a rm -d 'Remove a user'
+    complete -f -c npm -n "__fish_npm_using_command $c" -n '__fish_is_nth_token 2' -a ls -d 'List all users'
+
+    complete -f -c npm -n "__fish_npm_using_command $c" -n '__fish_is_nth_token 5' -n '__fish_seen_subcommand_from set' -a admin -d 'Add admin'
+    complete -f -c npm -n "__fish_npm_using_command $c" -n '__fish_is_nth_token 5' -n '__fish_seen_subcommand_from set' -a developer -d 'Add developer'
+    complete -f -c npm -n "__fish_npm_using_command $c" -n '__fish_is_nth_token 5' -n '__fish_seen_subcommand_from set' -a owner -d 'Add owner'
+    complete -f -c npm -n "__fish_npm_using_command $c" -s h -l help -d 'Display help'
 end
 
 # owner
-complete -f -c npm -n __fish_npm_needs_command -a owner -d 'Manage package owners'
-complete -f -c npm -n '__fish_npm_using_command owner' -a ls -d 'List package owners'
-complete -f -c npm -n '__fish_npm_using_command owner' -a add -d 'Add a new owner to package'
-complete -f -c npm -n '__fish_npm_using_command owner' -a rm -d 'Remove an owner from package'
-
-# remove
-for c in r remove rm un uninstall unlink
-    complete -f -c npm -n __fish_npm_needs_command -a "$c" -d 'remove package' -xa '(__yarn_installed_packages)'
-    complete -x -c npm -n "__fish_npm_using_command $c" -s g -l global -d 'remove global package'
-    complete -x -c npm -n "__fish_npm_using_command $c" -l save -d 'Package will be removed from your dependencies'
-    complete -x -c npm -n "__fish_npm_using_command $c" -l save-dev -d 'Package will be removed from your devDependencies'
-    complete -x -c npm -n "__fish_npm_using_command $c" -l save-optional -d 'Package will be removed from your optionalDependencies'
+for c in owner author
+    complete -f -c npm -n __fish_npm_needs_command -a "$c" -d 'Manage package owners'
+    complete -f -c npm -n "__fish_npm_using_command $c" -a ls -d 'List package owners'
+    complete -f -c npm -n "__fish_npm_using_command $c" -a add -d 'Add a new owner to package'
+    complete -f -c npm -n "__fish_npm_using_command $c" -a rm -d 'Remove an owner from package'
+    complete -x -c npm -n "__fish_npm_using_command $c" -l registry -d 'Registry base URL'
+    complete -x -c npm -n "__fish_npm_using_command $c" -l otp -d '2FA one-time password'
+    complete -f -c npm -n "__fish_npm_using_command $c" -s h -l help -d 'Display help'
 end
 
-# search
-for c in find s se search
-    complete -f -c npm -n __fish_npm_needs_command -a "$c" -d 'Search for packages'
-    complete -x -c npm -n "__fish_npm_using_command $c" -l long -d 'Display full package descriptions and other long text across multiple lines'
-end
-
-# update
-for c in up update
-    complete -f -c npm -n __fish_npm_needs_command -a "$c" -d 'Update package(s)'
-    complete -f -c npm -n "__fish_npm_using_command $c" -s g -l global -d 'Update global package(s)'
-end
-
-# misc shorter explanations
-complete -f -c npm -n __fish_npm_needs_command -a 'adduser add-user login' -d 'Add a registry user account'
-complete -f -c npm -n __fish_npm_needs_command -a bin -d 'Display npm bin folder'
-complete -f -c npm -n __fish_npm_needs_command -a 'bugs issues' -d 'Bugs for a package in a web browser maybe'
-complete -f -c npm -n __fish_npm_needs_command -a 'ddp dedupe find-dupes' -d 'Reduce duplication'
-complete -f -c npm -n __fish_npm_needs_command -a deprecate -d 'Deprecate a version of a package'
-complete -f -c npm -n __fish_npm_needs_command -a 'docs home' -d 'Docs for a package in a web browser maybe'
-complete -f -c npm -n __fish_npm_needs_command -a edit -d 'Edit an installed package'
-complete -f -c npm -n __fish_npm_needs_command -a explore -d 'Browse an installed package'
-complete -f -c npm -n __fish_npm_needs_command -a faq -d 'Frequently Asked Questions'
-complete -f -c npm -n __fish_npm_needs_command -a help-search -d 'Search npm help documentation'
-complete -f -c npm -n '__fish_npm_using_command help-search' -l long -d 'Display full package descriptions and other long text across multiple lines'
-complete -f -c npm -n __fish_npm_needs_command -a 'info v view' -d 'View registry info'
-complete -f -c npm -n __fish_npm_needs_command -a 'link ln' -d 'Symlink a package folder'
-complete -f -c npm -n __fish_npm_needs_command -a outdated -d 'Check for outdated packages'
+# pack
 complete -f -c npm -n __fish_npm_needs_command -a pack -d 'Create a tarball from a package'
-complete -f -c npm -n __fish_npm_needs_command -a prefix -d 'Display NPM prefix'
+complete -f -c npm -n '__fish_npm_using_command pack' -l dry-run -d 'Do not make any changes'
+complete -f -c npm -n '__fish_npm_using_command pack' -l json -d 'Output JSON'
+complete -x -c npm -n '__fish_npm_using_command pack' -l pack-destination -a '(__fish_complete_directories)' -d 'Tarball destination directory'
+complete -f -c npm -n '__fish_npm_using_command pack' -s h -l help -d 'Display help'
+
+# ping
+complete -f -c npm -n __fish_npm_needs_command -a ping -d 'Ping npm registry'
+complete -x -c npm -n '__fish_npm_using_command ping' -l registry -d 'Registry base URL'
+complete -f -c npm -n '__fish_npm_using_command ping' -s h -l help -d 'Display help'
+
+# pkg
+complete -f -c npm -n __fish_npm_needs_command -a pkg -d 'Manages your package.json'
+complete -x -c npm -n '__fish_npm_using_command pkg' -a set -d 'Sets a value'
+complete -x -c npm -n '__fish_npm_using_command pkg' -a get -d 'Retrieves a value'
+complete -x -c npm -n '__fish_npm_using_command pkg' -a delete -d 'Deletes a key'
+complete -f -c npm -n '__fish_npm_using_command pkg' -s f -l force -d 'Removes various protections'
+complete -f -c npm -n '__fish_npm_using_command pkg' -l json -d 'Parse values with JSON.parse()'
+complete -f -c npm -n '__fish_npm_using_command pkg' -s h -l help -d 'Display help'
+
+# prefix
+complete -f -c npm -n __fish_npm_needs_command -a prefix -d 'Display npm prefix'
+complete -f -c npm -n '__fish_npm_using_command prefix' -s g -l global -d 'Display global prefix'
+complete -f -c npm -n '__fish_npm_using_command prefix' -s h -l help -d 'Display help'
+
+# profile
+set -l profile_commands 'enable-2fa disable-2fa get set'
+complete -f -c npm -n __fish_npm_needs_command -a profile -d 'Change settings on your registry profile'
+complete -x -c npm -n '__fish_npm_using_command profile' -n "not __fish_seen_subcommand_from $profile_commands" -a enable-2fa -d 'Enables two-factor authentication'
+complete -x -c npm -n '__fish_npm_using_command profile' -n "not __fish_seen_subcommand_from $profile_commands" -a disable-2fa -d 'Disables two-factor authentication'
+complete -x -c npm -n '__fish_npm_using_command profile' -n "not __fish_seen_subcommand_from $profile_commands" -a get -d 'Display profile properties'
+complete -x -c npm -n '__fish_npm_using_command profile' -n "not __fish_seen_subcommand_from $profile_commands" -a set -d 'Set the value of a profile property'
+complete -x -c npm -n '__fish_npm_using_command profile' -n '__fish_seen_subcommand_from enable-2fa' -a auth-only -d 'Requiere an OTP on profile changes'
+complete -x -c npm -n '__fish_npm_using_command profile' -n '__fish_seen_subcommand_from enable-2fa' -a auth-and-writes -d 'Also requiere an OTP on package changes'
+complete -f -c npm -n '__fish_npm_using_command profile' -s h -l help -d 'Display help'
+
+# prune
 complete -f -c npm -n __fish_npm_needs_command -a prune -d 'Remove extraneous packages'
-complete -c npm -n __fish_npm_needs_command -a publish -d 'Publish a package'
-complete -f -c npm -n __fish_npm_needs_command -a 'rb rebuild' -d 'Rebuild a package'
-complete -f -c npm -n __fish_npm_needs_command -a 'root ' -d 'Display npm root'
-complete -f -c npm -n __fish_npm_needs_command -a 'run-script run' -d 'Run arbitrary package scripts'
-complete -f -c npm -n __fish_npm_needs_command -a shrinkwrap -d 'Lock down dependency versions'
-complete -f -c npm -n __fish_npm_needs_command -a star -d 'Mark your favorite packages'
-complete -f -c npm -n __fish_npm_needs_command -a stars -d 'View packages marked as favorites'
+complete -x -c npm -n '__fish_npm_using_command prune' -l omit -a 'dev optional peer' -d 'Omit dependency type'
+complete -f -c npm -n '__fish_npm_using_command prune' -l dry-run -d 'Do not make any changes'
+complete -f -c npm -n '__fish_npm_using_command prune' -l json -d 'Output JSON'
+complete -f -c npm -n '__fish_npm_using_command prune' -l foreground-scripts -d 'Run all build scripts in the foreground'
+complete -f -c npm -n '__fish_npm_using_command prune' -l ignore-scripts -d "Don't run pre-, post- and life-cycle scripts"
+complete -f -c npm -n '__fish_npm_using_command prune' -l install-links -d 'Install file: protocol deps as regular deps'
+complete -f -c npm -n '__fish_npm_using_command prune' -s h -l help -d 'Display help'
+
+# publish
+complete -f -c npm -n __fish_npm_needs_command -a publish -d 'Publish a package'
+complete -x -c npm -n '__fish_npm_using_command publish' -l tag -d 'Upload to tag'
+complete -x -c npm -n '__fish_npm_using_command publish' -l access -d 'Restrict access' -a "public\t'Publicly viewable' restricted\t'Restricted access (scoped packages only)'"
+complete -f -c npm -n '__fish_npm_using_command publish' -l dry-run -d 'Do not make any changes'
+complete -x -c npm -n '__fish_npm_using_command publish' -l otp -d '2FA one-time password'
+complete -f -c npm -n '__fish_npm_using_command publish' -l provenance -d 'Link to build location when publishing from CI/CD'
+complete -f -c npm -n '__fish_npm_using_command publish' -s h -l help -d 'Display help'
+
+# query
+complete -f -c npm -n __fish_npm_needs_command -a query -d 'Dependency selector query'
+complete -f -c npm -n '__fish_npm_using_command query' -s g -l global -d 'Query global packages'
+complete -f -c npm -n '__fish_npm_using_command query' -s h -l help -d 'Display help'
+
+# rebuild
+complete -f -c npm -n __fish_npm_needs_command -a rebuild -d 'Rebuild a package'
+for c in rebuild rb
+    complete -x -c npm -n "__fish_npm_using_command $c" -s g -l global -d 'Rebuild global package'
+    complete -f -c npm -n "__fish_npm_using_command $c" -l foreground-scripts -d 'Run all build scripts in the foreground'
+    complete -f -c npm -n "__fish_npm_using_command $c" -l ignore-scripts -d "Don't run pre-, post- and life-cycle scripts"
+    complete -f -c npm -n "__fish_npm_using_command $c" -l no-bin-links -d "Don't symblink package executables"
+    complete -f -c npm -n "__fish_npm_using_command $c" -l install-links -d 'Install file: protocol deps as regular deps'
+    complete -f -c npm -n "__fish_npm_using_command $c" -s h -l help -d 'Display help'
+end
+
+# repo
+complete -f -c npm -n __fish_npm_needs_command -a repo -d 'Open package repository page in the browser'
+complete -f -c npm -n '__fish_npm_using_command repo' -s g -l global -d 'Display global root'
+complete -x -c npm -n '__fish_npm_using_command repo' -l browser -d 'Set browser'
+complete -x -c npm -n '__fish_npm_using_command repo' -l no-browser -d 'Print to stdout'
+complete -x -c npm -n '__fish_npm_using_command repo' -l registry -d 'Registry base URL'
+complete -f -c npm -n '__fish_npm_using_command repo' -s h -l help -d 'Display help'
+
+# restart
+# start
+# stop
+# test
+complete -f -c npm -n __fish_npm_needs_command -a restart -d 'Restart a package'
 complete -f -c npm -n __fish_npm_needs_command -a start -d 'Start a package'
 complete -f -c npm -n __fish_npm_needs_command -a stop -d 'Stop a package'
-complete -f -c npm -n __fish_npm_needs_command -a submodule -d 'Add a package as a git submodule'
-complete -f -c npm -n __fish_npm_needs_command -a 't tst test' -d 'Test a package'
+complete -f -c npm -n __fish_npm_needs_command -a test -d 'Test a package'
+for c in restart start stop test tst t
+    complete -f -c npm -n "__fish_npm_using_command $c" -s ignore-scripts -d "Don't run pre-, post- and life-cycle scripts"
+    complete -x -c npm -n "__fish_npm_using_command $c" -s script-shell -d 'The shell to use for scripts'
+    complete -f -c npm -n "__fish_npm_using_command $c" -s h -l help -d 'Display help'
+end
+
+# root
+complete -f -c npm -n __fish_npm_needs_command -a root -d 'Display npm root'
+complete -f -c npm -n '__fish_npm_using_command root' -s g -l global -d 'Display global root'
+complete -f -c npm -n '__fish_npm_using_command root' -s h -l help -d 'Display help'
+
+# search
+complete -f -c npm -n __fish_npm_needs_command -a 'search find' -d 'Search for packages'
+for c in search find s se
+    complete -f -c npm -n "__fish_npm_using_command $c" -s l -l long -d 'Show extended information'
+    complete -f -c npm -n "__fish_npm_using_command $c" -l json -d 'Output JSON data'
+    complete -f -c npm -n "__fish_npm_using_command $c" -l color -a always -d 'Print color'
+    complete -x -c npm -n "__fish_npm_using_command $c" -l color -a always -d 'Print color'
+    complete -f -c npm -n "__fish_npm_using_command $c" -l no-color -d "Don't print color"
+    complete -f -c npm -n "__fish_npm_using_command $c" -s p -l parseable -d 'Output parseable results'
+    complete -f -c npm -n "__fish_npm_using_command $c" -l no-description -d "Don't show the description"
+    complete -x -c npm -n "__fish_npm_using_command $c" -l searchopts -d 'Space-separated search options'
+    complete -x -c npm -n "__fish_npm_using_command $c" -l searchexclude -d 'Space-separated options to exclude from search'
+    complete -x -c npm -n "__fish_npm_using_command $c" -l registry -d 'Registry base URL'
+    complete -f -c npm -n "__fish_npm_using_command $c" -l prefer-online -d 'Force staleness checks for cached data'
+    complete -f -c npm -n "__fish_npm_using_command $c" -l prefer-offline -d 'Bypass staleness checks for cached data'
+    complete -f -c npm -n "__fish_npm_using_command $c" -l offline -d 'Force offline mode'
+    complete -f -c npm -n "__fish_npm_using_command $c" -s h -l help -d 'Display help'
+end
+
+# shrinkwrap
+complete -f -c npm -n __fish_npm_needs_command -a shrinkwrap -d 'Lock down dependency versions'
+complete -f -c npm -n '__fish_npm_using_command shrinkwrap' -s h -l help -d 'Display help'
+
+# star
+complete -f -c npm -n __fish_npm_needs_command -a star -d 'Mark your favorite packages'
+complete -x -c npm -n '__fish_npm_using_command star' -l registry -d 'Registry base URL'
+complete -f -c npm -n '__fish_npm_using_command star' -l unicode -d 'Use unicode characters in the output'
+complete -f -c npm -n '__fish_npm_using_command star' -l no-unicode -d 'Use ascii characters over unicode glyphs'
+complete -x -c npm -n '__fish_npm_using_command star' -l otp -d '2FA one-time password'
+complete -f -c npm -n '__fish_npm_using_command star' -s h -l help -d 'Display help'
+
+# stars
+complete -f -c npm -n __fish_npm_needs_command -a stars -d 'View packages marked as favorites'
+complete -x -c npm -n '__fish_npm_using_command stars' -l registry -d 'Registry base URL'
+complete -f -c npm -n '__fish_npm_using_command stars' -s h -l help -d 'Display help'
+
+# team
+set -l team_commands 'create destroy add rm ls'
+complete -f -c npm -n __fish_npm_needs_command -a team -d 'Manage organization teams and team memberships'
+complete -x -c npm -n '__fish_npm_using_command team' -n "not __fish_seen_subcommand_from $team_commands" -a create -d 'Create a new team'
+complete -x -c npm -n '__fish_npm_using_command team' -n "not __fish_seen_subcommand_from $team_commands" -a destroy -d 'Destroy an existing team'
+complete -x -c npm -n '__fish_npm_using_command team' -n "not __fish_seen_subcommand_from $team_commands" -a add -d 'Add a user to an existing team'
+complete -x -c npm -n '__fish_npm_using_command team' -n "not __fish_seen_subcommand_from $team_commands" -a rm -d 'Remove users from a team'
+complete -x -c npm -n '__fish_npm_using_command team' -n "not __fish_seen_subcommand_from $team_commands" -a ls -d 'List teams or team members'
+complete -x -c npm -n '__fish_npm_using_command team' -n 'not __fish_seen_subcommand_from ls' -l otp -d '2FA one-time password'
+complete -x -c npm -n '__fish_npm_using_command team' -l registry -d 'Registry base URL'
+complete -f -c npm -n '__fish_npm_using_command team' -s p -l parseable -d 'Output parseable results'
+complete -f -c npm -n '__fish_npm_using_command team' -l json -d 'Output JSON'
+complete -f -c npm -n '__fish_npm_using_command team' -s h -l help -d 'Display help'
+
+# token
+set -l token_commands 'create destroy add rm ls'
+complete -f -c npm -n __fish_npm_needs_command -a token -d 'Manage your authentication tokens'
+complete -x -c npm -n '__fish_npm_using_command token' -n "not __fish_seen_subcommand_from $token_commands" -a list -d 'Shows active authentication tokens'
+complete -x -c npm -n '__fish_npm_using_command token' -n "not __fish_seen_subcommand_from $token_commands" -a revoke -d 'Revokes an authentication token'
+complete -x -c npm -n '__fish_npm_using_command token' -n "not __fish_seen_subcommand_from $token_commands" -a create -d 'Create a new authentication token'
+complete -f -c npm -n '__fish_npm_using_command token' -n '__fish_seen_subcommand_from create' -l read-only -d 'Mark a token as unable to publish'
+complete -x -c npm -n '__fish_npm_using_command token' -n '__fish_seen_subcommand_from create' -l cidr -d 'List of CIDR address'
+complete -x -c npm -n '__fish_npm_using_command token' -l registry -d 'Registry base URL'
+complete -x -c npm -n '__fish_npm_using_command token' -l otp -d '2FA one-time password'
+complete -f -c npm -n '__fish_npm_using_command token' -s h -l help -d 'Display help'
+
+# update
+complete -f -c npm -n __fish_npm_needs_command -a 'update up upgrade' -d 'Update package(s)'
+for c in update up upgrade udpate
+    complete -f -c npm -n "__fish_npm_using_command $c" -s S -l save -d 'Save to dependencies'
+    complete -x -c npm -n "__fish_npm_using_command $c" -l no-save -d 'Do not remove package from your dependencies'
+    complete -f -c npm -n "__fish_npm_using_command $c" -s g -l global -d 'Update global package(s)'
+    complete -x -c npm -n "__fish_npm_using_command $c" -l install-strategy -a 'hoisted nested shallow linked' -d 'Install strategy'
+    complete -x -c npm -n "__fish_npm_using_command $c" -l omit -a 'dev optional peer' -d 'Omit dependency type'
+    complete -x -c npm -n "__fish_npm_using_command $c" -l strict-peer-deps -d 'Treat conflicting peerDependencies as failure'
+    complete -x -c npm -n "__fish_npm_using_command $c" -l no-package-lock -d 'Ignore package-lock.json'
+    complete -f -c npm -n "__fish_npm_using_command $c" -l foreground-scripts -d 'Run all build scripts in the foreground'
+    complete -f -c npm -n "__fish_npm_using_command $c" -l ignore-scripts -d "Don't run pre-, post- and life-cycle scripts"
+    complete -f -c npm -n "__fish_npm_using_command $c" -l no-audit -d "Don't submit audit reports"
+    complete -f -c npm -n "__fish_npm_using_command $c" -l no-bin-links -d "Don't symblink package executables"
+    complete -f -c npm -n "__fish_npm_using_command $c" -l no-fund -d "Don't display funding info"
+    complete -f -c npm -n "__fish_npm_using_command $c" -l dry-run -d 'Do not make any changes'
+    complete -f -c npm -n "__fish_npm_using_command $c" -l install-links -d 'Install file: protocol deps as regular deps'
+    complete -f -c npm -n "__fish_npm_using_command $c" -s h -l help -d 'Display help'
+end
+
+# uninstall
+complete -f -c npm -n __fish_npm_needs_command -a 'uninstall remove un' -d 'Remove a package'
+for c in uninstall unlink remove rm r un
+    complete -x -c npm -n "__fish_npm_using_command $c" -d 'Remove package' -a '(__npm_installed_local_packages)'
+    complete -x -c npm -n "__fish_npm_using_command $c" -s g -l global -d 'Remove global package' -a '(__npm_installed_global_packages)'
+    complete -f -c npm -n "__fish_npm_using_command $c" -s S -l save -d 'Save to dependencies'
+    complete -x -c npm -n "__fish_npm_using_command $c" -l no-save -d 'Do not remove package from your dependencies'
+    complete -f -c npm -n "__fish_npm_using_command $c" -l install-links -d 'Install file: protocol deps as regular deps'
+end
+
+# unpublish
 complete -f -c npm -n __fish_npm_needs_command -a unpublish -d 'Remove a package from the registry'
+complete -x -c npm -n '__fish_npm_using_command unpublish' -l dry-run -d 'Do not make any changes'
+complete -x -c npm -n '__fish_npm_using_command unpublish' -s f -l force -d 'Removes various protections'
+complete -f -c npm -n '__fish_npm_using_command unpublish' -s h -l help -d 'Display help'
+
+# unstar
 complete -f -c npm -n __fish_npm_needs_command -a unstar -d 'Remove star from a package'
+complete -x -c npm -n '__fish_npm_using_command unstar' -l registry -d 'Registry base URL'
+complete -f -c npm -n '__fish_npm_using_command unstar' -l unicode -d 'Use unicode characters in the output'
+complete -f -c npm -n '__fish_npm_using_command unstar' -l no-unicode -d 'Use ascii characters over unicode glyphs'
+complete -x -c npm -n '__fish_npm_using_command unstar' -l otp -d '2FA one-time password'
+complete -f -c npm -n '__fish_npm_using_command unstar' -s h -l help -d 'Display help'
+
+# version
 complete -f -c npm -n __fish_npm_needs_command -a version -d 'Bump a package version'
+for c in version verison
+    complete -x -c npm -n "__fish_npm_using_command $c" -a 'major minor patch premajor preminor prepatch prerelease'
+    complete -f -c npm -n "__fish_npm_using_command $c" -l allow-same-version -d 'Allow same version'
+    complete -f -c npm -n "__fish_npm_using_command $c" -l no-commit-hooks -d "Don't run git commit hooks"
+    complete -f -c npm -n "__fish_npm_using_command $c" -l no-git-tag-version -d "Don't tag the commit"
+    complete -f -c npm -n "__fish_npm_using_command $c" -l json -d 'Output JSON'
+    complete -x -c npm -n "__fish_npm_using_command $c" -l preid -d 'The prerelease identifier'
+    complete -f -c npm -n "__fish_npm_using_command $c" -l sign-git-tag -d 'Sign the version tag'
+    complete -f -c npm -n "__fish_npm_using_command $c" -s h -l help -d 'Display help'
+end
+
+# view
+complete -f -c npm -n __fish_npm_needs_command -a 'view info' -d 'View registry info'
+for c in view info v show
+    complete -f -c npm -n "__fish_npm_using_command $c" -n '__fish_is_nth_token 2'
+    complete -f -c npm -n "__fish_npm_using_command $c" -n '__fish_is_nth_token 3' -a 'author bin bugs description engines exports homepage keywords license main name repository scripts type types'
+    complete -f -c npm -n "__fish_npm_using_command $c" -n '__fish_is_nth_token 3' -a 'dependencies devDependencies optionalDependencies peerDependencies'
+    complete -f -c npm -n "__fish_npm_using_command $c" -n '__fish_is_nth_token 3' -a 'directories dist dist-tags gitHead maintainers readme time users version versions'
+    complete -f -c npm -n "__fish_npm_using_command $c" -l json -d 'Output JSON'
+    complete -f -c npm -n "__fish_npm_using_command $c" -s h -l help -d 'Display help'
+end
+
+# whoami
 complete -f -c npm -n __fish_npm_needs_command -a whoami -d 'Display npm username'
-complete -f -c npm -n '__fish_seen_subcommand_from add i install; and not __fish_is_switch' -a "(__yarn_filtered_list_packages \"$npm_install\")"
+complete -f -c npm -n '__fish_npm_using_command whoami' -a registry -d 'Check registry'
+complete -f -c npm -n '__fish_npm_using_command whoami' -s h -l help -d 'Display help'
+
+# misc
+complete -f -c npm -n '__fish_seen_subcommand_from add i in ins inst insta instal isnt isnta isntal isntall; and not __fish_is_switch' -a "(__npm_filtered_list_packages \"$npm_install\")"
diff --git a/share/completions/yarn.fish b/share/completions/yarn.fish
index 68360d40e..651f0a324 100644
--- a/share/completions/yarn.fish
+++ b/share/completions/yarn.fish
@@ -7,8 +7,8 @@ set -l yarn_add "yarn global add"
 # because it won't be matched. But we can prevent the slowdown from getting
 # a list of all packages and filtering through it if we only do that when
 # completing what seems to be a package name.
-complete -f -c yarn -n '__fish_seen_subcommand_from remove; and not __fish_is_switch' -xa '(__yarn_installed_packages)'
-complete -f -c yarn -n '__fish_seen_subcommand_from add; and not __fish_is_switch' -xa "(__yarn_filtered_list_packages \"$yarn_add\")"
+complete -f -c yarn -n '__fish_seen_subcommand_from remove; and not __fish_is_switch' -xa '(__npm_installed_local_packages)'
+complete -f -c yarn -n '__fish_seen_subcommand_from add; and not __fish_is_switch' -xa "(__npm_filtered_list_packages \"$yarn_add\")"
 
 complete -f -c yarn -n __fish_use_subcommand -a help -d 'Show available commands and flags'
 
diff --git a/share/functions/__fish_npm_helper.fish b/share/functions/__fish_npm_helper.fish
index 20f8a9684..f1762a0a4 100644
--- a/share/functions/__fish_npm_helper.fish
+++ b/share/functions/__fish_npm_helper.fish
@@ -5,17 +5,17 @@
 
 # If all-the-package-names is installed, it will be used to generate npm completions.
 # Install globally with `sudo npm install -g all-the-package-names`. Keep it up to date.
-function __yarn_helper_installed
+function __npm_helper_installed
     # This function takes the command to globally install a package as $argv[1]
     if not type -q all-the-package-names
-        if not set -qg __fish_yarn_pkg_info_shown
+        if not set -qg __fish_npm_pkg_info_shown
             set -l old (commandline)
             commandline -r ""
             echo \nfish: Run `$argv[1] all-the-package-names` to gain intelligent \
                 package completion >&2
             commandline -f repaint
             commandline -r $old
-            set -g __fish_yarn_pkg_info_shown 1
+            set -g __fish_npm_pkg_info_shown 1
         end
         return 1
     end
@@ -23,9 +23,9 @@ end
 
 # Entire list of packages is too long to be used efficiently in a `complete` subcommand.
 # Search it for matches instead.
-function __yarn_filtered_list_packages
+function __npm_filtered_list_packages
     # This function takes the command to globally install a package as $argv[1]
-    if not __yarn_helper_installed $argv[1]
+    if not __npm_helper_installed $argv[1]
         return
     end
 
@@ -37,7 +37,7 @@ function __yarn_filtered_list_packages
     end
 end
 
-function __yarn_find_package_json
+function __npm_find_package_json
     set -l parents (__fish_parent_directories (pwd -P))
 
     for p in $parents
@@ -50,8 +50,26 @@ function __yarn_find_package_json
     return 1
 end
 
-function __yarn_installed_packages
-    set -l package_json (__yarn_find_package_json)
+function __npm_installed_global_packages
+	set -l prefix (npm prefix -g)
+	set -l node_modules "$prefix/lib/node_modules"
+
+	for path in $node_modules/*
+		set -l mod (path basename -- $path)
+
+		if string match -rq "^@" $mod
+			for sub_path in $path/*
+				set -l sub_mod (string split '/' $sub_path)[-1]
+				echo $mod/$sub_mod
+			end
+		else
+			echo $mod
+		end
+	end
+end
+
+function __npm_installed_local_packages
+    set -l package_json (__npm_find_package_json)
     if not test $status -eq 0
         # no package.json in tree
         return 1

From afc672e52f6f27bccb515d3ed3b13fd593a38d77 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Florian=20Mei=C3=9Fner?=
 <936176+t-nil@users.noreply.github.com>
Date: Wed, 18 Oct 2023 12:09:54 +0200
Subject: [PATCH 155/200] Fix typo in `read` doc

(cherry picked from commit b16a86990736a8b1393f9a508d7fdbe4aab51499)
---
 doc_src/cmds/read.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc_src/cmds/read.rst b/doc_src/cmds/read.rst
index ab19e063a..a936ff515 100644
--- a/doc_src/cmds/read.rst
+++ b/doc_src/cmds/read.rst
@@ -125,7 +125,7 @@ Delimiters given via "-d" are taken as one string::
     echo $first # outputs "a b", $second is empty
 
     echo 'a"foo bar"b (command echo wurst)*" "{a,b}' | read -lt -l a b c
-    echo $a # outputs 'afoo bar' (without the quotes)
+    echo $a # outputs 'afoo barb' (without the quotes)
     echo $b # outputs '(command echo wurst)* {a,b}' (without the quotes)
     echo $c # nothing
 

From 65beb9307a11c4f4031fd4c80ff48e130484f8fd Mon Sep 17 00:00:00 2001
From: "Eric N. Vander Weele" <ericvw@gmail.com>
Date: Sun, 24 Dec 2023 14:12:32 -0500
Subject: [PATCH 156/200] themes: Synchronize Nord theme in adherence to color
 palette guidelines

Adhere as best as possible to the style guidelines at
https://www.nordtheme.com/docs/colors-and-palettes. Some adaptations were made
so that `functions <function>` is also syntax highlighted per the upstream
recommendations.

Additionally, the theme file has been reordered to follow the order of variables
defined in interactive syntax-highlighting-variables documentation.

(cherry picked from commit 48ef682cad9ee39ee0c3a3f6825f7b126603dcd5)
---
 share/tools/web_config/themes/Nord.theme | 57 ++++++++++++------------
 1 file changed, 29 insertions(+), 28 deletions(-)

diff --git a/share/tools/web_config/themes/Nord.theme b/share/tools/web_config/themes/Nord.theme
index 3d837bbe2..ebe7e8a0c 100644
--- a/share/tools/web_config/themes/Nord.theme
+++ b/share/tools/web_config/themes/Nord.theme
@@ -3,32 +3,33 @@
 # url: https://www.nordtheme.com
 
 fish_color_normal normal
-fish_color_command 81a1c1
-fish_color_quote a3be8c
-fish_color_redirection b48ead
-fish_color_end 88c0d0
-fish_color_error ebcb8b
-fish_color_param eceff4
-fish_color_comment 434c5e
-fish_color_match --background=brblue
-fish_color_selection white --bold --background=brblack
-fish_color_search_match bryellow --background=brblack
-fish_color_history_current --bold
-fish_color_operator 00a6b2
-fish_color_escape 00a6b2
-fish_color_cwd green
-fish_color_cwd_root red
-fish_color_valid_path --underline
-fish_color_autosuggestion 4c566a
-fish_color_user brgreen
-fish_color_host normal
-fish_color_cancel -r
-fish_pager_color_completion normal
-fish_pager_color_prefix normal --bold --underline
-fish_pager_color_description B3A06D yellow
-fish_pager_color_progress brwhite --background=cyan
-fish_pager_color_selected_background --background=brblack
-fish_color_option eceff4
+fish_color_command 88c0d0
 fish_color_keyword 81a1c1
-fish_color_host_remote yellow
-fish_color_status red
+fish_color_quote a3be8c
+fish_color_redirection b48ead --bold
+fish_color_end 81a1c1
+fish_color_error bf616a
+fish_color_param d8dee9
+fish_color_valid_path --underline
+fish_color_option 8fbcbb
+fish_color_comment 4c566a --italics
+fish_color_selection d8dee9 --bold --background=434c5e
+fish_color_operator 81a1c1
+fish_color_escape ebcb8b
+fish_color_autosuggestion 4c566a
+fish_color_cwd 5e81ac
+fish_color_cwd_root bf616a
+fish_color_user a3be8c
+fish_color_host a3be8c
+fish_color_host_remote ebcb8b
+fish_color_status bf616a
+fish_color_cancel --reverse
+fish_color_match --background=brblue
+fish_color_search_match --bold --background=434c5e
+fish_color_history_current e5e9f0 --bold
+
+fish_pager_color_progress 3b4252 --background=d08770
+fish_pager_color_completion e5e9f0
+fish_pager_color_prefix normal --bold --underline
+fish_pager_color_description ebcb8b --italics
+fish_pager_color_selected_background --background=434c5e

From ba5770427686516b1e307da0e54955d8b639b86a Mon Sep 17 00:00:00 2001
From: David Adam <zanchey@ucc.gu.uwa.edu.au>
Date: Fri, 29 Dec 2023 23:56:46 +0800
Subject: [PATCH 157/200] CHANGELOG: work on 3.7.0

---
 CHANGELOG.rst | 23 ++++++++++++++++-------
 1 file changed, 16 insertions(+), 7 deletions(-)

diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index deaded63a..5d449a5f5 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -1,7 +1,7 @@
 fish 3.7.0 (released ???)
 ====================================
 
-.. ignore: 3443 5319 7375 9500 9515 9528 9538 9565 9667 9681 9690 9692 9704 9706 9707 9713 9718 9719 9721 9722 9728 9732 9734 9738 9741 9742 9743 9753 9759 9776 9783 9804 9812 9825 9848 9850 9871 9875 9878 9880 9882 9899 9910 9914 9915 9919 9926 9932 9939 9943 9956 9960 9965 9970 9972 9975 9976 9977 9982 9983
+.. ignore: 3443 5319 7375 9500 9515 9528 9538 9565 9667 9681 9690 9692 9704 9706 9707 9713 9718 9719 9721 9722 9728 9732 9734 9738 9741 9742 9743 9753 9759 9776 9783 9800 9804 9812 9825 9848 9850 9871 9875 9878 9880 9882 9899 9910 9914 9915 9919 9926 9932 9939 9943 9956 9960 9965 9970 9972 9975 9976 9977 9982 9983 9994 10007 10008 10011 10020 10023 10029 10038 10039 10051 10055 10059 10062
 
 Notable improvements and fixes
 ------------------------------
@@ -20,14 +20,14 @@ Scripting improvements
 - ``string repeat`` no longer overflows if the count is a multiple of the chunk size (:issue:`9900`).
 - The ``builtin`` builtin will now properly error out with invalid arguments instead of doing nothing and returning true (:issue:`9942`).
 - ``command time`` in a pipeline is allowed again, as is ``command and`` and ``command or`` (:issue:`9985`).
-- ``exec`` will now also apply variable overrides, so ``FOO=bar exec`` will now set $FOO correctly (:issue:`9995`).
+- ``exec`` will now also apply variable overrides, so ``FOO=bar exec`` will now set ``$FOO`` correctly (:issue:`9995`).
 
 Interactive improvements
 ------------------------
 - The :kbd:`Alt`\ +\ :kbd:`s` binding now also checks ``please`` in addition to ``sudo`` and ``doas``
 - The history pager will now also attempt subsequence matches (:issue:`9476`), so you can find a commandline like ``git log 3.6.1..Integration_3.7.0`` by searching for ``gitInt``.
 - Closing the history pager with enter will now copy the search text to the commandline if there was no match, so you can continue editing the command you tried to find right away (:issue:`9934`).
-- Opening the history pager will now fill the search field with a search string if you're already in a search (:issue:`10005`). This makes it nicer to search something with up-arrow and then later decide to switch to the full pager.
+- Opening the history pager will now fill the search field with a search string if you're already in a search (:issue:`10005`). This makes it nicer to search something with :kbd:`↑` and then later decide to switch to the full pager.
 - ``read`` no longer enables bracketed paste so it doesn't stay enabled in combined commandlines like ``mysql -p(read --silent)`` (:issue:`8285`).
 - Vi mode now uses :envvar:`fish_cursor_external` to set the cursor shape for external commands (:issue:`4656`).
 - Vi mode cursor shaping is now enabled in iTerm2 (:issue:`9698`).
@@ -41,7 +41,7 @@ Interactive improvements
 - ``fish_key_reader`` will now use printable characters as-is, so pressing "ö" no longer leads to it telling you to bind ``\u00F6`` (:issue:`9986`).
 - fish can now be configured to wait a specified amount of time for a multi-key sequence to be completed,  instead of waiting indefinitely. For example, this makes binding ``kj`` to switching modes in vi mode possible.
   The timeout can be set via the new :envvar:`fish_sequence_key_delay_ms` (:issue:`7401`), and may be set by default in future versions.
-- ``open`` no longer works around an xdg-open bug that was finally fixed and can be used to launch terminal programs again (:issue:`10045`).
+- ``open`` can be used to launch terminal programs again, as an ``xdg-open`` bug has been fixed and a workaround has been removed  (:issue:`10045`).
 - The ``repaint-mode`` binding will now only move the cursor if there is repainting to be done. This fixes :kbd:`Alt` combination bindings in vi mode (:issue:`7910`).
 - A new ``clear-screen`` bind function is used for :kbd:`Ctrl`\ +\ :kbd:`l` by default. This clears the screen and repaints the existing prompt at first,
   so it eliminates visible flicker unless the terminal is very slow (:issue:`10044`).
@@ -61,26 +61,35 @@ Completions
   - ``age`` and ``age-keygen`` (:issue:`9813`)
   - ``ar`` (:issue:`9720`)
   - ``blender`` (:issue:`9905`)
+  - ``crc`` (:issue:`10034`)
   - ``gimp`` (:issue:`9904`)
   - ``gojq`` (:issue:`9740`)
   - ``horcrux`` (:issue:`9922`)
+  - ``ibmcloud`` (:issue:`10004`)
   - ``iwctl`` (:issue:`6884`)
+  - ``java_home`` (:issue:`9998`)
   - ``krita`` (:issue:`9903`)
+  - ``oc`` (:issue:`10034`)
   - ``qjs`` (:issue:`9723`)
   - ``qjsc`` (:issue:`9731`)
   - ``rpm-ostool`` (:issue:`9669`)
+  - ``userdel`` (:issue:`10056`)
+  - ``watchexec`` (:issue:`10027`)
+  - ``wpctl`` (:issue:`10043`)
   - ``zabbix`` (:issue:`9647`)
 - The ``zfs`` completions no longer print errors about setting a read-only variable (:issue:`9705`).
 - The ``kitty`` completions have been removed in favor of keeping them upstream (:issue:`9750`).
 - ``git`` completions now support aliases that reference other aliases (:issue:`9992`).
-- Improvements to many completions.
+- Improvements to many other completions.
 - Improvements to the manual page completion generator (:issue:`9787`, :issue:`9814`, :issue:`9961`).
 
 Other improvements
 ------------------
 - Improvements and corrections to the documentation.
-- The Web-based configuration now uses a more readable style when printed, such as for a keybinding reference (:issue:`9828`)
-- Updates to the German translations (:issue:`9824`)
+- The Web-based configuration now uses a more readable style when printed, such as for a keybinding reference (:issue:`9828`).
+- Updates to the German translations (:issue:`9824`).
+- Improved error messages for errors occurring in command substitutions (:issue:`10054`).
+- The colors of the Nord theme better match their official style (:issue:`10168`).
 
 For distributors
 ----------------

From 7370e3806920c41f18943b0185ffc2328e9cb838 Mon Sep 17 00:00:00 2001
From: tangowithfoxtrot <5676771+tangowithfoxtrot@users.noreply.github.com>
Date: Wed, 20 Dec 2023 09:16:30 -0800
Subject: [PATCH 158/200] add completions for `bws`

Closes #10165
---
 CHANGELOG.rst              | 1 +
 share/completions/bws.fish | 1 +
 2 files changed, 2 insertions(+)
 create mode 100644 share/completions/bws.fish

diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index 5d449a5f5..e6fade8fb 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -61,6 +61,7 @@ Completions
   - ``age`` and ``age-keygen`` (:issue:`9813`)
   - ``ar`` (:issue:`9720`)
   - ``blender`` (:issue:`9905`)
+  - ``bws`` (:issue:`10165`).
   - ``crc`` (:issue:`10034`)
   - ``gimp`` (:issue:`9904`)
   - ``gojq`` (:issue:`9740`)
diff --git a/share/completions/bws.fish b/share/completions/bws.fish
new file mode 100644
index 000000000..082342e29
--- /dev/null
+++ b/share/completions/bws.fish
@@ -0,0 +1 @@
+bws completions fish | source

From 03198b7fd30f9f68a807e6550be1bda837d5a1a5 Mon Sep 17 00:00:00 2001
From: Grzegorz Milka <grzegorzmilka@gmail.com>
Date: Sun, 10 Dec 2023 17:21:11 +0100
Subject: [PATCH 159/200] Add git stash push completions

Closes #10147
---
 share/completions/git.fish | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/share/completions/git.fish b/share/completions/git.fish
index 54b3e4cff..f3b08303f 100644
--- a/share/completions/git.fish
+++ b/share/completions/git.fish
@@ -2170,8 +2170,13 @@ complete -f -c git -n '__fish_git_using_command stash' -n '__fish_git_stash_usin
 complete -f -c git -n '__fish_git_using_command stash' -n '__fish_git_stash_using_command show' -ka '(__fish_git_complete_stashes)'
 
 complete -f -c git -n '__fish_git_using_command stash' -n '__fish_git_stash_using_command push' -a '(__fish_git_files modified deleted modified-staged-deleted)'
+complete -f -c git -n '__fish_git_using_command stash' -n '__fish_git_stash_using_command push' -s a -l all -d 'Stash ignored and untracked files'
+complete -f -c git -n '__fish_git_using_command stash' -n '__fish_git_stash_using_command push' -s k -l keep-index -d 'Keep changes in index intact'
 complete -f -c git -n '__fish_git_using_command stash' -n '__fish_git_stash_using_command push' -s p -l patch -d 'Interactively select hunks'
 complete -f -c git -n '__fish_git_using_command stash' -n '__fish_git_stash_using_command push' -s m -l message -d 'Add a description'
+complete -f -c git -n '__fish_git_using_command stash' -n '__fish_git_stash_using_command push' -l no-keep-index -d 'Don\'t keep changes in index intact'
+complete -f -c git -n '__fish_git_using_command stash' -n '__fish_git_stash_using_command push' -s S -l staged -d 'Stash only staged changes'
+complete -f -c git -n '__fish_git_using_command stash' -n '__fish_git_stash_using_command push' -s u -l include-untracked -d 'Stash untracked files'
 
 ### config
 complete -f -c git -n __fish_git_needs_command -a config -d 'Set and read git configuration variables'

From 36ed2b79c257d2577c222bd2910b922d792c0cbb Mon Sep 17 00:00:00 2001
From: Amy Grace <zgracem@users.noreply.github.com>
Date: Tue, 5 Dec 2023 12:08:33 -0700
Subject: [PATCH 160/200] completions: add xxd

Closes #10137
---
 CHANGELOG.rst              |  1 +
 share/completions/xxd.fish | 34 ++++++++++++++++++++++++++++++++++
 2 files changed, 35 insertions(+)
 create mode 100644 share/completions/xxd.fish

diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index e6fade8fb..8ba44f0ed 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -77,6 +77,7 @@ Completions
   - ``userdel`` (:issue:`10056`)
   - ``watchexec`` (:issue:`10027`)
   - ``wpctl`` (:issue:`10043`)
+  - ``xxd`` (:issue:`10137`)
   - ``zabbix`` (:issue:`9647`)
 - The ``zfs`` completions no longer print errors about setting a read-only variable (:issue:`9705`).
 - The ``kitty`` completions have been removed in favor of keeping them upstream (:issue:`9750`).
diff --git a/share/completions/xxd.fish b/share/completions/xxd.fish
new file mode 100644
index 000000000..5e8b787cd
--- /dev/null
+++ b/share/completions/xxd.fish
@@ -0,0 +1,34 @@
+function __fish_seen_any_argument
+    # Returns true if none of the switch names appear in the command line.
+    for arg in $argv
+        switch (string length $arg)
+            case 2
+                __fish_seen_argument -o $arg; and return 1
+            case 1
+                __fish_seen_argument -s $arg; and return 1
+            case '*'
+                __fish_seen_argument -l $arg; and return 1
+        end
+    end
+end
+
+set -l xxd_exclusive_args b e i ps r
+
+complete -c xxd -s a -d 'Toggle autoskip'
+complete -c xxd -s b -n "__fish_seen_any_argument $xxd_exclusive_args" -d 'Binary digit dump'
+complete -c xxd -s C -n '__fish_seen_argument -s i' -d 'Capitalize variable names'
+complete -c xxd -s c -xa '(seq 8 8 64)' -d 'Format COLS octets per line, default 16'
+complete -c xxd -s E -d 'Show characters in EBCDIC'
+complete -c xxd -s e -n "__fish_seen_any_argument $xxd_exclusive_args" -d 'Little-endian dump'
+complete -c xxd -s g -xa '1 2 4' -d 'Octets per group in normal output, default 2'
+complete -c xxd -s h -d 'Print help summary'
+complete -c xxd -s i -n "__fish_seen_any_argument $xxd_exclusive_args" -d 'Output C-include file style'
+complete -c xxd -s l -d 'Stop after NUM octets'
+complete -c xxd -s o -x -d 'Add OFFSET to the displayed file position'
+complete -c xxd -o ps -n "__fish_seen_any_argument $xxd_exclusive_args" -d 'Output PostScript/plain hexdump style'
+complete -c xxd -s r -d 'Reverse operation: convert hexdump into binary'
+complete -c xxd -s s -xa '-32 -8 +8 +32' -n 'not __fish_seen_argument -s r' -d 'Start at SEEK bytes offset in file'
+complete -c xxd -s s -xa '-32 -8 +8 +32' -n '__fish_seen_argument -s r' -d 'Add OFFSET to file positions in hexdump'
+complete -c xxd -s d -d 'Show offset in decimal, not hex'
+complete -c xxd -s u -d 'Use uppercase hex letters'
+complete -c xxd -s v -d 'Show version'

From b11db052cbea92de044ba66281602a2d692e6732 Mon Sep 17 00:00:00 2001
From: Johannes Altmanninger <aclopte@gmail.com>
Date: Sun, 29 Jan 2023 08:58:13 +0100
Subject: [PATCH 161/200] functions/history.fish: also save when called with
 --exact

After deleting a history item with

    history delete --exact --case-sensitive the-item

it is still reachable by history search until the shell is restarted.

Let's fix this by saving history after each deletion.  The non-exact variants
of "history delete" already do this.  I think this was just an oversight
owed to the fact that hardly anyone uses "--exact" (else we would surely
have changed it to not require an explicit "--case-sensitive").

(cherry picked from commit 326e62515bfd2e96e05cf065f63bb4d312a89000)

Fixes #10066
---
 share/functions/history.fish | 1 +
 1 file changed, 1 insertion(+)

diff --git a/share/functions/history.fish b/share/functions/history.fish
index 4b261ae2e..806fcec17 100644
--- a/share/functions/history.fish
+++ b/share/functions/history.fish
@@ -120,6 +120,7 @@ function history --description "display or manipulate interactive command histor
 
             if test $search_mode = --exact
                 builtin history delete $search_mode $_flag_case_sensitive -- $searchterm
+                builtin history save
                 return
             end
 

From 3ac531785efb0a37bfb2bdd830e189d32265964c Mon Sep 17 00:00:00 2001
From: Fabian Boehm <FHomborg@gmail.com>
Date: Sat, 28 Oct 2023 10:31:24 +0200
Subject: [PATCH 162/200] Add __fish_anypager helper

This makes it easier to get *any pager* in the number of places we do.

Unfortunately:

1. It can't just execute the pager because that might block
2. We can't really set the necessary options for less here
   so they still need to be set outside.

This

Fixes #10074

by falling back to `cat` in that case. We could also decide to abort
instead of using a non-pager, but for history that's probably fine.

(cherry picked from commit ed489d0d5272f0343f25cecc9c0e4fbb4fe2a0d1)
---
 share/functions/__fish_anypager.fish          | 31 +++++++++++++++++++
 share/functions/__fish_paginate.fish          |  6 ++--
 .../__fish_preview_current_file.fish          |  4 +--
 share/functions/__fish_print_help.fish        | 11 ++-----
 share/functions/fish_delta.fish               |  6 ++--
 share/functions/history.fish                  |  6 ++--
 6 files changed, 44 insertions(+), 20 deletions(-)
 create mode 100644 share/functions/__fish_anypager.fish

diff --git a/share/functions/__fish_anypager.fish b/share/functions/__fish_anypager.fish
new file mode 100644
index 000000000..3546ca984
--- /dev/null
+++ b/share/functions/__fish_anypager.fish
@@ -0,0 +1,31 @@
+function __fish_anypager --description "Print a pager to use"
+    set -l pager
+    # We prefer $PAGER if we have it
+    set -q PAGER
+    and echo $PAGER | read -at pager
+
+    # or even $MANPAGER if we're allowed to
+    if test "$argv[1]" = "--with-manpager"
+        set -q MANPAGER
+        and echo $MANPAGER | read -at pager
+    end
+
+    # We use them if they *exist*
+    if command -q $pager[1]
+        printf %s\n $pager
+        return 0
+    end
+
+    # Cheesy hardcoded list of pagers.
+    for cmd in bat lv most less more
+        if command -q $cmd
+            echo -- $cmd
+            return 0
+        end
+    end
+
+    # We have no pager.
+    # We could fall back to "cat",
+    # but in some cases that's probably not helpful.
+    return 1
+end
diff --git a/share/functions/__fish_paginate.fish b/share/functions/__fish_paginate.fish
index 8fe789a61..3b6e4b4dd 100644
--- a/share/functions/__fish_paginate.fish
+++ b/share/functions/__fish_paginate.fish
@@ -1,8 +1,6 @@
 function __fish_paginate -d "Paginate the current command using the users default pager"
-    set -l cmd less
-    if set -q PAGER
-        echo $PAGER | read -at cmd
-    end
+    set -l cmd (__fish_anypager)
+    or return 1
 
     fish_commandline_append " &| $cmd"
 end
diff --git a/share/functions/__fish_preview_current_file.fish b/share/functions/__fish_preview_current_file.fish
index cb384673d..ae8db1091 100644
--- a/share/functions/__fish_preview_current_file.fish
+++ b/share/functions/__fish_preview_current_file.fish
@@ -1,6 +1,6 @@
 function __fish_preview_current_file --description "Open the file at the cursor in a pager"
-    set -l pager less --
-    set -q PAGER && echo $PAGER | read -at pager
+    set -l pager (__fish_anypager)
+    or set pager cat
 
     # commandline -t will never return an empty list. However, the token
     # could comprise multiple lines, so join them into a single string.
diff --git a/share/functions/__fish_print_help.fish b/share/functions/__fish_print_help.fish
index d65d3c946..79b77cd15 100644
--- a/share/functions/__fish_print_help.fish
+++ b/share/functions/__fish_print_help.fish
@@ -125,15 +125,10 @@ function __fish_print_help --description "Print help message for the specified f
         end
     end | string replace -ra '^       ' '' |
         begin
-            set -l pager less
-            # Try both PAGER and MANPAGER, last one wins
-            set -q PAGER
-            and echo -- $PAGER | read -at pager
-            set -q MANPAGER
-            and echo -- $MANPAGER | read -at pager
+            set -l pager (__fish_anypager --with-manpager)
+            and isatty stdout
+            or set pager cat # cannot use a builtin here
 
-            not isatty stdout
-            and set pager cat # cannot use a builtin here
             # similar to man, but add -F to quit paging when the help output is brief (#6227)
             # Also set -X for less < v530, see #8157.
             set -l lessopts isRF
diff --git a/share/functions/fish_delta.fish b/share/functions/fish_delta.fish
index 75220f4f5..4d17347f2 100644
--- a/share/functions/fish_delta.fish
+++ b/share/functions/fish_delta.fish
@@ -70,9 +70,9 @@ function fish_delta
 
     if isatty stdout
         set -f colors "$(set_color normal)" "$(set_color brblue)" "$(set_color bryellow)" "$(set_color green)" "$(set_color red)"
-        set -f pager less
-        set -q PAGER
-        and echo $PAGER | read -at pager
+        set -f pager (__fish_anypager)
+        or set pager cat
+
         if type -q less
             set -l lessopts isRF
             if test (less --version | string match -r 'less (\d+)')[2] -lt 530 2>/dev/null
diff --git a/share/functions/history.fish b/share/functions/history.fish
index 806fcec17..09b078fff 100644
--- a/share/functions/history.fish
+++ b/share/functions/history.fish
@@ -86,9 +86,9 @@ function history --description "display or manipulate interactive command histor
             and set search_mode --contains
 
             if isatty stdout
-                set -l pager less
-                set -q PAGER
-                and echo $PAGER | read -at pager
+                set -l pager (__fish_anypager)
+                and isatty stdout
+                or set pager cat
 
                 # If the user hasn't preconfigured less with the $LESS environment variable,
                 # we do so to have it behave like cat if output fits on one screen.

From a307ca36803039e2893a629f8bbadc73acb2bae7 Mon Sep 17 00:00:00 2001
From: Asuka Minato <i@asukaminato.eu.org>
Date: Sat, 25 Nov 2023 00:58:32 +0900
Subject: [PATCH 163/200] Update tar.fish (#10079)

* Update tar.fish

* add more long options

* add more options

(cherry picked from commit 9f9accf20397931f38bccabccff6ff8ce2302ea2)
---
 share/completions/tar.fish | 121 +++++++++++++++++++++++++++++--------
 1 file changed, 95 insertions(+), 26 deletions(-)

diff --git a/share/completions/tar.fish b/share/completions/tar.fish
index a420ad88c..aaf10ab9e 100644
--- a/share/completions/tar.fish
+++ b/share/completions/tar.fish
@@ -20,71 +20,140 @@ end
 
 complete -c tar -a "(__fish_complete_tar)"
 
+## Operation mode
 complete -c tar -s A -l catenate -l concatenate -d "Append archive to archive"
 complete -c tar -s c -l create -d "Create archive"
 complete -c tar -s d -l diff -l compare -d "Compare archive and filesystem"
 complete -c tar -l delete -d "Delete from archive"
 complete -c tar -s r -l append -d "Append files to archive"
 complete -c tar -s t -l list -d "List archive"
+complete -c tar -l test-label -d "Test the archive volume label"
 complete -c tar -s u -l update -d "Append new files"
 complete -c tar -s x -l extract -l get -d "Extract from archive"
+complete -c tar -l show-defaults -d "Show built-in defaults for various tar options"
 complete -c tar -s \? -l help -d "Display short option summary"
 complete -c tar -l usage -d "List available options"
+complete -c tar -l version -d "Print program version and copyright information"
+
+## Operation modifiers
+
+complete -c tar -l check-device -d "Check device numbers when creating incremental archives"
+complete -c tar -s g -l listed-incremental -r -d "Handle new GNU-format incremental backups"
+complete -c tar -l hole-detection -x -a "seek raw" -d "Use  METHOD  to detect holes in sparse files"
+complete -c tar -s G -l incremental -d "Use old incremental GNU format"
+complete -c tar -l ignore-failed-read -d "Do not exit with nonzero on unreadable files"
+complete -c tar -l level -x -a 0 -d "Set  dump  level  for  a created listed-incremental archive"
+complete -c tar -s n -l seek -d "Assume  the  archive is seekable"
+complete -c tar -l no-check-device -d "Do not check device numbers when creating incremental archives"
+complete -c tar -l no-seek -d "Assume the archive is not seekable"
+complete -c tar -l occurrence -r -d "Process only the Nth occurrence of each file in the archive"
+complete -c tar -l restrict -d "Disable the use of some potentially harmful options"
+complete -c tar -l sparse-version -x -a "0.0 0.1 1.0" -d "Set which version  of  the  sparse  format  to  use"
+complete -c tar -s S -l sparse -d "Handle sparse files"
+
+## Overwrite control
+complete -c tar -s k -l keep-old-files -d "Don't overwrite"
+complete -c tar -l keep-newer-files -d "Don't replace existing files that are newer"
+complete -c tar -l keep-directory-symlink -d "Don't replace existing symlinks"
+complete -c tar -l no-overwrite-dir -d "Preserve metadata of existing directories"
+complete -c tar -l one-top-level -d "Extract into directory"
+complete -c tar -l overwrite -d "Overwrite existing files when extracting"
+complete -c tar -l overwrite-dir -d "Overwrite metadata of existing directories"
+complete -c tar -l recursive-unlink -d "Recursively remove all files in the directory prior to extracting it"
+complete -c tar -l remove-files -d "Remove files after adding to archive"
+complete -c tar -l skip-old-files -d "Don't replace existing files when extracting"
+complete -c tar -s U -l unlink-first -d "Remove each file prior to extracting over it"
+complete -c tar -s W -l verify -d "Verify archive"
+
+## Output stream selection
+
+complete -c tar -l ignore-command-error -d "Ignore subprocess exit codes"
+complete -c tar -l no-ignore-command-error -d "Treat non-zero exit codes of children as error"
+complete -c tar -s O -l to-stdout -d "Extract to stdout"
+complete -c tar -l to-command -r -d "Pipe  extracted files to COMMAND"
+
+## Handling of file attributes
+
 complete -c tar -l atime-preserve -d "Keep access time"
+complete -c tar -l delay-directory-restore -d "Delay  setting  modification  times"
+complete -c tar -l group -x -d "Force  NAME  as  group for added files"
+complete -c tar -l group-map -r -d "Read group translation map from FILE"
+complete -c tar -l mode -x -d "Force symbolic mode CHANGES for added files"
+complete -c tar -l mtime -r -d "Set mtime for added files"
+complete -c tar -s m -l touch -d "Don't extract modification time"
+complete -c tar -l no-delay-directory-restore -d "Cancel the effect of the prior --delay-directory-restore"
+complete -c tar -l no-same-owner -d "Extract files as yourself"
+complete -c tar -l no-same-permissions -d "Apply the user's umask when extracting"
+complete -c tar -l numeric-owner -d "Always use numbers for user/group names"
+complete -c tar -l owner -x -d "Force NAME as owner for added files"
+complete -c tar -l owner-map -r -d "Read owner translation map from FILE"
+complete -c tar -s p -l same-permissions -l preserve-permissions -d "Extract all permissions"
+complete -c tar -l same-owner -d "Try  extracting  files with the same ownership"
+complete -c tar -s s -l same-order -l preserve-order -d "Do not sort file arguments"
+complete -c tar -l sort -x -a "none name inode" -d "sort directory entries according to ORDER"
+
+## Extended file attributes
+
+complete -c tar -l acls -d "Enable POSIX ACLs support"
+complete -c tar -l no-acls -d "Disable POSIX ACLs support"
+complete -c tar -l selinux -d "Enable SELinux context support"
+complete -c tar -l no-selinux -d "Disable SELinux context support"
+complete -c tar -l xattrs -d "Enable extended attributes support"
+complete -c tar -l no-xattrs -d "Disable extended attributes support"
+complete -c tar -l xattrs-exclude -d "Specify the exclude pattern for xattr keys"
+complete -c tar -l xattrs-include -d "Specify the include pattern for xattr keys"
+
+## Device selection and switching
+complete -c tar -s f -l file -r -d "Archive file"
+complete -c tar -l force-local -r -d "Archive file is local even if it has a colon"
+complete -c tar -s F -l info-script -l new-volume-script -r -d "Run script at end of tape"
+complete -c tar -s L -l tape-length -r -d "Tape length"
+complete -c tar -s M -l multi-volume -d "Multi volume archive"
+complete -c tar -l rmt-command -r -d "Use COMMAND instead of rmt"
+complete -c tar -l rsh-command -r -d "Use COMMAND instead of rsh"
+complete -c tar -l volno-file -r -d "keep track of which volume of a multi-volume archive it is working in FILE"
+
+
+complete -c tar -s f -l file -r -d "Archive file"
+complete -c tar -s f -l file -r -d "Archive file"
+complete -c tar -s f -l file -r -d "Archive file"
+
 complete -c tar -s b -l block-size -d "Block size"
 complete -c tar -s B -l read-full-blocks -d "Reblock while reading"
 complete -c tar -s C -l directory -r -d "Change directory"
 complete -c tar -l checkpoint -d "Print directory names"
-complete -c tar -s f -l file -r -d "Archive file"
 complete -c tar -l force-local -d "Archive is local"
-complete -c tar -s F -l info-script -d "Run script at end of tape"
-complete -c tar -s G -l incremental -d "Use old incremental GNU format"
-complete -c tar -s g -l listed-incremental -d "Use new incremental GNU format"
 complete -c tar -s h -l dereference -d "Dereference symlinks"
 complete -c tar -s i -l ignore-zeros -d "Ignore zero block in archive"
-complete -c tar -s j -l bzip2 -d "Filter through bzip2"
-complete -c tar -l ignore-failed-read -d "Don't exit on unreadable files"
-complete -c tar -s k -l keep-old-files -d "Don't overwrite"
-complete -c tar -l one-top-level -d "Extract into directory"
 complete -c tar -s K -l starting-file -r -d "Starting file in archive"
 complete -c tar -s l -l one-file-system -d "Stay in local filesystem"
-complete -c tar -s L -l tape-length -r -d "Tape length"
 complete -c tar -s m -l modification-time -d "Don't extract modification time"
-complete -c tar -l touch -d "Don't extract modification time"
-complete -c tar -s M -l multi-volume -d "Multi volume archive"
 complete -c tar -s N -l after-date -r -d "Only store newer files"
 complete -c tar -l newer -r -d "Only store newer files"
 complete -c tar -s o -l old-archive -d "Use V7 format"
 complete -c tar -l portability -d "Use V7 format"
-complete -c tar -s O -l to-stdout -d "Extract to stdout"
-complete -c tar -s p -l same-permissions -d "Extract all permissions"
-complete -c tar -l preserve-permissions -d "Extract all permissions"
 complete -c tar -s P -l absolute-paths -d "Don't strip leading /"
 complete -c tar -l preserve -d "Preserve all permissions and do not sort file arguments"
 complete -c tar -s R -l record-number -d "Show record number"
-complete -c tar -l remove-files -d "Remove files after adding to archive"
-complete -c tar -s s -l same-order -d "Do not sort file arguments"
-complete -c tar -l preserve-order -d "Do not sort file arguments"
-complete -c tar -l same-owner -d "Preserve file ownership"
-complete -c tar -s S -l sparse -d "Handle sparse files"
 complete -c tar -s T -l files-from -r -d "Extract file from file"
 complete -c tar -l null -d "-T has null-terminated names"
 complete -c tar -l totals -d "Print total bytes written"
 complete -c tar -s v -l verbose -d "Verbose mode"
 complete -c tar -s V -l label -r -d "Set volume name"
-complete -c tar -l version -d "Display version and exit"
 complete -c tar -s w -l interactive -d "Ask for confirmation"
 complete -c tar -l confirmation -d "Ask for confirmation"
-complete -c tar -s W -l verify -d "Verify archive"
 complete -c tar -l exclude -r -d "Exclude file"
 complete -c tar -s X -l exclude-from -r -d "Exclude files listed in specified file"
-complete -c tar -s Z -l compress -d "Filter through compress"
-complete -c tar -l uncompress -d "Filter through compress"
-complete -c tar -s z -l gzip -d "Filter through gzip"
-complete -c tar -l gunzip -d "Filter through gzip"
-complete -c tar -l use-compress-program -r -d "Filter through specified program"
+
+## Compression options
+complete -c tar -s a -l auto-compress -d "Use archive suffix to determine the compression program"
+complete -c tar -s I -l use-compress-program -r -d "Filter through specified program"
+complete -c tar -s j -l bzip2 -d "Filter through bzip2"
 complete -c tar -s J -l xz -d "Filter through xz"
 complete -c tar -l lzip -d "Filter through lzip"
 complete -c tar -l lzma -d "Filter through lzma"
 complete -c tar -l lzop -d "Filter through lzop"
+complete -c tar -l no-auto-compress -d "Do not use archive suffix to determine the compression program"
+complete -c tar -s z -l gzip -l gunzip -l ungzip -d "Filter through gzip"
+complete -c tar -s Z -l compress -l uncompress -d "Filter through compress"
 complete -c tar -l zstd -d "Filter through zstd"

From 0acf05eca09fbcffef280504af4dace27790b6b1 Mon Sep 17 00:00:00 2001
From: exploide <me@exploide.net>
Date: Wed, 8 Nov 2023 18:32:45 +0100
Subject: [PATCH 164/200] completions: improved netcat completions

- enhanced ncat completions

(cherry picked from commit a390e36e9d9d5d4ec108ee195abca806688828e8)
---
 share/completions/ncat.fish | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/share/completions/ncat.fish b/share/completions/ncat.fish
index 186b6bf1c..7a34087dd 100644
--- a/share/completions/ncat.fish
+++ b/share/completions/ncat.fish
@@ -8,6 +8,7 @@ complete -c ncat -s 6 -d "IPv6 only"
 complete -c ncat -s U -l unixsock -d "Use Unix domain sockets"
 complete -c ncat -s u -l udp -d "Use UDP"
 complete -c ncat -l sctp -d "Use SCTP"
+complete -c ncat -l vsock -d "Use AF_VSOCK sockets"
 
 # CONNECT MODE OPTIONS
 complete -c ncat -s g -x -d "Loose source routing"
@@ -35,12 +36,14 @@ function __fish_complete_openssl_ciphers
     end
 end
 complete -c ncat -l ssl-ciphers -x -a "(__fish_complete_list : __fish_complete_openssl_ciphers)" -d "Specify SSL ciphersuites"
+complete -c ncat -l ssl-servername -x -a "(__fish_print_hostnames)" -d "Request distinct server name"
 complete -c ncat -l ssl-alpn -x -d "Specify ALPN protocol list"
 
 # PROXY OPTIONS
 complete -c ncat -l proxy -x -d "Specify proxy address"
-complete -c ncat -l proxy-type -x -d "Specify proxy protocol"
+complete -c ncat -l proxy-type -x -a "http socks4 socks5" -d "Specify proxy protocol"
 complete -c ncat -l proxy-auth -x -d "Specify proxy credentials"
+complete -c ncat -l proxy-dns -x -a "local remote both none" -d "Specify where to resolve proxy destination"
 
 # COMMAND EXECUTION OPTIONS
 complete -c ncat -s e -l exec -r -d "Execute command"
@@ -67,8 +70,10 @@ complete -c ncat -s v -l verbose -d "Be verbose"
 # MISC OPTIONS
 complete -c ncat -s C -l crlf -d "Use CRLF as EOL"
 complete -c ncat -s h -l help -d "Help screen"
-complete -c ncat -l -recv-only -d "Only receive data"
+complete -c ncat -l recv-only -d "Only receive data"
 complete -c ncat -l send-only -d "Only send data"
 complete -c ncat -l no-shutdown -d "Do not shutdown into half-duplex mode"
+complete -c ncat -s n -l nodns -d "Do not resolve hostnames"
 complete -c ncat -s t -l telnet -d "Answer Telnet negotiations"
 complete -c ncat -l version -d "Display version"
+complete -c ncat -s z -d "Report connection status only"

From 963166c7ed046e4e78eba792f219bf50ba0b0155 Mon Sep 17 00:00:00 2001
From: Dmitriy Shishkov <me@dmitriy.icu>
Date: Sun, 12 Nov 2023 17:16:05 +0000
Subject: [PATCH 165/200] Replaced double quotation marks with single in
 dnf.fish completions

(cherry picked from commit bd4adf86f489e5eadbd86e2a29bdf84cd6a37140)
---
 share/completions/dnf.fish | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/share/completions/dnf.fish b/share/completions/dnf.fish
index 832af79cc..74c38dfcd 100644
--- a/share/completions/dnf.fish
+++ b/share/completions/dnf.fish
@@ -21,7 +21,7 @@ function __dnf_list_available_packages
         # This schema is bad, there is only a "pkg" field with the full
         #    packagename-version-release.fedorarelease.architecture
         # tuple. We are only interested in the packagename.
-        set results (sqlite3 /var/cache/dnf/packages.db "SELECT pkg FROM available WHERE pkg LIKE \"$tok%\"" 2>/dev/null |
+        set results (sqlite3 /var/cache/dnf/packages.db "SELECT pkg FROM available WHERE pkg LIKE '$tok%'" 2>/dev/null |
             string replace -r -- '-[^-]*-[^-]*$' '')
     else
         # In some cases dnf will ask for input (e.g. to accept gpg keys).

From 25ae69dac1060459c3883fa7677447e13ca23e46 Mon Sep 17 00:00:00 2001
From: Nater0214 <gamer@nater0214.com>
Date: Thu, 16 Nov 2023 20:02:55 -0500
Subject: [PATCH 166/200] completions: add checkinstall

(cherry picked from commit 1a42c97f75c457c4de5173773420e942f831f0b4)
---
 share/completions/checkinstall.fish | 78 +++++++++++++++++++++++++++++
 1 file changed, 78 insertions(+)
 create mode 100644 share/completions/checkinstall.fish

diff --git a/share/completions/checkinstall.fish b/share/completions/checkinstall.fish
new file mode 100644
index 000000000..6040164fc
--- /dev/null
+++ b/share/completions/checkinstall.fish
@@ -0,0 +1,78 @@
+#checkinstall
+
+# Set yes/no variable
+set -l yn "yes no"
+
+# Base-level completion
+complete -c checkinstall -f
+
+# Package type selection
+complete -c checkinstall -x -o t -l type -a "slackware rpm debian" -d "Choose packaging system"
+complete -c checkinstall -f -o S -d "Build a Slackware package"
+complete -c checkinstall -f -o R -d "Build an RPM package"
+complete -c checkinstall -f -o D -d "Build a Debian package"
+
+# Install options
+complete -c checkinstall -x -l install -a "$yn" -d "Toggle created package installation"
+complete -c checkinstall -x -l fstrans -a "$yn" -d "Enable/disable the filesystem translation code"
+
+# Scripting options
+complete -c checkinstall -f -o y -l default -d "Accept default answers to all questions"
+complete -c checkinstall -x -l pkgname -d "Set name"
+complete -c checkinstall -x -l pkgversion -d "Set version"
+complete -c checkinstall -x -o A -l arch -l pkgarch -d "Set architecture"
+complete -c checkinstall -x -l pkgrelease -d "Set release"
+complete -c checkinstall -x -l pkglicense -d "Set license"
+complete -c checkinstall -x -l pkggroup -d "Set software group"
+complete -c checkinstall -x -l pkgsource -d "Set source location"
+complete -c checkinstall -x -l pkgalitsource -d "Set alternate source location"
+complete -c checkinstall -F -r -l pakdir -a "(__fish_complete_directories)" -d "The new package will be saved here"
+complete -c checkinstall -x -l maintainer -d "The package maintainer (.deb)"
+complete -c checkinstall -x -l provides -d "Features provided by this package"
+complete -c checkinstall -x -l requires -d "Features required by this package"
+complete -c checkinstall -x -l recommends -d "Features recommended by this package"
+complete -c checkinstall -x -l sggests -d "Featues suggested by this package"
+complete -c checkinstall -x -l conflicts -d "Packages that this package cannot be installed with (.deb)"
+complete -c checkinstall -x -l replaces -d "Packages that this package replaces (.deb)"
+complete -c checkinstall -x -l rpmflags -d "Pass these flags to the rpm installer"
+complete -c checkinstall -f -l rpmi -d "Use the -i flag for rpm when installing a .rpm"
+complete -c checkinstall -f -l rpmu -d "Use the -U flag for rpm when installing a .rpm"
+complete -c checkinstall -x -l dpkgflags -d "Pass these flags to the dpkg installer"
+complete -c checkinstall -x -l spec -a "(__fish_complete_path)" -d ".spec file location"
+complete -c checkinstall -f -l nodoc -d "Do not include documentation files"
+
+# Info display options
+complete -c checkinstall -x -o d -a "0 1 2" -d "Set debug level"
+complete -c checkinstall -f -o si -d "Run an interactive install command"
+complete -c checkinstall -x -l showinstall -a "$yn" -d "Toggle interactive install command"
+complete -c checkinstall -f -o ss -d "Run an interactive Slackware installation script"
+complete -c checkinstall -x -l showslack -a "$yn" -d "Toggle interactive Slackware installation script"
+
+# Package tuning options
+complete -c checkinstall -x -l autodoinst -a "$yn" -d "Toggle the creation of a doinst.sh script"
+complete -c checkinstall -x -l strip -a "$yn" -d "Strip any ELF binaries found inside the package"
+complete -c checkinstall -x -l stripso -a "$yn" -d "Strop any ELF binary libraries (.so files)"
+complete -c checkinstall -x -l addso -a "$yn" -d "Search for ant shared libs and add them to /etc/ld.so.conf"
+complete -c checkinstall -x -l reset-uids -a "$yn" -d "Reset perms for all files"
+complete -c checkinstall -x -l gzman -a "$yn" -d "Compress any man pages found inside the package"
+complete -c checkinstall -x -l docdir -a "(__fish_complete_directories)" -d "Where to put documentation files"
+complete -c checkinstall -x -l umask -d "Set the umask value"
+complete -c checkinstall -x -l exclude -a "(__fish_complete_path)" -d "Excluse these files/directories from the package"
+complete -c checkinstall -F -r -l include -d "Include file/directories in this file in the package"
+complete -c checkinstall -f -l inspect -d "Inspect the package's file list"
+complete -c checkinstall -f -l review-spec -d "Review the dpec file before creating a .rpm"
+complete -c checkinstall -f -l review-control -d "Review the control file before creating a .deb"
+complete -c checkinstall -f -l newslack -d "Use the new (8.1+) Slackware description format"
+complete -c checkinstall -F -l with-tar -d "Manually set the path to the tar binary"
+
+# Cleanup options
+complete -c checkinstall -x -l deldoc -a "$yn" -d "Delete doc-pak upon termination"
+complete -c checkinstall -x -l deldesc -a "$yn" -d "Delete description-pak upon termination"
+complete -c checkinstall -x -l delspec -a "$yn" -d "Delete spec file upon termination"
+complete -c checkinstall -f -l bk -d "Backup any overwritten files"
+complete -c checkinstall -x -l backup -a "$yn" -d "Toggle backup"
+
+# About checkinstall
+complete -c checkinstall -f -o h -l help -d "Show help"
+complete -c checkinstall -f -l copyright -d "Show Copyright information"
+complete -c checkinstall -f -l version -d "Show version information"
\ No newline at end of file

From c1f1a92b997ba4570ac4becc8d1488d96fea3df1 Mon Sep 17 00:00:00 2001
From: NextAlone <12210746+NextAlone@users.noreply.github.com>
Date: Sun, 10 Dec 2023 18:40:17 +0800
Subject: [PATCH 167/200] completion(usbip): support ipv6 (#10113)

* completion(usbip): support ipv6

Signed-off-by: Next Alone <12210746+NextAlone@users.noreply.github.com>

* completion(usbip): use fish string match

Signed-off-by: Next Alone <12210746+NextAlone@users.noreply.github.com>

* fix: support --remote and -r both

Signed-off-by: Next Alone <12210746+NextAlone@users.noreply.github.com>

---------

Signed-off-by: Next Alone <12210746+NextAlone@users.noreply.github.com>
(cherry picked from commit 382005c33e265cea8ad1e14aefe2d8bacf2669b8)
---
 share/completions/usbip.fish | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/share/completions/usbip.fish b/share/completions/usbip.fish
index fa42129df..750c7aa0a 100644
--- a/share/completions/usbip.fish
+++ b/share/completions/usbip.fish
@@ -13,7 +13,7 @@ function __fish_usbip_remote -d 'List remote usbip host'
 end
 
 function __fish_usbip_busid -d 'List usbip busid'
-    set -l remote (commandline -opc | string match -r '([0-9]{1,3}\.){3}[0-9]{1,3}')
+    set -l remote (commandline -opc | string match -r '(?<=-r)(emote)?=?\s*(\S+)' | string trim)
     set -l busids (usbip list -r $remote 2> /dev/null | string match -r '\d+-\d+')
     printf '%s\n' $busids
 end

From b10611091f571d0ea782a0b671b05462ef410284 Mon Sep 17 00:00:00 2001
From: Nater0214 <gamer@nater0214.com>
Date: Wed, 22 Nov 2023 18:17:49 -0500
Subject: [PATCH 168/200] completions: add airmon-ng

(cherry picked from commit ca705fcbb59b21ed11ccc8661f6c65c6a7592ec8)
---
 share/completions/airmon-ng.fish | 6 ++++++
 1 file changed, 6 insertions(+)
 create mode 100644 share/completions/airmon-ng.fish

diff --git a/share/completions/airmon-ng.fish b/share/completions/airmon-ng.fish
new file mode 100644
index 000000000..3ad0923f2
--- /dev/null
+++ b/share/completions/airmon-ng.fish
@@ -0,0 +1,6 @@
+#airmon-ng
+
+set -l commands "start stop check"
+complete -c airmon-ng -x -n "not __fish_seen_subcommand_from $commands" -a "$commands"
+complete -c airmon-ng -x -n "__fish_seen_subcommand_from $commands; and not __fish_seen_subcommand_from (__fish_print_interfaces)" -a "(__fish_print_interfaces)"
+complete -c airmon-ng -f

From f6676350a727d1d697deab0274550cae77b66ef7 Mon Sep 17 00:00:00 2001
From: David Adam <zanchey@ucc.gu.uwa.edu.au>
Date: Sun, 31 Dec 2023 09:53:20 +0800
Subject: [PATCH 169/200] CHANGELOG: work on 3.7.0

---
 CHANGELOG.rst | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index 8ba44f0ed..c030f1fbd 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -1,7 +1,7 @@
 fish 3.7.0 (released ???)
 ====================================
 
-.. ignore: 3443 5319 7375 9500 9515 9528 9538 9565 9667 9681 9690 9692 9704 9706 9707 9713 9718 9719 9721 9722 9728 9732 9734 9738 9741 9742 9743 9753 9759 9776 9783 9800 9804 9812 9825 9848 9850 9871 9875 9878 9880 9882 9899 9910 9914 9915 9919 9926 9932 9939 9943 9956 9960 9965 9970 9972 9975 9976 9977 9982 9983 9994 10007 10008 10011 10020 10023 10029 10038 10039 10051 10055 10059 10062
+.. ignore: 3443 5319 7375 9500 9515 9528 9538 9565 9667 9681 9690 9692 9704 9706 9707 9713 9718 9719 9721 9722 9728 9732 9734 9738 9741 9742 9743 9753 9759 9776 9783 9799 9800 9804 9812 9825 9848 9850 9871 9875 9878 9880 9882 9899 9910 9914 9915 9919 9926 9932 9939 9943 9956 9960 9965 9970 9972 9975 9976 9977 9982 9983 9994 10007 10008 10011 10020 10023 10029 10038 10039 10051 10055 10059 10062 10073 10079 10081 10082 10084 10086 10089 10096 10097 10113
 
 Notable improvements and fixes
 ------------------------------
@@ -35,7 +35,7 @@ Interactive improvements
 - Completing commands as root includes commands not owned by root, fixing a regression introduced in fish 3.2.0 (:issue:`9699`).
 - Selection uses ``fish_color_selection`` for the foreground and background colors, as intended, rather than just the background (:issue:`9717`).
 - The completion pager will no longer sometimes skip the last entry when moving through a long list (:issue:`9833`).
-- The interactive ``history delete`` interface now allows specifying index ranges like "1..5" (:issue:`9736`).
+- The interactive ``history delete`` interface now allows specifying index ranges like "1..5" (:issue:`9736`), and ``history delete --exact`` now properly saves the history (:issue:`10066`).
 - Command completion will now call the stock ``manpath`` on macOS, instead of a potential Homebrew version. This prevents awkward error messages (:issue:`9817`).
 - A new bind function ``history-pager-delete``, bound to :kbd:``Shift`` + :kbd:``Delete`` by default, will delete the currently-selected history pager item from history (:issue:`9454`).
 - ``fish_key_reader`` will now use printable characters as-is, so pressing "ö" no longer leads to it telling you to bind ``\u00F6`` (:issue:`9986`).
@@ -48,6 +48,7 @@ Interactive improvements
 - The ``alias`` convenience function has better support for commands with unusual characters, like ``+`` (:issue:`8720`).
 - A longstanding issue where items in the pager would sometimes display without proper formatting has been fixed (:issue:`9617`).
 - The :kbd:`Alt` +\ :kbd:`l` binding, which lists the directory of the token under the cursor, correctly expands tilde (``~``) to the home directory (:issue:`9954`).
+- Various fish utilities that use an external pager will now try a selection of common pagers if the :envvar:`PAGER` environment variable is not set, or write the output to the screen without a pager if there is not one available (:issue:`10074`)
 
 Improved prompts
 ^^^^^^^^^^^^^^^^
@@ -59,9 +60,11 @@ Completions
 ^^^^^^^^^^^
 - Added completions for:
   - ``age`` and ``age-keygen`` (:issue:`9813`)
+  - ``airmon-ng`` (:issue:`10116`)
   - ``ar`` (:issue:`9720`)
   - ``blender`` (:issue:`9905`)
-  - ``bws`` (:issue:`10165`).
+  - ``bws`` (:issue:`10165`)
+  - ``checkinstall`` (:issue:`10106`)
   - ``crc`` (:issue:`10034`)
   - ``gimp`` (:issue:`9904`)
   - ``gojq`` (:issue:`9740`)

From b28eae8be9dfff290cddadf8c54f43cacad49cc5 Mon Sep 17 00:00:00 2001
From: ridiculousfish <rf@fishshell.com>
Date: Mon, 12 Sep 2022 15:33:29 -0700
Subject: [PATCH 170/200] Allow custom completions to have leading dots

By default, fish does not complete files that have leading dots, unless the
wildcard itself has a leading dot. However this also affected completions;
for example `git add` would not offer `.gitlab-ci.yml` because it has a
leading dot.

Relax this for custom completions. Default file expansion still
suppresses leading dots, but now custom completions can create
leading-dot completions and they will be offered.

Fixes #3707.

(cherry picked from commit b7de768c73f0a9b0a097b83db1f60726c3a9661a)
---
 CHANGELOG.rst              |  1 +
 src/complete.cpp           | 19 +++++++++++++------
 src/expand.h               |  4 ++++
 src/wildcard.cpp           |  3 ++-
 tests/checks/complete.fish | 16 ++++++++++++++++
 5 files changed, 36 insertions(+), 7 deletions(-)

diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index c030f1fbd..bf649bbf3 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -49,6 +49,7 @@ Interactive improvements
 - A longstanding issue where items in the pager would sometimes display without proper formatting has been fixed (:issue:`9617`).
 - The :kbd:`Alt` +\ :kbd:`l` binding, which lists the directory of the token under the cursor, correctly expands tilde (``~``) to the home directory (:issue:`9954`).
 - Various fish utilities that use an external pager will now try a selection of common pagers if the :envvar:`PAGER` environment variable is not set, or write the output to the screen without a pager if there is not one available (:issue:`10074`)
+- Command-specific tab completions may now offer results whose first character is a period. For example, it is now possible to tab-complete ``git add`` for files with leading periods. The default file completions hide these files, unless the token itself has a leading period (:issue:`3707`).
 
 Improved prompts
 ^^^^^^^^^^^^^^^^
diff --git a/src/complete.cpp b/src/complete.cpp
index aaac08145..08542c42f 100644
--- a/src/complete.cpp
+++ b/src/complete.cpp
@@ -366,7 +366,8 @@ class completer_t {
     bool conditions_test(const wcstring_list_t &conditions);
 
     void complete_strings(const wcstring &wc_escaped, const description_func_t &desc_func,
-                          const completion_list_t &possible_comp, complete_flags_t flags);
+                          const completion_list_t &possible_comp, complete_flags_t flags,
+                          expand_flags_t extra_expand_flags = {});
 
     expand_flags_t expand_flags() const {
         expand_flags_t result{};
@@ -510,12 +511,16 @@ static void parse_cmd_string(const wcstring &str, wcstring *path, wcstring *cmd,
 /// @param  possible_comp
 ///    the list of possible completions to iterate over
 /// @param  flags
-///    The flags
+///    The flags controlling completion
+/// @param extra_expand_flags
+///    Additional flags controlling expansion.
 void completer_t::complete_strings(const wcstring &wc_escaped, const description_func_t &desc_func,
-                                   const completion_list_t &possible_comp, complete_flags_t flags) {
+                                   const completion_list_t &possible_comp, complete_flags_t flags,
+                                   expand_flags_t extra_expand_flags) {
     wcstring tmp = wc_escaped;
     if (!expand_one(tmp,
-                    this->expand_flags() | expand_flag::skip_cmdsubst | expand_flag::skip_wildcards,
+                    this->expand_flags() | extra_expand_flags | expand_flag::skip_cmdsubst |
+                        expand_flag::skip_wildcards,
                     ctx))
         return;
 
@@ -525,7 +530,7 @@ void completer_t::complete_strings(const wcstring &wc_escaped, const description
         const wcstring &comp_str = comp.completion;
         if (!comp_str.empty()) {
             wildcard_complete(comp_str, wc.c_str(), desc_func, &this->completions,
-                              this->expand_flags(), flags);
+                              this->expand_flags() | extra_expand_flags, flags);
         }
     }
 }
@@ -730,7 +735,9 @@ void completer_t::complete_from_args(const wcstring &str, const wcstring &args,
         ctx.parser->set_last_statuses(status);
     }
 
-    this->complete_strings(escape_string(str), const_desc(desc), possible_comp, flags);
+    // Allow leading dots - see #3707.
+    this->complete_strings(escape_string(str), const_desc(desc), possible_comp, flags,
+                           expand_flag::allow_nonliteral_leading_dot);
 }
 
 static size_t leading_dash_count(const wchar_t *str) {
diff --git a/src/expand.h b/src/expand.h
index 22f7a37b9..e35693f2a 100644
--- a/src/expand.h
+++ b/src/expand.h
@@ -45,6 +45,10 @@ enum class expand_flag {
     /// Disallow directory abbreviations like /u/l/b for /usr/local/bin. Only applicable if
     /// fuzzy_match is set.
     no_fuzzy_directories,
+    /// Allows matching a leading dot even if the wildcard does not contain one.
+    /// By default, wildcards only match a leading dot literally; this is why e.g. '*' does not
+    /// match hidden files.
+    allow_nonliteral_leading_dot,
     /// Do expansions specifically to support cd. This means using CDPATH as a list of potential
     /// working directories, and to use logical instead of physical paths.
     special_for_cd,
diff --git a/src/wildcard.cpp b/src/wildcard.cpp
index eb0bd44a5..2683cfa1b 100644
--- a/src/wildcard.cpp
+++ b/src/wildcard.cpp
@@ -191,7 +191,8 @@ static wildcard_result_t wildcard_complete_internal(const wchar_t *const str, si
 
     // Maybe early out for hidden files. We require that the wildcard match these exactly (i.e. a
     // dot); ANY_STRING not allowed.
-    if (is_first_call && str[0] == L'.' && wc[0] != L'.') {
+    if (is_first_call && !params.expand_flags.get(expand_flag::allow_nonliteral_leading_dot) &&
+        str[0] == L'.' && wc[0] != L'.') {
         return wildcard_result_t::no_match;
     }
 
diff --git a/tests/checks/complete.fish b/tests/checks/complete.fish
index be13fb0d1..5fc76c9ed 100644
--- a/tests/checks/complete.fish
+++ b/tests/checks/complete.fish
@@ -531,6 +531,22 @@ begin
     # CHECK: Empty completions
 end
 
+rm -$f $tmpdir/*
+
+# Leading dots are not completed for default file completion,
+# but may be for custom command (e.g. git add).
+function dotty
+end
+function notty
+end
+complete -c dotty --no-files -a '(echo .a*)'
+touch .abc .def
+complete -C'notty '
+echo "Should be nothing"
+# CHECK: Should be nothing
+complete -C'dotty '
+# CHECK: .abc
+
 rm -r $tmpdir
 
 complete -C'complete --command=mktemp' | string replace -rf '=mktemp\t.*' '=mktemp'

From 4d858b3f8853a4091814c80f39cb273bba7ee609 Mon Sep 17 00:00:00 2001
From: Fabian Boehm <FHomborg@gmail.com>
Date: Thu, 7 Sep 2023 08:06:55 +0200
Subject: [PATCH 171/200] completion: Set up wrapping for gw/gradlew

These were set up as commands in the actual gradle completions, but
they would never be loaded.

(cherry picked from commit 180692fb29b7f6a134c5ffa4b3c1e5ea77993666)
---
 share/completions/gradlew.fish | 1 +
 share/completions/gw.fish      | 1 +
 2 files changed, 2 insertions(+)
 create mode 100644 share/completions/gradlew.fish
 create mode 100644 share/completions/gw.fish

diff --git a/share/completions/gradlew.fish b/share/completions/gradlew.fish
new file mode 100644
index 000000000..ac0f349de
--- /dev/null
+++ b/share/completions/gradlew.fish
@@ -0,0 +1 @@
+complete -c gradlew -w gradle
diff --git a/share/completions/gw.fish b/share/completions/gw.fish
new file mode 100644
index 000000000..5cc8e6904
--- /dev/null
+++ b/share/completions/gw.fish
@@ -0,0 +1 @@
+complete -c gw -w gradle

From 5b1b466f97098281c382e5e96acf248e3dca2700 Mon Sep 17 00:00:00 2001
From: SanskritFritz <SanskritFritz+github@gmail.com>
Date: Wed, 29 Nov 2023 22:02:13 +0100
Subject: [PATCH 172/200] Tab completions for ncdu completed

(cherry picked from commit 684f44bca38eb363b95ccc94b96257a09bb536e4)
---
 share/completions/ncdu.fish | 49 ++++++++++++++++++++++++++++++++-----
 1 file changed, 43 insertions(+), 6 deletions(-)

diff --git a/share/completions/ncdu.fish b/share/completions/ncdu.fish
index fbab00b59..bba753eb0 100644
--- a/share/completions/ncdu.fish
+++ b/share/completions/ncdu.fish
@@ -1,16 +1,53 @@
 complete -c ncdu -s h -l help -d 'Print help'
-complete -c ncdu -s q -d 'Quiet mode. Refresh interval 2 seconds'
+complete -c ncdu -s q -l slow-ui-updates -d 'Quiet mode. Refresh interval 2 seconds'
+complete -c ncdu -l fast-ui-updates -d 'Refresh interval 10 per second'
 complete -c ncdu -s v -s V -l version -d 'Print version'
-complete -c ncdu -s x -d 'Same filesystem'
-complete -c ncdu -s e -d 'Enable extended information'
-complete -c ncdu -s r -d 'Read only'
+complete -c ncdu -s x -l one-file-system -d 'Same filesystem'
+complete -c ncdu -l cross-file-system -d 'Cross filesystems'
+complete -c ncdu -s e -l extended -d 'Enable extended information'
+complete -c ncdu -l no-extended -d 'Disable extended information'
+complete -c ncdu -s r -d 'Read only mode'
 complete -c ncdu -s o -d 'Export scanned directory' -r
 complete -c ncdu -s f -d 'Import scanned directory' -r
 complete -c ncdu -s 0 -s 1 -s 2 -d 'UI to use when scanning (0=none,2=full ncurses)'
-complete -c ncdu -l si -d 'Use base 10 prefixes instead of base 2'
+complete -c ncdu -l si -d 'Use base 10 prefixes'
+complete -c ncdu -l no-si -d 'Use base 2 prefixes'
 complete -c ncdu -l exclude -d 'Exclude files that match pattern' -x
 complete -c ncdu -s X -l exclude-from -d 'Exclude files that match any pattern in file' -r
 complete -c ncdu -s L -l follow-symlinks -d 'Follow symlinks (excluding dirs)'
+complete -c ncdu -l no-follow-symlinks -d 'Do not follow symlinks (excluding dirs)'
 complete -c ncdu -l exclude-caches -d 'Exclude dirs containing CACHEDIR.TAG'
+complete -c ncdu -l include-caches -d 'Include dirs containing CACHEDIR.TAG'
 complete -c ncdu -l confirm-quit -d 'Prompt before exiting ncdu'
-complete -c ncdu -l color -d 'Set color scheme' -x
+complete -c ncdu -l no-confirm-quit -d 'No confirmation before exiting ncdu'
+complete -c ncdu -l color -d 'Set color scheme' -a 'off dark dark-bg' -x
+complete -c ncdu -l ignore-config -d 'Do not load any configuration files'
+complete -c ncdu -l include-kernfs -d 'Include Linux pseudo filesystems'
+complete -c ncdu -l exclude-kernfs -d 'Exclude Linux pseudo filesystems'
+complete -c ncdu -l enable-shell -d 'Enable shell spawning'
+complete -c ncdu -l disable-shell -d 'Disable shell spawning'
+complete -c ncdu -l enable-delete -d 'Enable built-in file deletion'
+complete -c ncdu -l disable-delete -d 'Disable built-in file deletion'
+complete -c ncdu -l enable-refresh -d 'Enable directory refreshing'
+complete -c ncdu -l disable-refresh -d 'Disable directory refreshing'
+complete -c ncdu -l disk-usage -d 'Show disk usage of files'
+complete -c ncdu -l apparent-size -d 'Show apparent size of files'
+complete -c ncdu -l show-hidden -d 'Show hidden and excluded files'
+complete -c ncdu -l hide-hidden -d 'Hide hidden and excluded files'
+complete -c ncdu -l show-itemcount -d 'Show the item counts column'
+complete -c ncdu -l hide-itemcount -d 'Hide the item counts column'
+complete -c ncdu -l show-mtime -d 'Show last modification time column'
+complete -c ncdu -l hide-mtime -d 'Hide last modification time column'
+complete -c ncdu -l show-graph -d 'Show the relative size bar column'
+complete -c ncdu -l hide-graph -d 'Hide the relative size bar column'
+complete -c ncdu -l show-percent -d 'Show the relative size percent column'
+complete -c ncdu -l hide-percent -d 'Hide the relative size percent column'
+complete -c ncdu -l graph-style -d 'Relative size bar column style' -a 'hash half-block eighth-block' -x
+complete -c ncdu -l shared-column -d 'Show/hide hard link shared sizes' -a 'off shared unique' -x
+complete -c ncdu -l sort -d 'Column to sort on' -a 'disk-usage disk-usage-desc name name-desc apparent-size apparent-size-desc itemcount itemcount-desc mtime mtime-desc' -x
+complete -c ncdu -l enable-natsort -d 'Enable natural sort'
+complete -c ncdu -l disable-natsort -d 'Disable natural sort'
+complete -c ncdu -l group-directories-first -d 'Sort directories before files'
+complete -c ncdu -l no-group-directories-first -d 'Do not sort directories before files'
+complete -c ncdu -l confirm-delete -d 'Require a confirmation before deleting'
+complete -c ncdu -l no-confirm-delete -d 'Do not require a confirmation before deleting'

From c0cc78cb546eb767545546f7f69303a51b430078 Mon Sep 17 00:00:00 2001
From: Ivan Kovnatsky <75213+ivankovnatsky@users.noreply.github.com>
Date: Sun, 10 Dec 2023 12:41:58 +0200
Subject: [PATCH 173/200] Add `git branch --[no-,contains]` completions
 (#10133)

* Add `git branch --[no-,contains]` completions

* Add __fish_git_commits as an argument

(cherry picked from commit 8c36c21e2e1e59f2e31299da2ded6fb9020993b2)
---
 share/completions/git.fish | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/share/completions/git.fish b/share/completions/git.fish
index f3b08303f..5d87e4188 100644
--- a/share/completions/git.fish
+++ b/share/completions/git.fish
@@ -1263,6 +1263,8 @@ complete -f -c git -n '__fish_git_using_command branch' -l set-upstream-to -d 'S
 complete -f -c git -n '__fish_git_using_command branch' -l merged -d 'List branches that have been merged'
 complete -f -c git -n '__fish_git_using_command branch' -l no-merged -d 'List branches that have not been merged'
 complete -f -c git -n '__fish_git_using_command branch' -l unset-upstream -d 'Remove branch upstream information'
+complete -f -c git -n '__fish_git_using_command branch' -l contains -d 'List branches that contain the specified commit' -xa '(__fish_git_commits)'
+complete -f -c git -n '__fish_git_using_command branch' -l no-contains -d 'List branches that don\'t contain the specified commit' -xa '(__fish_git_commits)'
 
 ### bundle
 set -l bundlecommands create verify list-heads unbundle

From 80cb735cbeaaf576963911b023fd05cc6d5cc835 Mon Sep 17 00:00:00 2001
From: Amy Grace <zgracem@users.noreply.github.com>
Date: Sun, 10 Dec 2023 03:50:22 -0700
Subject: [PATCH 174/200] completions: add smerge (Sublime Merge CLI tool)
 (#10135)

* completions: add smerge (Sublime Merge CLI tool)

* completions: add `-o` (and file completion) to `smerge mergetool`

(cherry picked from commit b7a85fe172d4ccc1214972a23579265c65c5e3a4)
---
 share/completions/smerge.fish | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
 create mode 100644 share/completions/smerge.fish

diff --git a/share/completions/smerge.fish b/share/completions/smerge.fish
new file mode 100644
index 000000000..588426bf0
--- /dev/null
+++ b/share/completions/smerge.fish
@@ -0,0 +1,14 @@
+# Sublime Merge CLI tool
+
+complete -c smerge -s n -l new-window -d 'Open a new window'
+complete -c smerge -l launch-or-new-window -d 'Open new window only if app is running'
+complete -c smerge -s b -l background -d "Don't activate the application"
+complete -c smerge -l safe-mode -d 'Launch in a sandboxed environment'
+complete -c smerge -s h -l help -d 'Show help (this message) and exit'
+complete -c smerge -s v -l version -d 'Show version and exit'
+complete -c smerge -a search -x -d 'Search for commits in the current repository'
+complete -c smerge -a blame -r -d 'Blame the given file in the current repo'
+complete -c smerge -a log -r -d 'Show the file history in the current repo'
+complete -c smerge -a mergetool -rF -d 'Open the merge tool for the given files'
+complete -c smerge -l no-wait -d "Don't wait for the application to close" -n '__fish_seen_subcommand_from mergetool'
+complete -c smerge -s o -rF -d "Merged output file" -n "__fish_seen_subcommand_from mergetool"

From e613adda69d50b5b5e3440956b29c63d99f0c996 Mon Sep 17 00:00:00 2001
From: Amy Grace <zgracem@users.noreply.github.com>
Date: Sun, 10 Dec 2023 13:40:38 -0700
Subject: [PATCH 175/200] completions: add rename (#10136)

* completions: add rename

* add completions for other versions of `rename`

(cherry picked from commit 00ffc397b493f67e28f18640d3de808af29b1434)
---
 share/completions/rename.fish | 72 +++++++++++++++++++++++++++++++++++
 1 file changed, 72 insertions(+)
 create mode 100644 share/completions/rename.fish

diff --git a/share/completions/rename.fish b/share/completions/rename.fish
new file mode 100644
index 000000000..6c0bae65d
--- /dev/null
+++ b/share/completions/rename.fish
@@ -0,0 +1,72 @@
+# abort if `rename` is not installed
+command -sq rename; or return
+
+set -l rename_version (rename --version 2>/dev/null)
+set -l version_status $status
+
+if string match -q "*util-linux*" $rename_version[1]
+    # util-linux version
+    # https://www.mankier.com/1/rename
+    complete -c rename -s s -l symlink -d 'Rename symlink target(s)'
+    complete -c rename -s v -l verbose -n '! __fish_seen_argument -s n -l no-act' -d 'Show which files were renamed'
+    complete -c rename -s v -l verbose -n '__fish_seen_argument -s n -l no-act' -d 'Show which files would be renamed'
+    complete -c rename -s n -l no-act -d 'Make no changes'
+    complete -c rename -s a -l all -d 'Replace all occurrences'
+    complete -c rename -s l -l last -d 'Replace only the last occurrence'
+    complete -c rename -s o -l no-overwrite -n '! __fish_seen_argument -s s -l symlink' -d "Don't overwrite existing files"
+    complete -c rename -s o -l no-overwrite -n '__fish_seen_argument -s s -l symlink' -d "Don't overwrite symlink targets"
+    complete -c rename -s i -l interactive -d 'Ask before overwriting'
+    complete -c rename -s h -l help -d 'Print help text and exit'
+    complete -c rename -s V -l version -d 'Print version and exit'
+else if string match -q "*File::Rename*" $rename_version[1]
+    # Perl library version
+    # https://metacpan.org/release/File-Rename
+    complete -c rename -s v -l verbose -d 'Print renamed files'
+    complete -c rename -s 0 -l null -d 'Split on NUL when reading from stdin'
+    complete -c rename -s n -l nono -d 'Only show what would be renamed'
+    complete -c rename -s f -l force -d 'Overwrite existing files'
+    complete -c rename -l path -l fullpath -n '! __fish_seen_argument -s d -l filename -l nopath -l nofullpath' -d 'Rename any directory component'
+    complete -c rename -s d -l filename -l nopath -l nofullpath -n '! __fish_seen_argument -l path -l fullpath' -d 'Rename only filename component'
+    complete -c rename -s h -l help -d 'Print synopsis and options'
+    complete -c rename -s m -l man -d 'Print manual page'
+    complete -c rename -s V -l version -d 'Show version number'
+    complete -c rename -s u -l unicode -d 'Treat filenames as Unicode strings'
+    complete -c rename -s e -x -d 'Perl expression'
+    complete -c rename -s E -x -d 'Perl statement'
+else if test "$version_status" = "2"
+    # `brew install rename`
+    # http://plasmasturm.org/code/rename
+    complete -c rename -s h -l help -d 'See a synopsis'
+    complete -c rename -l man -d 'Browse the manpage'
+    complete -c rename -s 0 -l null -d 'Split on NUL bytes'
+    complete -c rename -s f -l force -d 'Rename over existing files'
+    complete -c rename -s g -l glob -d 'Glob filename arguments'
+    complete -c rename -s i -l interactive -d 'Confirm every action'
+    complete -c rename -s k -l backwards -l reverse-order -d 'Process last file first'
+    complete -c rename -s l -l symlink -n '! __fish_seen_argument -s L -l hardlink' -d 'Symlink instead of renaming'
+    complete -c rename -s L -l hardlink -n '! __fish_seen_argument -s l -l symlink' -d 'Hardlink instead of renaming'
+    complete -c rename -s M -l use -x -d 'Like perl -M'
+    complete -c rename -s n -l dry-run -l just-print -d 'Only show what would be renamed'
+    complete -c rename -s N -l counter-format -x -a '01 001 0001' -d 'Format and set $N per template'
+    complete -c rename -s p -l mkpath -l make-dirs -d 'Create non-existent dirs'
+    complete -c rename -l stdin -l no-stdin -d 'Always/never read list of files from STDIN'
+    complete -c rename -s T -l transcode -x -d 'Transcode filenames'
+    complete -c rename -s v -l verbose -d 'Print more information'
+    complete -c rename -s a -l append -x -d 'Append STRING to each filename'
+    complete -c rename -s A -l prepend -x -d 'Prepend STRING to each filename'
+    complete -c rename -s c -l lower-case -d 'Convert to all lowercase'
+    complete -c rename -s C -l upper-case -d 'Convert to all uppercase'
+    complete -c rename -s e -l expr -x -d 'Perl expression'
+    complete -c rename -s P -l pipe -d 'Pass filenames to external command'
+    complete -c rename -s s -l subst -x -d 'Simple text substitution'
+    complete -c rename -s S -l subst-all -x -d 'Like -s, but substitutes all matches'
+    complete -c rename -s x -l remove-extension -d 'Remove extension'
+    complete -c rename -s X -l keep-extension -d 'Save and remove extension'
+    complete -c rename -s z -l sanitize -d 'Shortcut for --nows --noctrl --nometa --trim'
+    complete -c rename -l camelcase -d 'Capitalise each word in the filename'
+    complete -c rename -l urlesc -d 'Decode URL-escaped filenames'
+    complete -c rename -l nows -d 'Replace all whitespace with underscores'
+    complete -c rename -l rews -d 'Replace all underscores with whitespace'
+    complete -c rename -l noctrl -d 'Replace all control chars with underscores'
+    complete -c rename -l nometa -d 'Replace all shell meta-chars with underscores'
+end

From e2ab7397acc5502736cd8ed681e33dbd15f74030 Mon Sep 17 00:00:00 2001
From: Amy Grace <zgracem@users.noreply.github.com>
Date: Tue, 5 Dec 2023 12:05:50 -0700
Subject: [PATCH 176/200] completions: add BSD calendar

(cherry picked from commit d1a906026a23cdf94990b228e0de243a20fd3c02)
---
 share/completions/calendar.fish | 10 ++++++++++
 1 file changed, 10 insertions(+)
 create mode 100644 share/completions/calendar.fish

diff --git a/share/completions/calendar.fish b/share/completions/calendar.fish
new file mode 100644
index 000000000..04534c60c
--- /dev/null
+++ b/share/completions/calendar.fish
@@ -0,0 +1,10 @@
+# calendar
+
+complete -c calendar -s A -s l -d "Today + N days forward"
+complete -c calendar -s a -d "Process all users' calendars and mail the results"
+complete -c calendar -s B -d "Today - N days backward"
+complete -c calendar -s b -d "Cyrillic date calculation mode"
+complete -c calendar -s e -d  "Today + N days forward, if today is Friday"
+complete -c calendar -s f -rF -d "Path to default calendar file"
+complete -c calendar -s t -x -d "Today is [[[cc]yy]mm]dd]"
+complete -c calendar -s w -d "Print day of the week name"

From 1af5fb64b7b11c758404267002fcb5174053a9b6 Mon Sep 17 00:00:00 2001
From: Fabian Boehm <FHomborg@gmail.com>
Date: Sun, 10 Dec 2023 10:37:05 +0100
Subject: [PATCH 177/200] vi-bindings: Make "/" open pager and go to insert
 mode

Fixes #10141

(cherry picked from commit dbdef5d267d846cf0e1f888915b0b4a1f9437061)
---
 share/functions/fish_vi_key_bindings.fish | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/share/functions/fish_vi_key_bindings.fish b/share/functions/fish_vi_key_bindings.fish
index 998d30a66..f85dcf3de 100644
--- a/share/functions/fish_vi_key_bindings.fish
+++ b/share/functions/fish_vi_key_bindings.fish
@@ -91,7 +91,7 @@ function fish_vi_key_bindings --description 'vi-like key bindings for fish'
 
     bind -s --preset [ history-token-search-backward
     bind -s --preset ] history-token-search-forward
-    bind -s --preset / history-pager
+    bind -s --preset -m insert / history-pager repaint-mode
 
     bind -s --preset k up-or-search
     bind -s --preset j down-or-search

From 1562a6b99ef7ff8b4b38c8eceb4cc6e2f4ac813f Mon Sep 17 00:00:00 2001
From: Fabian Boehm <FHomborg@gmail.com>
Date: Sun, 10 Dec 2023 10:40:06 +0100
Subject: [PATCH 178/200] completions/git: Disable log signatures

Fixes #10144

(cherry picked from commit a2d0016cc1b5b16e3312f4a6e84ad89f16d0d668)
---
 share/completions/git.fish | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/share/completions/git.fish b/share/completions/git.fish
index 5d87e4188..dc278f036 100644
--- a/share/completions/git.fish
+++ b/share/completions/git.fish
@@ -39,7 +39,7 @@ function __fish_git_commits
     # that happens for 3 commits out of 600k.
     # For fish, at the time of writing, out of 12200 commits, 7 commits need 8 characters.
     # And since this takes about 1/3rd of the time that disambiguating takes...
-    __fish_git log --pretty=tformat:"%H"\t"%<(64,trunc)%s" --all --max-count=1000 2>/dev/null \
+    __fish_git log --no-show-signature --pretty=tformat:"%H"\t"%<(64,trunc)%s" --all --max-count=1000 2>/dev/null \
         | string replace -r '^([0-9a-f]{10})[0-9a-f]*\t(.*)' '$1\t$2'
 end
 
@@ -47,7 +47,7 @@ function __fish_git_recent_commits
     # Like __fish_git_commits, but not on all branches and limited to
     # the last 50 commits. Used for fixup, where only the current branch
     # and the latest commits make sense.
-    __fish_git log --pretty=tformat:"%h"\t"%<(64,trunc)%s" --max-count=50 $argv 2>/dev/null
+    __fish_git log --no-show-signature --pretty=tformat:"%h"\t"%<(64,trunc)%s" --max-count=50 $argv 2>/dev/null
 end
 
 function __fish_git_branches

From 25f16f0bfd8d01c3a873989d4d1904a6b7e7c5f7 Mon Sep 17 00:00:00 2001
From: sigmaSd <bedisnbiba@gmail.com>
Date: Mon, 11 Dec 2023 22:56:06 +0100
Subject: [PATCH 179/200] fix deno task completion for jsonc

(cherry picked from commit f924f06df77de4110cd9453e949080958fb32889)
---
 share/completions/deno.fish | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/share/completions/deno.fish b/share/completions/deno.fish
index 1b1efceed..e5197f599 100644
--- a/share/completions/deno.fish
+++ b/share/completions/deno.fish
@@ -2,6 +2,7 @@ deno completions fish | source
 
 # complete deno task
 set searchForDenoFilesCode '
+import * as JSONC from "https://deno.land/std@0.208.0/jsonc/mod.ts";
 // order matters
 const denoFile = ["deno.json", "deno.jsonc", "package.json"];
 for (const file of denoFile) {
@@ -10,7 +11,7 @@ for (const file of denoFile) {
     // file exists
     const props = file === "package.json" ? "scripts" : "tasks";
     console.log(
-      Object.keys(JSON.parse(Deno.readTextFileSync(file))[props]).join("\n"),
+      Object.keys(JSONC.parse(Deno.readTextFileSync(file))[props]).join("\n"),
     );
     break;
   } catch {}

From 7c20fe8cc6784491d6ef0424305ed9253a3ad147 Mon Sep 17 00:00:00 2001
From: sigmaSd <bedisnbiba@gmail.com>
Date: Tue, 12 Dec 2023 17:33:16 +0100
Subject: [PATCH 180/200] use a better method

(cherry picked from commit df3c5ab402e502e69ee93242300b542b5168ba06)
---
 share/completions/deno.fish | 18 +-----------------
 1 file changed, 1 insertion(+), 17 deletions(-)

diff --git a/share/completions/deno.fish b/share/completions/deno.fish
index e5197f599..22a4ee062 100644
--- a/share/completions/deno.fish
+++ b/share/completions/deno.fish
@@ -1,20 +1,4 @@
 deno completions fish | source
 
 # complete deno task
-set searchForDenoFilesCode '
-import * as JSONC from "https://deno.land/std@0.208.0/jsonc/mod.ts";
-// order matters
-const denoFile = ["deno.json", "deno.jsonc", "package.json"];
-for (const file of denoFile) {
-  try {
-    Deno.statSync(file);
-    // file exists
-    const props = file === "package.json" ? "scripts" : "tasks";
-    console.log(
-      Object.keys(JSONC.parse(Deno.readTextFileSync(file))[props]).join("\n"),
-    );
-    break;
-  } catch {}
-}
-'
-complete -f -c deno -n "__fish_seen_subcommand_from task" -n "__fish_is_nth_token 2" -a "(deno eval '$searchForDenoFilesCode')"
+complete -f -c deno -n "__fish_seen_subcommand_from task" -n "__fish_is_nth_token 2" -a "(NO_COLOR=1 deno task &| string match -rg '^- (\S*)')"

From 0af930d992a4fd88febfb7d856c27ce29c4f8c92 Mon Sep 17 00:00:00 2001
From: Fabian Boehm <FHomborg@gmail.com>
Date: Sat, 23 Sep 2023 15:09:59 +0200
Subject: [PATCH 181/200] Add doctl completion

Just calling a generation thing

(cherry picked from commit e682ffaf11dde439bb6bc77a24e428d029bf3ca8)
---
 share/completions/doctl.fish | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 share/completions/doctl.fish

diff --git a/share/completions/doctl.fish b/share/completions/doctl.fish
new file mode 100644
index 000000000..2c790ec57
--- /dev/null
+++ b/share/completions/doctl.fish
@@ -0,0 +1 @@
+doctl completion fish | source

From 99254d74febd86dffc6b4acdb88240bf9aa3cb38 Mon Sep 17 00:00:00 2001
From: Damien Picard <dam.pic@free.fr>
Date: Mon, 11 Dec 2023 19:55:06 +0100
Subject: [PATCH 182/200] completions: improve Blender completions

- Replace short options with old-style options: even though they are
  single-letter, Blender's options cannot be combined.
- Add comments to separate blocks of options, mirroring Blender's help message.
- Add missing options: render-frame, python-use-system-env, register-allusers,
  unregister, unregister-allusers.
- Remove options: debug-gpu-disable-ssbo, debug-gpu-renderdoc, -R.
- Fix typos:
  - debug-depsgraph-eval (was -evel)
  - debug-depsgraph-pretty (was -time)
  - app-template (was open-last)
- Update output formats:
  - Add descriptions.
  - Add HDR, TIFF, OpenEXR, OpenEXR Multilayer, FFmpeg, Cineon, DPX, JPEG 2000,
    and WebP, which are optional but generally available.
  - Remove IRIZ, which is no longer available.
- Fix arguments for --use-extension: they should be 0 or 1, not true or false.
- Make env-system-* options require a parameter.
- Improve --add-ons by querying the list of add-ons inside Blender rather than a
  hardcoded path. This is because Blender's add-on modules may come from many
  different paths which depend on platform.
- Fix __blender_echo_input_file_name, by relying on extension.
- Fix listing of scene datablocks inside Blend file.
- Add listing of Python text datablocks to execute inside Blend file.

Closes #10150

(cherry picked from commit 91326846177927dd4d0c1f8ac22c9d1097f91209)
---
 share/completions/blender.fish | 266 ++++++++++++++++++++-------------
 1 file changed, 158 insertions(+), 108 deletions(-)

diff --git a/share/completions/blender.fish b/share/completions/blender.fish
index ada9942a5..41d5c373d 100644
--- a/share/completions/blender.fish
+++ b/share/completions/blender.fish
@@ -1,125 +1,175 @@
-function __blender_list_scenes -a file
-    blender --background $file --python-expr 'import bpy
-
-for name in [scene.name for scene in list(bpy.data.scenes)]:
-    print(f"\t{name}")' |
-        string replace -r -f '^\s+' ''
-end
-
-function __blender_list_addons
-    path basename /usr/share/blender/scripts/addons/*.py |
-        path change-extension ''
-end
-
-function __blender_list_engines
-    blender --background --engine help | string replace -r -f '^\s+' ''
+function __blender_player -d 'Check if -a option has been used, to run animation player'
+    return (__fish_contains_opt -s a; and not __fish_contains_opt -s b background)
 end
 
 function __blender_echo_input_file_name
-    echo $argv |
-        string split -n ' ' |
-        string match -r -v '^-' |
-        head --lines=1
+    # Find last argument ending in .blend (or .blend1, etc.)
+    # This is because a Blender invocation can open multiple blend file
+    # sequentially, so we need to find the last one up to this point.
+    set -l path (commandline -poc |
+        string match -r '.*\\.blend[0-9]*$' |
+        tail --lines=1)
+    # Using eval to expand ~ and variables specified on the commandline.
+    eval echo $path
 end
 
-function __blender_complete_addon_list
-    set -l previous_token (commandline -oc)[-1]
-    set -l current_token (commandline -t)
-
-    if test "$previous_token" = --addons
-        __blender_list_addons |
-            string replace -r '^' $current_token |
-            string replace -r '$' ','
-    end
+function __blender_list_scenes
+    blender --background (__blender_echo_input_file_name) --python-expr 'import bpy
+for scene in bpy.data.scenes:
+    print(f"\t{scene.name}")' |
+        string replace -r -f '^\t' ''
 end
 
-complete -c blender -s h -l help -d 'show help'
-complete -c blender -s v -l version -d 'show version'
+function __blender_list_texts
+    blender --background (__blender_echo_input_file_name) --python-expr 'import bpy
+for text in bpy.data.texts:
+    print(f"\t{text.name}")' |
+        string replace -r -f '^\t' ''
+end
 
-complete -c blender -s b -l background -d 'hide UI'
-complete -c blender -s a -l render-anim -d 'specify render frames' -r
-complete -c blender -s S -l scene -a '(__blender_list_scenes (commandline -poc))' -n 'test -n (__blender_echo_input_file_name (commandline -poc))' -d 'specify scene' -x
-complete -c blender -s s -l frame-start -d 'specify start frame' -x
-complete -c blender -s e -l end-start -d 'specify end frame' -x
-complete -c blender -s j -l frame-jump -d 'skip frame count' -x
-complete -c blender -s o -l render-output -d 'specify render output' -r
-complete -c blender -s E -l engine -a '(__blender_list_engines)' -d 'render engine' -x
-complete -c blender -s t -l threads -d 'specify thread count'
+function __blender_list_engines
+    blender --background --engine help | string replace -r -f '^\t' ''
+end
 
-complete -c blender -s F -l render-format -a 'TGA RAWTGA JPEG IRIS IRIZ AVIRAW AVIJPEG PNG BMP' -d 'specify render format' -x
-complete -c blender -s x -l use-extension -a 'true false' -d 'whether add a file extension to an end of a file' -x
+function __blender_list_addons
+    blender --background --python-expr 'import addon_utils
+for mod in addon_utils.modules():
+    print(f"\t{mod.__name__}")' |
+        string replace -r -f '^\t' ''
+end
 
-complete -c blender -s a -d 'animation playback options' -x
+complete -c blender -n 'not __blender_player' -o h -l help -d 'Show help'
+complete -c blender -n 'not __blender_player' -o v -l version -d 'Show version'
 
-complete -c blender -s w -l window-border -d 'show window borders'
-complete -c blender -s W -l window-fullscreen -d 'show in fullscreen'
-complete -c blender -s p -l window-geometry -d 'specify position and size' -x
-complete -c blender -s M -l window-maximized -d 'maximize window'
-complete -c blender -o con -l start-console -d 'open console'
-complete -c blender -l no-native-pixels -d 'do not use native pixel size'
-complete -c blender -l no-native-pixels -d 'open unfocused'
+# Render Options:
+complete -c blender -n 'not __blender_player' -o b -l background -d 'Hide UI'
+complete -c blender -n 'not __blender_player' -o a -l render-anim -d 'Render animation'
+complete -c blender -n 'not __blender_player; and test -e (__blender_echo_input_file_name)' -o S -l scene -a '(__blender_list_scenes)' -d 'Specify scene' -x
+complete -c blender -n 'not __blender_player' -o f -l render-frame -d 'Render specified frame(s)' -x
 
-complete -c blender -s y -l enable-autoexec -d 'enable Python scripts automatic execution'
-complete -c blender -s Y -l disable-autoexec -d 'disable Python scripts automatic execution'
-complete -c blender -s P -l python -d 'specify Python script' -r
-complete -c blender -l python-text -d 'specify Python text block' -x
-complete -c blender -l python-expr -d 'specify Python expression' -x
-complete -c blender -l python-console -d 'open interactive console'
-complete -c blender -l python-exit-code -d 'specify Python exit code on exception'
-complete -c blender -l addons -a '(__blender_complete_addon_list)' -d 'specify addons' -x
+complete -c blender -n 'not __blender_player' -o s -l frame-start -d 'Specify start frame' -x
+complete -c blender -n 'not __blender_player' -o e -l frame-end -d 'Specify end frame' -x
+complete -c blender -n 'not __blender_player' -o j -l frame-jump -d 'Skip frame count' -x
+complete -c blender -n 'not __blender_player' -o o -l render-output -d 'Specify render output' -r
+complete -c blender -n 'not __blender_player' -o E -l engine -a '(__blender_list_engines)' -d 'Render engine' -x
+complete -c blender -n 'not __blender_player' -o t -l threads -d 'Specify thread count'
 
-complete -c blender -l log -d 'enable logging categories' -x
-complete -c blender -l log-level -d 'specify log level' -x
-complete -c blender -l log-show-basename -d 'hide file leading path'
-complete -c blender -l log-show-backtrace -d 'show backtrace'
-complete -c blender -l log-show-timestamp -d 'show timestamp'
-complete -c blender -l log-file -d 'specify log file' -r
+# Format Options:
+complete -c blender -n 'not __blender_player' -o F -l render-format -a 'TGA\tTarga
+RAWTGA\tTarga\ Raw
+JPEG\tJPEG
+IRIS\tIRIS
+AVIRAW\tAVI\ Raw
+AVIJPEG\tAVI\ with\ JPEG\ codec
+PNG\tPNG
+BMP\tBMP
+HDR\tHDR
+TIFF\tTIFF
+OPEN_EXR\tOpenEXR
+OPEN_EXR_MULTILAYER\tOpenEXR\ Multilayer
+FFMPEG\tFFmpeg\ Video
+CINEON\tCineon
+DPX\tDPX
+JP2\tJPEG\ 2000
+WEBP\tWebP' -d 'Specify render format' -x
+complete -c blender -n 'not __blender_player' -o x -l use-extension -a '0\tfalse
+1\ttrue' -d 'Whether to add a file extension to an end of a file' -x
 
-complete -c blender -s d -l debug -d 'enable debugging'
-complete -c blender -l debug-value -d 'specify debug value'
-complete -c blender -l debug-events -d 'enable debug messages'
-complete -c blender -l debug-ffmpeg -d 'enable debug messages from FFmpeg library'
-complete -c blender -l debug-handlers -d 'enable debug messages for event handling'
-complete -c blender -l debug-libmv -d 'enable debug messages for libmv library'
-complete -c blender -l debug-cycles -d 'enable debug messages for Cycles'
-complete -c blender -l debug-memory -d 'enable fully guarded memory allocation and debugging'
-complete -c blender -l debug-jobs -d 'enable time profiling for background jobs'
-complete -c blender -l debug-python -d 'enable debug messages for Python'
-complete -c blender -l debug-depsgraph -d 'enable all debug messages for dependency graph'
-complete -c blender -l debug-depsgraph-evel -d 'enable debug messages for dependency graph related on evalution'
-complete -c blender -l debug-depsgraph-build -d 'enable debug messages for dependency graph related on its construction'
-complete -c blender -l debug-depsgraph-tag -d 'enable debug messages for dependency graph related on tagging'
-complete -c blender -l debug-depsgraph-no-threads -d 'enable single treaded evaluation for dependency graph'
-complete -c blender -l debug-depsgraph-time -d 'enable debug messages for dependency graph related on timing'
-complete -c blender -l debug-depsgraph-time -d 'enable colors for dependency graph debug messages'
-complete -c blender -l debug-depsgraph-uuid -d 'enable virefication for dependency graph session-wide identifiers'
-complete -c blender -l debug-ghost -d 'enable debug messages for Ghost'
-complete -c blender -l debug-wintab -d 'enable debug messages for Wintab'
-complete -c blender -l debug-gpu -d 'enable GPU debug context and infromation for OpenGL'
-complete -c blender -l debug-gpu-force-workarounds -d 'enable workarounds for typical GPU issues'
-complete -c blender -l debug-gpu-disable-ssbo -d 'disable shader storage buffer objects'
-complete -c blender -l debug-gpu-renderdoc -d 'enable Renderdoc integration'
-complete -c blender -l debug-wm -d 'enable debug messages for window manager'
-complete -c blender -l debug-xr -d 'enable debug messages for virtual reality contexts'
-complete -c blender -l debug-xr-time -d 'enable debug messages for virtual reality frame rendering times'
-complete -c blender -l debug-all -d 'enable all debug messages'
-complete -c blender -l debug-io -d 'enable debug for I/O'
-complete -c blender -l debug-exit-on-error -d 'whether exit on internal error'
-complete -c blender -l disable-crash-handler -d 'disable crash handler'
-complete -c blender -l disable-abort-handler -d 'disable abort handler'
-complete -c blender -l verbose -d 'specify logging verbosity level' -x
+# Animation Playback Options:
+complete -c blender -n 'not __blender_player' -o a -d 'Run as animation player'
 
-complete -c blender -l gpu-backend -a 'vulkan metal opengl' -d 'specify GPI backend' -x
+complete -c blender -n '__blender_player' -o p -x -d 'Specify position and size'
+complete -c blender -n '__blender_player' -o m -d 'Read from disk (do not buffer)'
+complete -c blender -n '__blender_player' -o f -x -d 'Specify FPS to start with'
+complete -c blender -n '__blender_player' -o j -x -d 'Specify frame step'
+complete -c blender -n '__blender_player' -o s -x -d 'Specify start frame'
+complete -c blender -n '__blender_player' -o e -x -d 'Specify end frame'
+complete -c blender -n '__blender_player' -o c -x -d 'Memory in MB for cache'
 
-complete -c blender -l open-last -d 'open the most recent .blend file'
-complete -c blender -l open-last -a 'default' -d 'specify app template' -r
-complete -c blender -l factory-startup -d 'do not read startup.blend'
-complete -c blender -l enable-event-simulate -d 'enable event simulation'
-complete -c blender -l env-system-datafiles -d 'set BLENDER_SYSTEM_DATAFILES variable'
-complete -c blender -l env-system-scripts -d 'set BLENDER_SYSTEM_SCRIPTS variable'
-complete -c blender -l env-system-python -d 'set BLENDER_SYSTEM_PYTHON variable'
-complete -c blender -o noaudio -d 'disable sound'
-complete -c blender -o setaudio -a 'None SDL OpenAL CoreAudio JACK PulseAudio WASAPI' -d 'specify sound device' -x
-complete -c blender -s R -d 'register .blend extension'
-complete -c blender -s r -d 'silently register .blend extension'
+# Window Options:
+complete -c blender -n 'not __blender_player' -o w -l window-border -d 'Show window borders'
+complete -c blender -n 'not __blender_player' -o W -l window-fullscreen -d 'Show in fullscreen'
+complete -c blender -n 'not __blender_player' -o p -l window-geometry -d 'Specify position and size' -x
+complete -c blender -n 'not __blender_player' -o M -l window-maximized -d 'Maximize window'
+complete -c blender -n 'not __blender_player' -o con -l start-console -d 'Open console'
+complete -c blender -n 'not __blender_player' -l no-native-pixels -d 'Do not use native pixel size'
+complete -c blender -n 'not __blender_player' -l no-window-focus -d 'Open unfocused'
 
+# Python Options:
+complete -c blender -n 'not __blender_player' -o y -l enable-autoexec -d 'Enable Python scripts automatic execution'
+complete -c blender -n 'not __blender_player' -o Y -l disable-autoexec -d 'Disable Python scripts automatic execution'
+
+complete -c blender -n 'not __blender_player' -o P -l python -d 'Specify Python script' -r
+complete -c blender -n 'not __blender_player; and test -e (__blender_echo_input_file_name)' -l python-text -a '(__blender_list_texts)' -d 'Specify Python text block' -x
+complete -c blender -n 'not __blender_player' -l python-expr -d 'Specify Python expression' -x
+complete -c blender -n 'not __blender_player' -l python-console -d 'Open interactive console'
+complete -c blender -n 'not __blender_player' -l python-exit-code -d 'Specify Python exit code on exception'
+complete -c blender -n 'not __blender_player' -l python-use-system-env -d 'Use system env vars and user site-packages'
+complete -c blender -n 'not __blender_player' -l addons -a '(__fish_append , (__blender_list_addons))' -d 'Specify addons' -x
+
+# Logging Options:
+complete -c blender -n 'not __blender_player' -l log -d 'Enable logging categories' -x
+complete -c blender -n 'not __blender_player' -l log-level -d 'Specify log level' -x
+complete -c blender -n 'not __blender_player' -l log-show-basename -d 'Hide file leading path'
+complete -c blender -n 'not __blender_player' -l log-show-backtrace -d 'Show backtrace'
+complete -c blender -n 'not __blender_player' -l log-show-timestamp -d 'Show timestamp'
+complete -c blender -n 'not __blender_player' -l log-file -d 'Specify log file' -r
+
+# Debug Options:
+complete -c blender -n 'not __blender_player' -o d -l debug -d 'Enable debugging'
+complete -c blender -n 'not __blender_player' -l debug-value -d 'Specify debug value'
+
+complete -c blender -n 'not __blender_player' -l debug-events -d 'Enable debug messages from the event system'
+complete -c blender -n 'not __blender_player' -l debug-ffmpeg -d 'Enable debug messages from FFmpeg library'
+complete -c blender -n 'not __blender_player' -l debug-handlers -d 'Enable debug messages for event handling'
+complete -c blender -n 'not __blender_player' -l debug-libmv -d 'Enable debug messages for libmv library'
+complete -c blender -n 'not __blender_player' -l debug-cycles -d 'Enable debug messages for Cycles'
+complete -c blender -n 'not __blender_player' -l debug-memory -d 'Enable fully guarded memory allocation and debugging'
+complete -c blender -n 'not __blender_player' -l debug-jobs -d 'Enable time profiling for background jobs'
+complete -c blender -n 'not __blender_player' -l debug-python -d 'Enable debug messages for Python'
+complete -c blender -n 'not __blender_player' -l debug-depsgraph -d 'Enable all debug messages for dependency graph'
+complete -c blender -n 'not __blender_player' -l debug-depsgraph-eval -d 'Enable debug messages for dependency graph related on evalution'
+complete -c blender -n 'not __blender_player' -l debug-depsgraph-build -d 'Enable debug messages for dependency graph related on its construction'
+complete -c blender -n 'not __blender_player' -l debug-depsgraph-tag -d 'Enable debug messages for dependency graph related on tagging'
+complete -c blender -n 'not __blender_player' -l debug-depsgraph-no-threads -d 'Enable single treaded evaluation for dependency graph'
+complete -c blender -n 'not __blender_player' -l debug-depsgraph-time -d 'Enable debug messages for dependency graph related on timing'
+complete -c blender -n 'not __blender_player' -l debug-depsgraph-pretty -d 'Enable colors for dependency graph debug messages'
+complete -c blender -n 'not __blender_player' -l debug-depsgraph-uuid -d 'Enable virefication for dependency graph session-wide identifiers'
+complete -c blender -n 'not __blender_player' -l debug-ghost -d 'Enable debug messages for Ghost'
+complete -c blender -n 'not __blender_player' -l debug-wintab -d 'Enable debug messages for Wintab'
+complete -c blender -n 'not __blender_player' -l debug-gpu -d 'Enable GPU debug context and infromation for OpenGL'
+complete -c blender -n 'not __blender_player' -l debug-gpu-force-workarounds -d 'Enable workarounds for typical GPU issues'
+complete -c blender -n 'not __blender_player' -l debug-wm -d 'Enable debug messages for window manager'
+complete -c blender -n 'not __blender_player' -l debug-xr -d 'Enable debug messages for virtual reality contexts'
+complete -c blender -n 'not __blender_player' -l debug-xr-time -d 'Enable debug messages for virtual reality frame rendering times'
+complete -c blender -n 'not __blender_player' -l debug-all -d 'Enable all debug messages'
+complete -c blender -n 'not __blender_player' -l debug-io -d 'Enable debug for I/O'
+complete -c blender -n 'not __blender_player' -l debug-fpe -d 'Enable floating point exceptions'
+complete -c blender -n 'not __blender_player' -l debug-exit-on-error -d 'Exit on internal error'
+complete -c blender -n 'not __blender_player' -l debug-freestyle -d 'Enable debug messages for Freestyle'
+complete -c blender -n 'not __blender_player' -l disable-crash-handler -d 'Disable crash handler'
+complete -c blender -n 'not __blender_player' -l disable-abort-handler -d 'Disable abort handler'
+complete -c blender -n 'not __blender_player' -l verbose -d 'Specify logging verbosity level' -x
+
+# GPU Options:
+complete -c blender -n 'not __blender_player' -l gpu-backend -a 'vulkan metal opengl' -d 'Specify GPU backend' -x
+
+# Misc Options:
+complete -c blender -n 'not __blender_player' -l open-last -d 'Open the most recent .blend file'
+complete -c blender -n 'not __blender_player' -l app-template -a default -d 'Specify app template' -x
+complete -c blender -n 'not __blender_player' -l factory-startup -d 'Do not read startup.blend'
+complete -c blender -n 'not __blender_player' -l enable-event-simulate -d 'Enable event simulation'
+
+complete -c blender -n 'not __blender_player' -l env-system-datafiles -d 'Set BLENDER_SYSTEM_DATAFILES variable' -r
+complete -c blender -n 'not __blender_player' -l env-system-scripts -d 'Set BLENDER_SYSTEM_SCRIPTS variable' -r
+complete -c blender -n 'not __blender_player' -l env-system-python -d 'Set BLENDER_SYSTEM_PYTHON variable' -r
+
+complete -c blender -n 'not __blender_player' -o noaudio -d 'Disable sound'
+complete -c blender -n 'not __blender_player' -o setaudio -a 'None SDL OpenAL CoreAudio JACK PulseAudio WASAPI' -d 'Specify sound device' -x
+
+complete -c blender -n 'not __blender_player' -o r -l register -d 'Register .blend extension for current user'
+complete -c blender -n 'not __blender_player' -l register-allusers -d 'Register .blend extension for all users'
+complete -c blender -n 'not __blender_player' -l unregister -d 'Unregister .blend extension for current user'
+complete -c blender -n 'not __blender_player' -l unregister-allusers -d 'Unregister .blend extension for all users'
+
+complete -c blender -n 'not __blender_player' -o - -d 'End option processing, following arguments passed to python'

From bfe47e597985214aadf094a9810dc5e0d1015b7c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Rudolf=20Lovren=C4=8Di=C4=87?= <rudolf@lovrencic.xyz>
Date: Tue, 12 Dec 2023 13:53:04 +0100
Subject: [PATCH 183/200] Add object files to ninja completions

When working on a C or C++ projects, it is often handy to compile a
single file (e.g. large refactoring where many files fail to compile so
compiling a single file results in less compiler errors making the compiler
output significantly easier to read and navigate). Current completion offers
only ninja targets which are usually just top level binaries. This commit makes
object files and library files to be offered in the ninja completion.

The change is inspired by the zsh ninja completion [1], but aims to reduce noise
by only matching for entries ending in ".o", ".so" or ".a".

[1] https://github.com/zchee/zsh-completions/blob/c828f06e08ba96c0cf2fc626bb62be932ea112ab/src/zsh/_ninja#L30

(cherry picked from commit 2e89e0c2050f8e0beaf7ff2177d4793f271801ff)
---
 share/completions/ninja.fish | 1 +
 1 file changed, 1 insertion(+)

diff --git a/share/completions/ninja.fish b/share/completions/ninja.fish
index 8686354db..dcb3f85a4 100644
--- a/share/completions/ninja.fish
+++ b/share/completions/ninja.fish
@@ -13,6 +13,7 @@ end
 
 function __fish_print_ninja_targets
     __fish_ninja -t targets 2>/dev/null | string replace -r ':.*' ''
+    __fish_ninja -t targets all 2>/dev/null | string replace -r ':.*' '' | string match -e -r '\.(?:o|so|a)$'
 end
 complete -c ninja -f -a '(__fish_print_ninja_targets)' -d target
 complete -x -c ninja -s t -x -a "(__fish_print_ninja_tools)" -d subtool

From dc90093f8b765d4612ba82b8170d8c9c7c1fc3eb Mon Sep 17 00:00:00 2001
From: Johannes Altmanninger <aclopte@gmail.com>
Date: Wed, 27 Dec 2023 17:08:06 +0100
Subject: [PATCH 184/200] completions: use POSIX character classes with sed

\s and \S are not supported BSD sed.

Fixes #10163

(cherry picked from commit 81c8cd1b6150c974b05d73f6a31beb7344f93984)
---
 share/completions/highlight.fish | 2 +-
 share/completions/lsblk.fish     | 2 +-
 share/completions/mvn.fish       | 2 +-
 share/completions/setxkbmap.fish | 4 ++--
 share/completions/status.fish    | 2 +-
 5 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/share/completions/highlight.fish b/share/completions/highlight.fish
index 5a34862b7..ef82025ad 100644
--- a/share/completions/highlight.fish
+++ b/share/completions/highlight.fish
@@ -4,5 +4,5 @@ complete -c highlight -s t -l tab -d 'Specify tab length' -x
 complete -c highlight -s i -l input -d 'Name of the input file' -r
 complete -c highlight -s o -l output -d 'Name of the output file' -r
 complete -c highlight -s d -l outdir -d 'Output directory' -r
-complete -c highlight -s S -l syntax -d 'Set type of the source code' -xa "(highlight -p | sed -r 's/^(.*\S)\s+:\s*(\S+).*\$/\2\t\1/; /^\$/d')"
+complete -c highlight -s S -l syntax -d 'Set type of the source code' -xa "(highlight -p | sed -r 's/^(.*[^[:space:]])[[:space:]]+:[[:space:]]*([^[:space:]]+).*\$/\2\t\1/; /^\$/d')"
 complete -c highlight -s s -l style -d 'Highlight style' -xa "(highlight --list-themes | sed '/^\$\| /d')"
diff --git a/share/completions/lsblk.fish b/share/completions/lsblk.fish
index 5be0a9d88..21fab0c0a 100644
--- a/share/completions/lsblk.fish
+++ b/share/completions/lsblk.fish
@@ -1,5 +1,5 @@
 function __fish_print_lsblk_columns --description 'Print available lsblk columns'
-    LC_ALL=C lsblk --help | sed '1,/Available .*columns:/d; /^$/,$d; s/^\s\+//; s/\s/\t/'
+    LC_ALL=C lsblk --help | sed '1,/Available .*columns:/d; /^$/,$d; s/^[[:space:]]\+//; s/[[:space:]]/\t/'
 end
 
 complete -c lsblk -s a -l all -d "print all devices"
diff --git a/share/completions/mvn.fish b/share/completions/mvn.fish
index 5266c3fad..499337211 100644
--- a/share/completions/mvn.fish
+++ b/share/completions/mvn.fish
@@ -88,7 +88,7 @@ function __fish_mvn_profiles
 end
 
 function __fish_mvn_projects
-    grep "<module>" pom.xml 2>/dev/null | sed 's/\s*<[^<]*>\(.*\)<[^<]*>/\1/'
+    grep "<module>" pom.xml 2>/dev/null | sed 's/[[:space:]]*<[^<]*>\(.*\)<[^<]*>/\1/'
 end
 
 complete -c mvn -f -r -o P -l activate-profiles -a "(__fish_mvn_profiles)" -d "Comma-delimited list of profiles to activate"
diff --git a/share/completions/setxkbmap.fish b/share/completions/setxkbmap.fish
index 390354b39..96aeed77d 100644
--- a/share/completions/setxkbmap.fish
+++ b/share/completions/setxkbmap.fish
@@ -1,8 +1,8 @@
 function __fish_complete_setxkbmap --description 'Complete setxkb options' --argument-names what
-    sed -e "1,/! $what/d" -e '/^\s*$/,$d' /usr/share/X11/xkb/rules/xorg.lst | sed -r 's/\s+(\S+)\s+(.+)/\1\t\2/'
+    sed -e "1,/! $what/d" -e '/^[[:space:]]*$/,$d' /usr/share/X11/xkb/rules/xorg.lst | sed -r 's/[[:space:]]+([^[:space:]]+)[[:space:]]+(.+)/\1\t\2/'
 end
 
-set -l filter '"s/\S+\s\S+\s(.+)\((.+)\)/\1\t\2/;"'
+set -l filter '"s/[^[:space:]]+[[:space:]][^[:space:]]+[[:space:]](.+)\((.+)\)/\1\t\2/;"'
 
 complete -c setxkbmap -o '?' -o help -d 'Print this message'
 complete -c setxkbmap -o compat -d 'Specifies compatibility map component name' -xa "(sed -r $filter /usr/share/X11/xkb/compat.dir)"
diff --git a/share/completions/status.fish b/share/completions/status.fish
index b10c8db9a..0afeed0f9 100644
--- a/share/completions/status.fish
+++ b/share/completions/status.fish
@@ -27,7 +27,7 @@ complete -f -c status -n "not __fish_seen_subcommand_from $__fish_status_all_com
 complete -f -c status -n "not __fish_seen_subcommand_from $__fish_status_all_commands" -a stack-trace -d "Print a list of all function calls leading up to running the current command"
 complete -f -c status -n "not __fish_seen_subcommand_from $__fish_status_all_commands" -a features -d "List all feature flags"
 complete -f -c status -n "not __fish_seen_subcommand_from $__fish_status_all_commands" -a test-feature -d "Test if a feature flag is enabled"
-complete -f -c status -n "__fish_seen_subcommand_from test-feature" -a '(status features | sed "s/\s\+\S*\s\+\S*/\t/")'
+complete -f -c status -n "__fish_seen_subcommand_from test-feature" -a '(status features | sed "s/[[:space:]]\+[^[:space:]]*[[:space:]]\+[^[:space:]]*/\t/")'
 complete -f -c status -n "not __fish_seen_subcommand_from $__fish_status_all_commands" -a fish-path -d "Print the path to the current instance of fish"
 
 # The job-control command changes fish state.

From e0282d0174366118cbb6b1273dad321bb81d6196 Mon Sep 17 00:00:00 2001
From: David Adam <zanchey@ucc.gu.uwa.edu.au>
Date: Sun, 31 Dec 2023 12:58:39 +0800
Subject: [PATCH 185/200] docs/license: remove duplication

---
 doc_src/license.rst | 134 ++++----------------------------------------
 1 file changed, 10 insertions(+), 124 deletions(-)

diff --git a/doc_src/license.rst b/doc_src/license.rst
index 49b9a00ea..b41d5cdf1 100644
--- a/doc_src/license.rst
+++ b/doc_src/license.rst
@@ -176,9 +176,8 @@ products or services of Licensee, or any third party.
 agrees to be bound by the terms and conditions of this License
 Agreement.
 
-----
-
-**License for CMake**
+License for CMake
+-----------------
 
 The ``fish`` source code contains files from [CMake](https://cmake.org) to support the build system.
 This code is distributed under the terms of a BSD-style license. Copyright 2000-2017 Kitware, Inc.
@@ -217,9 +216,8 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-----
-
-**License for code derived from tmux**
+License for code derived from tmux
+----------------------------------
 
 ``fish`` contains code from [tmux](http://tmux.sourceforge.net), copyrighted by Nicholas Marriott <nicm@users.sourceforge.net> (2007), and made available under the OpenBSD license.
 
@@ -229,9 +227,8 @@ Permission to use, copy, modify, and distribute this software for any purpose wi
 
 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 UTF8**
+License for UTF8
+----------------
 
 ``fish`` also contains small amounts of code under the ISC license, namely the UTF-8 conversion functions. This code is copyright © 2007 Alexey Vatchenko \<av@bsdua.org>.
 
@@ -241,9 +238,8 @@ Permission to use, copy, modify, and/or distribute this software for any purpose
 
 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 flock**
+License for flock
+-----------------
 
 ``fish`` also contains small amounts of code from NetBSD, namely the ``flock`` fallback function. This code is copyright 2001 The NetBSD Foundation, Inc., and derived from software contributed to The NetBSD Foundation by Todd Vierling.
 
@@ -271,118 +267,8 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 POSSIBILITY OF SUCH DAMAGE.
 
-----
-
-**MIT License**
-
-``fish`` includes a copy of AngularJS, which is copyright 2010-2012 Google, Inc. and licensed under the MIT License.
-
-The MIT license follows.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-----
-
-**License for CMake**
-
-The ``fish`` source code contains files from [CMake](https://cmake.org) to support the build system.
-This code is distributed under the terms of a BSD-style license. Copyright 2000-2017 Kitware, Inc.
-and Contributors.
-
-The BSD license for CMake follows.
-
-CMake - Cross Platform Makefile Generator
-Copyright 2000-2017 Kitware, Inc. and Contributors
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-
-* Redistributions of source code must retain the above copyright
-  notice, this list of conditions and the following disclaimer.
-
-* Redistributions in binary form must reproduce the above copyright
-  notice, this list of conditions and the following disclaimer in the
-  documentation and/or other materials provided with the distribution.
-
-* Neither the name of Kitware, Inc. nor the names of Contributors
-  may be used to endorse or promote products derived from this
-  software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-----
-
-**License for code derived from tmux**
-
-``fish`` contains code from [tmux](http://tmux.sourceforge.net), copyrighted by Nicholas Marriott <nicm@users.sourceforge.net> (2007), and made available under the OpenBSD license.
-
-The OpenBSD license is included below.
-
-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.
-
-----
-
-**License for UTF8**
-
-``fish`` also contains small amounts of code under the ISC license, namely the UTF-8 conversion functions. This code is copyright © 2007 Alexey Vatchenko \<av@bsdua.org>.
-
-The ISC license agreement follows.
-
-Permission to use, copy, modify, and/or 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.
-
-----
-
-**License for flock**
-
-``fish`` also contains small amounts of code from NetBSD, namely the ``flock`` fallback function. This code is copyright 2001 The NetBSD Foundation, Inc., and derived from software contributed to The NetBSD Foundation by Todd Vierling.
-
-The NetBSD license follows.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-1. Redistributions of source code must retain the above copyright
-   notice, this list of conditions and the following disclaimer.
-
-2. Redistributions in binary form must reproduce the above copyright
-   notice, this list of conditions and the following disclaimer in the
-   documentation and/or other materials provided with the distribution.
-
-THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
-TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
-BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGE.
-
-----
-
-**MIT License**
+MIT License
+-----------
 
 ``fish`` includes a copy of AngularJS, which is copyright 2010-2012 Google, Inc. and licensed under the MIT License. It also includes the Dracula theme, which is copyright 2018 Dracula Team, and is licensed under the same license.
 

From 6d9c32728eb794c0d983d583f8acc1ed92dcf39b Mon Sep 17 00:00:00 2001
From: David Adam <zanchey@ucc.gu.uwa.edu.au>
Date: Sun, 31 Dec 2023 12:44:29 +0800
Subject: [PATCH 186/200] docs/license: note Nord theme license

(cherry picked from commit ea34f71e1c6305d1ba948a37c9a591200c96cd24)
---
 doc_src/license.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc_src/license.rst b/doc_src/license.rst
index b41d5cdf1..af5f377eb 100644
--- a/doc_src/license.rst
+++ b/doc_src/license.rst
@@ -270,7 +270,7 @@ POSSIBILITY OF SUCH DAMAGE.
 MIT License
 -----------
 
-``fish`` includes a copy of AngularJS, which is copyright 2010-2012 Google, Inc. and licensed under the MIT License. It also includes the Dracula theme, which is copyright 2018 Dracula Team, and is licensed under the same license.
+``fish`` includes a copy of AngularJS, which is copyright 2010-2012 Google, Inc. and licensed under the MIT License. It also includes the Dracula theme, which is copyright 2018 Dracula Team, and the Nord theme, which is copyright 2016-present Sven Greb. These themes are also used under the MIT license.
 
 The MIT license follows.
 

From 1b3f7cf2e55fd5a0cdbce20c7adef0a24c9cfc50 Mon Sep 17 00:00:00 2001
From: David Adam <zanchey@ucc.gu.uwa.edu.au>
Date: Sun, 31 Dec 2023 12:54:31 +0800
Subject: [PATCH 187/200] themes/Nord: include license tag

(cherry picked from commit 31eb429add1f4c498eaead55be637f52944227cd)
---
 share/tools/web_config/themes/Nord.theme | 1 +
 1 file changed, 1 insertion(+)

diff --git a/share/tools/web_config/themes/Nord.theme b/share/tools/web_config/themes/Nord.theme
index ebe7e8a0c..82399654e 100644
--- a/share/tools/web_config/themes/Nord.theme
+++ b/share/tools/web_config/themes/Nord.theme
@@ -1,4 +1,5 @@
 # name: Nord
+# license: 'MIT'
 # preferred_background: 2e3440
 # url: https://www.nordtheme.com
 

From 8508cc50b0e3e0c5b36dc89dd762ceb34ab6a402 Mon Sep 17 00:00:00 2001
From: David Adam <zanchey@ucc.gu.uwa.edu.au>
Date: Sun, 31 Dec 2023 13:07:02 +0800
Subject: [PATCH 188/200] CHANGELOG: work on 3.7.0

---
 CHANGELOG.rst | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index bf649bbf3..968ffa5b2 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -1,7 +1,7 @@
 fish 3.7.0 (released ???)
 ====================================
 
-.. ignore: 3443 5319 7375 9500 9515 9528 9538 9565 9667 9681 9690 9692 9704 9706 9707 9713 9718 9719 9721 9722 9728 9732 9734 9738 9741 9742 9743 9753 9759 9776 9783 9799 9800 9804 9812 9825 9848 9850 9871 9875 9878 9880 9882 9899 9910 9914 9915 9919 9926 9932 9939 9943 9956 9960 9965 9970 9972 9975 9976 9977 9982 9983 9994 10007 10008 10011 10020 10023 10029 10038 10039 10051 10055 10059 10062 10073 10079 10081 10082 10084 10086 10089 10096 10097 10113
+.. ignore: 3443 5319 7375 9500 9515 9528 9538 9565 9667 9681 9690 9692 9704 9706 9707 9713 9718 9719 9721 9722 9728 9732 9734 9738 9741 9742 9743 9753 9759 9776 9783 9799 9800 9804 9812 9825 9841 9848 9850 9871 9875 9878 9880 9882 9899 9910 9914 9915 9919 9926 9932 9939 9943 9956 9960 9965 9970 9972 9975 9976 9977 9982 9983 9994 10007 10008 10011 10020 10023 10029 10038 10039 10051 10055 10059 10062 10073 10079 10081 10082 10084 10086 10089 10096 10097 10113 10120 10130 10133 10144 10147 10149 10150 10152 10163 10171
 
 Notable improvements and fixes
 ------------------------------
@@ -25,11 +25,12 @@ Scripting improvements
 Interactive improvements
 ------------------------
 - The :kbd:`Alt`\ +\ :kbd:`s` binding now also checks ``please`` in addition to ``sudo`` and ``doas``
-- The history pager will now also attempt subsequence matches (:issue:`9476`), so you can find a commandline like ``git log 3.6.1..Integration_3.7.0`` by searching for ``gitInt``.
+- The history pager will now also attempt subsequence matches (:issue:`9476`), so you can find a command line like ``git log 3.6.1..Integration_3.7.0`` by searching for ``gitInt``.
 - Closing the history pager with enter will now copy the search text to the commandline if there was no match, so you can continue editing the command you tried to find right away (:issue:`9934`).
 - Opening the history pager will now fill the search field with a search string if you're already in a search (:issue:`10005`). This makes it nicer to search something with :kbd:`↑` and then later decide to switch to the full pager.
 - ``read`` no longer enables bracketed paste so it doesn't stay enabled in combined commandlines like ``mysql -p(read --silent)`` (:issue:`8285`).
 - Vi mode now uses :envvar:`fish_cursor_external` to set the cursor shape for external commands (:issue:`4656`).
+- Opening the history search in Vi mode switches to insert mode correctly (:issue:`10141`).
 - Vi mode cursor shaping is now enabled in iTerm2 (:issue:`9698`).
 - Working directory reporting is enabled for iTerm2 (:issue:`9955`).
 - Completing commands as root includes commands not owned by root, fixing a regression introduced in fish 3.2.0 (:issue:`9699`).
@@ -48,7 +49,7 @@ Interactive improvements
 - The ``alias`` convenience function has better support for commands with unusual characters, like ``+`` (:issue:`8720`).
 - A longstanding issue where items in the pager would sometimes display without proper formatting has been fixed (:issue:`9617`).
 - The :kbd:`Alt` +\ :kbd:`l` binding, which lists the directory of the token under the cursor, correctly expands tilde (``~``) to the home directory (:issue:`9954`).
-- Various fish utilities that use an external pager will now try a selection of common pagers if the :envvar:`PAGER` environment variable is not set, or write the output to the screen without a pager if there is not one available (:issue:`10074`)
+- Various fish utilities that use an external pager will now try a selection of common pagers if the :envvar:`PAGER` environment variable is not set, or write the output to the screen without a pager if there is not one available (:issue:`10074`).
 - Command-specific tab completions may now offer results whose first character is a period. For example, it is now possible to tab-complete ``git add`` for files with leading periods. The default file completions hide these files, unless the token itself has a leading period (:issue:`3707`).
 
 Improved prompts
@@ -56,6 +57,7 @@ Improved prompts
 - The default theme now only uses named colors, so it will track the terminal's palette (:issue:`9913`).
 - The Dracula theme has now been synced with upstream (:issue:`9807`); use ``fish_config`` to re-apply it to pick up the changes.
 - ``fish_vcs_prompt`` now also supports fossil (:issue:`9497`).
+- Prompts which display the working directory using the ``prompt_pwd`` function correctly display directories beginning with dashes (:issue:`10169`).
 
 Completions
 ^^^^^^^^^^^
@@ -65,8 +67,10 @@ Completions
   - ``ar`` (:issue:`9720`)
   - ``blender`` (:issue:`9905`)
   - ``bws`` (:issue:`10165`)
+  - ``calendar`` (:issue:`10138`)
   - ``checkinstall`` (:issue:`10106`)
   - ``crc`` (:issue:`10034`)
+  - ``doctl``
   - ``gimp`` (:issue:`9904`)
   - ``gojq`` (:issue:`9740`)
   - ``horcrux`` (:issue:`9922`)
@@ -77,7 +81,9 @@ Completions
   - ``oc`` (:issue:`10034`)
   - ``qjs`` (:issue:`9723`)
   - ``qjsc`` (:issue:`9731`)
+  - ``rename`` (:issue:`10136`)
   - ``rpm-ostool`` (:issue:`9669`)
+  - ``smerge`` (:issue:`10135`)
   - ``userdel`` (:issue:`10056`)
   - ``watchexec`` (:issue:`10027`)
   - ``wpctl`` (:issue:`10043`)
@@ -86,6 +92,7 @@ Completions
 - The ``zfs`` completions no longer print errors about setting a read-only variable (:issue:`9705`).
 - The ``kitty`` completions have been removed in favor of keeping them upstream (:issue:`9750`).
 - ``git`` completions now support aliases that reference other aliases (:issue:`9992`).
+- The ``gw`` and ``gradlew`` completions are loaded properly (:issue:`10127`).
 - Improvements to many other completions.
 - Improvements to the manual page completion generator (:issue:`9787`, :issue:`9814`, :issue:`9961`).
 

From 58d1467fb767c46b1c242d09f5c375f3e9db25f6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Johannes=20St=C3=B6lp?= <johannes.stoelp@gmail.com>
Date: Sat, 18 Nov 2023 12:21:57 +0100
Subject: [PATCH 189/200] [doc]: fix --path description of set cmd

(cherry picked from commit 1cba28c120854edbb926138b5b99c28d7db38737)
---
 doc_src/cmds/set.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc_src/cmds/set.rst b/doc_src/cmds/set.rst
index d529b4d51..7f5f2afc2 100644
--- a/doc_src/cmds/set.rst
+++ b/doc_src/cmds/set.rst
@@ -63,7 +63,7 @@ These options modify how variables operate:
     Causes the specified shell variable to NOT be exported to child processes.
 
 **--path**
-    Treat specified variable as a :ref:`path variable <variables-path>`; variable will be split on colons (``:``) and will be displayed joined by colons colons when quoted (``echo "$PATH"``) or exported.
+    Treat specified variable as a :ref:`path variable <variables-path>`; variable will be split on colons (``:``) and will be displayed joined by colons when quoted (``echo "$PATH"``) or exported.
 
 **--unpath**
      Causes variable to no longer be treated as a :ref:`path variable <variables-path>`.

From 8a447355a2fcca2abd6c1cf057aee0267b1f27d7 Mon Sep 17 00:00:00 2001
From: David Adam <zanchey@ucc.gu.uwa.edu.au>
Date: Sun, 31 Dec 2023 22:37:18 +0800
Subject: [PATCH 190/200] CHANGELOG: work on 3.7.0

---
 CHANGELOG.rst | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index 968ffa5b2..85bc08095 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -1,10 +1,16 @@
 fish 3.7.0 (released ???)
 ====================================
 
-.. ignore: 3443 5319 7375 9500 9515 9528 9538 9565 9667 9681 9690 9692 9704 9706 9707 9713 9718 9719 9721 9722 9728 9732 9734 9738 9741 9742 9743 9753 9759 9776 9783 9799 9800 9804 9812 9825 9841 9848 9850 9871 9875 9878 9880 9882 9899 9910 9914 9915 9919 9926 9932 9939 9943 9956 9960 9965 9970 9972 9975 9976 9977 9982 9983 9994 10007 10008 10011 10020 10023 10029 10038 10039 10051 10055 10059 10062 10073 10079 10081 10082 10084 10086 10089 10096 10097 10113 10120 10130 10133 10144 10147 10149 10150 10152 10163 10171
+.. ignore: 3443 5319 7375 9500 9515 9528 9538 9565 9667 9681 9690 9692 9704 9706 9707 9713 9718 9719 9721 9722 9728 9732 9734 9738 9741 9742 9743 9753 9759 9776 9783 9799 9800 9804 9812 9825 9841 9848 9850 9871 9875 9878 9880 9882 9899 9910 9914 9915 9919 9926 9932 9939 9943 9956 9960 9965 9970 9972 9975 9976 9977 9982 9983 9994 10007 10008 10011 10020 10023 10029 10038 10039 10051 10055 10059 10062 10073 10079 10081 10082 10084 10086 10089 10096 10097 10107 10113 10120 10130 10133 10144 10147 10149 10150 10152 10163 10171 
+
+This release of fish includes a number of improvements over fish 3.6.4, detailed below. Although work continues on the porting of fish internals to the Rust programming language, that work is not included in this release.
 
 Notable improvements and fixes
 ------------------------------
+- Improvements to the history pager, including:
+  - The history pager will now also attempt subsequence matches (:issue:`9476`), so you can find a command line like ``git log 3.6.1..Integration_3.7.0`` by searching for ``gitInt``.
+  - Opening the history pager will now fill the search field with a search string if you're already in a search (:issue:`10005`). This makes it nicer to search something with :kbd:`↑` and then later decide to switch to the full pager.
+  - Closing the history pager with enter will now copy the search text to the commandline if there was no match, so you can continue editing the command you tried to find right away (:issue:`9934`).
 - Performance improvements for command completions and globbing, where supported by the operating system, especially on slow filesystems such as NFS (:issue:`9891`, :issue:`9931`, :issue:`10032`, :issue:`10052`).
 
 Deprecations and removed features
@@ -24,13 +30,10 @@ Scripting improvements
 
 Interactive improvements
 ------------------------
-- The :kbd:`Alt`\ +\ :kbd:`s` binding now also checks ``please`` in addition to ``sudo`` and ``doas``
-- The history pager will now also attempt subsequence matches (:issue:`9476`), so you can find a command line like ``git log 3.6.1..Integration_3.7.0`` by searching for ``gitInt``.
-- Closing the history pager with enter will now copy the search text to the commandline if there was no match, so you can continue editing the command you tried to find right away (:issue:`9934`).
-- Opening the history pager will now fill the search field with a search string if you're already in a search (:issue:`10005`). This makes it nicer to search something with :kbd:`↑` and then later decide to switch to the full pager.
+- The :kbd:`Alt`\ +\ :kbd:`s` binding now also checks ``please`` in addition to ``sudo`` and ``doas``.
 - ``read`` no longer enables bracketed paste so it doesn't stay enabled in combined commandlines like ``mysql -p(read --silent)`` (:issue:`8285`).
 - Vi mode now uses :envvar:`fish_cursor_external` to set the cursor shape for external commands (:issue:`4656`).
-- Opening the history search in Vi mode switches to insert mode correctly (:issue:`10141`).
+- Opening the history search in vi mode switches to insert mode correctly (:issue:`10141`).
 - Vi mode cursor shaping is now enabled in iTerm2 (:issue:`9698`).
 - Working directory reporting is enabled for iTerm2 (:issue:`9955`).
 - Completing commands as root includes commands not owned by root, fixing a regression introduced in fish 3.2.0 (:issue:`9699`).
@@ -106,6 +109,7 @@ Other improvements
 
 For distributors
 ----------------
+- The licensing information for some of the derived code distributed with fish was incomplete. Though the license information was present in the source distribution, it was not present in the documentation. This has been corrected (:issue:`10162`).
 - The CMake configure step will now also look for libterminfo as an alternative name for libtinfo, as used in NetBSD curses (:issue:`9794`).
 
 fish 3.6.4 (released December 5, 2023)

From 4c616c56b22af4b8f66bef173a129218d147dcda Mon Sep 17 00:00:00 2001
From: jydeng <jydeng@localhost.localdomain>
Date: Tue, 14 Nov 2023 16:09:53 +0800
Subject: [PATCH 191/200] add more subcommands for apt (#10100)

(cherry picked from commit b9b850f2868f9df2fde809c2b8bc2c854de15a46)
---
 share/completions/apt.fish | 32 ++++++++++++++++++++++++++++++--
 1 file changed, 30 insertions(+), 2 deletions(-)

diff --git a/share/completions/apt.fish b/share/completions/apt.fish
index 9a2d89c54..9a3443e8a 100644
--- a/share/completions/apt.fish
+++ b/share/completions/apt.fish
@@ -59,15 +59,24 @@ __fish_apt_option list -l all-versions -d 'Show all versions of any package'
 # Search
 __fish_apt_subcommand search -r -d 'Search for packages'
 
-# Search
+# Show
 __fish_apt_subcommand show -r -d 'Show package information'
 
+# Showsrc
+__fish_apt_subcommand showsrc -r -d 'Show source package information'
+
+# Source
+__fish_apt_subcommand source -r -d 'Download source package'
+
 # Install
 __fish_apt_subcommand install -r -d 'Install packages'
 __fish_apt_option install -l reinstall -d 'Reinstall package'
 
+# Reinstall
+__fish_apt_subcommand reinstall -r -d 'Reinstall packages'
+
 # Remove
-__fish_apt_subcommand remove -r -d 'Remove packages'
+__fish_apt_subcommand remove -x -d 'Remove packages'
 
 # Edit sources
 __fish_apt_subcommand edit-sources -d 'Edit sources list'
@@ -80,6 +89,7 @@ __fish_apt_subcommand upgrade -r -d 'Upgrade packages'
 
 # Full Upgrade
 __fish_apt_subcommand full-upgrade -r -d 'Upgrade packages, removing others when needed'
+__fish_apt_subcommand dist-upgrade -r -d 'Upgrade packages, removing others when needed'
 
 # Purge
 __fish_apt_subcommand purge -x -d 'Remove packages and delete their config files'
@@ -90,6 +100,15 @@ __fish_apt_subcommand changelog -r -d 'Download and display package changelog'
 # Autoremove
 __fish_apt_subcommand autoremove -d 'Remove packages no longer needed as dependencies'
 
+# Autoremove
+__fish_apt_subcommand autopurge -d 'Remove packages no longer needed as dependencies and delete their config files'
+
+# Clean
+__fish_apt_subcommand clean -d 'Remove downloaded packages from cache'
+
+# Autoclean
+__fish_apt_subcommand autoclean -d 'Remove obsolete packages from cache'
+
 # Policy
 __fish_apt_subcommand policy -x -d 'Display source or package priorities'
 
@@ -99,4 +118,13 @@ __fish_apt_subcommand depends -r -d 'List package dependencies'
 # Rdepends
 __fish_apt_subcommand rdepends -r -d 'List package reverse dependencies'
 
+# Download
+__fish_apt_subcommand download -x -d 'Download packages'
+
+# Build-dep
+__fish_apt_subcommand build-dep -x -d 'Install packages needed to build the given package'
+
+# Help
+__fish_apt_subcommand help -d 'Print help page'
+
 functions -e __fish_apt_subcommand __fish_apt_option

From 3b9b84101adb5d38f3291fb6aa8b89875bc5fece Mon Sep 17 00:00:00 2001
From: Fabian Boehm <FHomborg@gmail.com>
Date: Sun, 31 Dec 2023 19:36:42 +0100
Subject: [PATCH 192/200] umask: Correctly handle empty symbolic value

Simple return/echo confusion.

Fixes #10177

(cherry picked from commit b895cf49ca91329d8903e0f9aa2b0f64437c2608)
---
 share/functions/umask.fish | 3 ++-
 tests/checks/umask.fish    | 7 +++++++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/share/functions/umask.fish b/share/functions/umask.fish
index 779dc436c..9a946480c 100644
--- a/share/functions/umask.fish
+++ b/share/functions/umask.fish
@@ -39,7 +39,8 @@ set __fish_umask_set_table 6 5 4 3 2 1 0
 function __fish_umask_set
     set -l to_set $argv[1]
     if test $to_set -eq 0
-        return 7
+        echo 7
+        return
     end
     echo $__fish_umask_set_table[$to_set]
 end
diff --git a/tests/checks/umask.fish b/tests/checks/umask.fish
index 39e833999..6bc3f895f 100644
--- a/tests/checks/umask.fish
+++ b/tests/checks/umask.fish
@@ -89,3 +89,10 @@ umask
 umask -S
 #CHECK: 0222
 #CHECK: u=rx,g=rx,o=rx
+
+umask u=rwx,g=rwx,o=
+umask
+#CHECK: 0007
+umask u=rwx,g=,o=rwx
+umask
+#CHECK: 0070

From 5c532ace5a2e871e53987eb5fdb98a45912e86d7 Mon Sep 17 00:00:00 2001
From: Fabian Boehm <FHomborg@gmail.com>
Date: Sun, 31 Dec 2023 19:40:18 +0100
Subject: [PATCH 193/200] CHANGELOG umask fix

---
 CHANGELOG.rst | 1 +
 1 file changed, 1 insertion(+)

diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index 85bc08095..d1d818d74 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -27,6 +27,7 @@ Scripting improvements
 - The ``builtin`` builtin will now properly error out with invalid arguments instead of doing nothing and returning true (:issue:`9942`).
 - ``command time`` in a pipeline is allowed again, as is ``command and`` and ``command or`` (:issue:`9985`).
 - ``exec`` will now also apply variable overrides, so ``FOO=bar exec`` will now set ``$FOO`` correctly (:issue:`9995`).
+- ``umask`` will now handle empty symbolic modes correctly, like ``umask u=,g=rwx,o=`` (:issue:`10177`).
 
 Interactive improvements
 ------------------------

From d6833edf5496c45c48cc1dd6d29a4fc84a1962c9 Mon Sep 17 00:00:00 2001
From: Fabian Boehm <FHomborg@gmail.com>
Date: Mon, 1 Jan 2024 00:14:26 +0100
Subject: [PATCH 194/200] CHANGELOG

---
 CHANGELOG.rst | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index d1d818d74..1b46268d2 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -3,7 +3,7 @@ fish 3.7.0 (released ???)
 
 .. ignore: 3443 5319 7375 9500 9515 9528 9538 9565 9667 9681 9690 9692 9704 9706 9707 9713 9718 9719 9721 9722 9728 9732 9734 9738 9741 9742 9743 9753 9759 9776 9783 9799 9800 9804 9812 9825 9841 9848 9850 9871 9875 9878 9880 9882 9899 9910 9914 9915 9919 9926 9932 9939 9943 9956 9960 9965 9970 9972 9975 9976 9977 9982 9983 9994 10007 10008 10011 10020 10023 10029 10038 10039 10051 10055 10059 10062 10073 10079 10081 10082 10084 10086 10089 10096 10097 10107 10113 10120 10130 10133 10144 10147 10149 10150 10152 10163 10171 
 
-This release of fish includes a number of improvements over fish 3.6.4, detailed below. Although work continues on the porting of fish internals to the Rust programming language, that work is not included in this release.
+This release of fish includes a number of improvements over fish 3.6.4, detailed below. Although work continues on the porting of fish internals to the Rust programming language, that work is not included in this release. This release includes some of the improvements that accrued during the porting work, but is still 100% C++, and any possible future releases in the 3.7.x track will remain C++.
 
 Notable improvements and fixes
 ------------------------------
@@ -12,11 +12,13 @@ Notable improvements and fixes
   - Opening the history pager will now fill the search field with a search string if you're already in a search (:issue:`10005`). This makes it nicer to search something with :kbd:`↑` and then later decide to switch to the full pager.
   - Closing the history pager with enter will now copy the search text to the commandline if there was no match, so you can continue editing the command you tried to find right away (:issue:`9934`).
 - Performance improvements for command completions and globbing, where supported by the operating system, especially on slow filesystems such as NFS (:issue:`9891`, :issue:`9931`, :issue:`10032`, :issue:`10052`).
+- fish can now be configured to wait a specified amount of time for a multi-key sequence to be completed,  instead of waiting indefinitely. For example, this makes binding ``kj`` to switching modes in vi mode possible.
+  The timeout can be set via the new :envvar:`fish_sequence_key_delay_ms` (:issue:`7401`), and may be set by default in future versions.
 
 Deprecations and removed features
 ---------------------------------
 - ``LS_COLORS`` is no longer set automatically by the ``ls`` function (:issue:`10080`). Users
-  that set ``.dircolors`` should manually import it using other means.
+  that set ``.dircolors`` should manually import it using other means. Typically this would be ``set -gx LS_COLORS (dircolors -c .dircolors | string split ' ')[3]``
 
 Scripting improvements
 ----------------------
@@ -28,6 +30,7 @@ Scripting improvements
 - ``command time`` in a pipeline is allowed again, as is ``command and`` and ``command or`` (:issue:`9985`).
 - ``exec`` will now also apply variable overrides, so ``FOO=bar exec`` will now set ``$FOO`` correctly (:issue:`9995`).
 - ``umask`` will now handle empty symbolic modes correctly, like ``umask u=,g=rwx,o=`` (:issue:`10177`).
+- Improved error messages for errors occurring in command substitutions (:issue:`10054`).
 
 Interactive improvements
 ------------------------
@@ -44,8 +47,6 @@ Interactive improvements
 - Command completion will now call the stock ``manpath`` on macOS, instead of a potential Homebrew version. This prevents awkward error messages (:issue:`9817`).
 - A new bind function ``history-pager-delete``, bound to :kbd:``Shift`` + :kbd:``Delete`` by default, will delete the currently-selected history pager item from history (:issue:`9454`).
 - ``fish_key_reader`` will now use printable characters as-is, so pressing "ö" no longer leads to it telling you to bind ``\u00F6`` (:issue:`9986`).
-- fish can now be configured to wait a specified amount of time for a multi-key sequence to be completed,  instead of waiting indefinitely. For example, this makes binding ``kj`` to switching modes in vi mode possible.
-  The timeout can be set via the new :envvar:`fish_sequence_key_delay_ms` (:issue:`7401`), and may be set by default in future versions.
 - ``open`` can be used to launch terminal programs again, as an ``xdg-open`` bug has been fixed and a workaround has been removed  (:issue:`10045`).
 - The ``repaint-mode`` binding will now only move the cursor if there is repainting to be done. This fixes :kbd:`Alt` combination bindings in vi mode (:issue:`7910`).
 - A new ``clear-screen`` bind function is used for :kbd:`Ctrl`\ +\ :kbd:`l` by default. This clears the screen and repaints the existing prompt at first,
@@ -105,7 +106,6 @@ Other improvements
 - Improvements and corrections to the documentation.
 - The Web-based configuration now uses a more readable style when printed, such as for a keybinding reference (:issue:`9828`).
 - Updates to the German translations (:issue:`9824`).
-- Improved error messages for errors occurring in command substitutions (:issue:`10054`).
 - The colors of the Nord theme better match their official style (:issue:`10168`).
 
 For distributors

From be0ea9862c60cf67581516c46e32f8f5f9253f45 Mon Sep 17 00:00:00 2001
From: David Adam <zanchey@ucc.gu.uwa.edu.au>
Date: Mon, 1 Jan 2024 22:01:45 +0800
Subject: [PATCH 195/200] CHANGELOG: work on 3.7.0

---
 CHANGELOG.rst | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index 1b46268d2..aaedccc83 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -3,14 +3,16 @@ fish 3.7.0 (released ???)
 
 .. ignore: 3443 5319 7375 9500 9515 9528 9538 9565 9667 9681 9690 9692 9704 9706 9707 9713 9718 9719 9721 9722 9728 9732 9734 9738 9741 9742 9743 9753 9759 9776 9783 9799 9800 9804 9812 9825 9841 9848 9850 9871 9875 9878 9880 9882 9899 9910 9914 9915 9919 9926 9932 9939 9943 9956 9960 9965 9970 9972 9975 9976 9977 9982 9983 9994 10007 10008 10011 10020 10023 10029 10038 10039 10051 10055 10059 10062 10073 10079 10081 10082 10084 10086 10089 10096 10097 10107 10113 10120 10130 10133 10144 10147 10149 10150 10152 10163 10171 
 
-This release of fish includes a number of improvements over fish 3.6.4, detailed below. Although work continues on the porting of fish internals to the Rust programming language, that work is not included in this release. This release includes some of the improvements that accrued during the porting work, but is still 100% C++, and any possible future releases in the 3.7.x track will remain C++.
+This release of fish includes a number of improvements over fish 3.6.4, detailed below. Although work continues on the porting of fish internals to the Rust programming language, that work is not included in this release. fish 3.7.0 and any future releases in the 3.7 series remain C++ programs.
 
 Notable improvements and fixes
 ------------------------------
 - Improvements to the history pager, including:
+
   - The history pager will now also attempt subsequence matches (:issue:`9476`), so you can find a command line like ``git log 3.6.1..Integration_3.7.0`` by searching for ``gitInt``.
   - Opening the history pager will now fill the search field with a search string if you're already in a search (:issue:`10005`). This makes it nicer to search something with :kbd:`↑` and then later decide to switch to the full pager.
   - Closing the history pager with enter will now copy the search text to the commandline if there was no match, so you can continue editing the command you tried to find right away (:issue:`9934`).
+
 - Performance improvements for command completions and globbing, where supported by the operating system, especially on slow filesystems such as NFS (:issue:`9891`, :issue:`9931`, :issue:`10032`, :issue:`10052`).
 - fish can now be configured to wait a specified amount of time for a multi-key sequence to be completed,  instead of waiting indefinitely. For example, this makes binding ``kj`` to switching modes in vi mode possible.
   The timeout can be set via the new :envvar:`fish_sequence_key_delay_ms` (:issue:`7401`), and may be set by default in future versions.
@@ -34,7 +36,6 @@ Scripting improvements
 
 Interactive improvements
 ------------------------
-- The :kbd:`Alt`\ +\ :kbd:`s` binding now also checks ``please`` in addition to ``sudo`` and ``doas``.
 - ``read`` no longer enables bracketed paste so it doesn't stay enabled in combined commandlines like ``mysql -p(read --silent)`` (:issue:`8285`).
 - Vi mode now uses :envvar:`fish_cursor_external` to set the cursor shape for external commands (:issue:`4656`).
 - Opening the history search in vi mode switches to insert mode correctly (:issue:`10141`).
@@ -45,15 +46,15 @@ Interactive improvements
 - The completion pager will no longer sometimes skip the last entry when moving through a long list (:issue:`9833`).
 - The interactive ``history delete`` interface now allows specifying index ranges like "1..5" (:issue:`9736`), and ``history delete --exact`` now properly saves the history (:issue:`10066`).
 - Command completion will now call the stock ``manpath`` on macOS, instead of a potential Homebrew version. This prevents awkward error messages (:issue:`9817`).
-- A new bind function ``history-pager-delete``, bound to :kbd:``Shift`` + :kbd:``Delete`` by default, will delete the currently-selected history pager item from history (:issue:`9454`).
+- A new bind function ``history-pager-delete``, bound to :kbd:`Shift` + :kbd:`Delete` by default, will delete the currently-selected history pager item from history (:issue:`9454`).
 - ``fish_key_reader`` will now use printable characters as-is, so pressing "ö" no longer leads to it telling you to bind ``\u00F6`` (:issue:`9986`).
 - ``open`` can be used to launch terminal programs again, as an ``xdg-open`` bug has been fixed and a workaround has been removed  (:issue:`10045`).
 - The ``repaint-mode`` binding will now only move the cursor if there is repainting to be done. This fixes :kbd:`Alt` combination bindings in vi mode (:issue:`7910`).
-- A new ``clear-screen`` bind function is used for :kbd:`Ctrl`\ +\ :kbd:`l` by default. This clears the screen and repaints the existing prompt at first,
+- A new ``clear-screen`` bind function is used for :kbd:`Ctrl` + :kbd:`l` by default. This clears the screen and repaints the existing prompt at first,
   so it eliminates visible flicker unless the terminal is very slow (:issue:`10044`).
 - The ``alias`` convenience function has better support for commands with unusual characters, like ``+`` (:issue:`8720`).
 - A longstanding issue where items in the pager would sometimes display without proper formatting has been fixed (:issue:`9617`).
-- The :kbd:`Alt` +\ :kbd:`l` binding, which lists the directory of the token under the cursor, correctly expands tilde (``~``) to the home directory (:issue:`9954`).
+- The :kbd:`Alt` + :kbd:`l` binding, which lists the directory of the token under the cursor, correctly expands tilde (``~``) to the home directory (:issue:`9954`).
 - Various fish utilities that use an external pager will now try a selection of common pagers if the :envvar:`PAGER` environment variable is not set, or write the output to the screen without a pager if there is not one available (:issue:`10074`).
 - Command-specific tab completions may now offer results whose first character is a period. For example, it is now possible to tab-complete ``git add`` for files with leading periods. The default file completions hide these files, unless the token itself has a leading period (:issue:`3707`).
 
@@ -67,6 +68,7 @@ Improved prompts
 Completions
 ^^^^^^^^^^^
 - Added completions for:
+
   - ``age`` and ``age-keygen`` (:issue:`9813`)
   - ``airmon-ng`` (:issue:`10116`)
   - ``ar`` (:issue:`9720`)
@@ -94,6 +96,7 @@ Completions
   - ``wpctl`` (:issue:`10043`)
   - ``xxd`` (:issue:`10137`)
   - ``zabbix`` (:issue:`9647`)
+
 - The ``zfs`` completions no longer print errors about setting a read-only variable (:issue:`9705`).
 - The ``kitty`` completions have been removed in favor of keeping them upstream (:issue:`9750`).
 - ``git`` completions now support aliases that reference other aliases (:issue:`9992`).
@@ -113,6 +116,8 @@ For distributors
 - The licensing information for some of the derived code distributed with fish was incomplete. Though the license information was present in the source distribution, it was not present in the documentation. This has been corrected (:issue:`10162`).
 - The CMake configure step will now also look for libterminfo as an alternative name for libtinfo, as used in NetBSD curses (:issue:`9794`).
 
+----
+
 fish 3.6.4 (released December 5, 2023)
 ======================================
 
@@ -192,6 +197,7 @@ Improved prompts
 Completions
 ^^^^^^^^^^^
 - Added completions for:
+
   - ``apkanalyzer`` (:issue:`9558`)
   - ``neovim`` (:issue:`9543`)
   - ``otool``
@@ -201,6 +207,7 @@ Completions
   - ``stow`` (:issue:`9571`)
   - ``trash`` and helper utilities ``trash-empty``, ``trash-list``, ``trash-put``, ``trash-restore`` (:issue:`9560`)
   - ``ssh-copy-id`` (:issue:`9675`)
+
 - Improvements to many completions, including the speed of completing directories in WSL 2 (:issue:`9574`).
 - Completions using ``__fish_complete_suffix`` are now offered in the correct order, fixing a regression in 3.6.0 (:issue:`8924`).
 - ``git`` completions for ``git-foo``-style commands was restored, fixing a regression in 3.6.0 (:issue:`9457`).

From 20d36cd9a22bf28c6945b7bec837ad02835fce8d Mon Sep 17 00:00:00 2001
From: Fabian Boehm <FHomborg@gmail.com>
Date: Mon, 1 Jan 2024 15:11:43 +0100
Subject: [PATCH 196/200] set: Remove a broken array read

Hardcode "--erase" as a hack, because "argv[-1]" is *not* a thing.

Introduced in aacc71e58520309027fd39e30038e6c42bdc9a2f.

Fixed in master by no longer being C++.
---
 src/builtins/set.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/builtins/set.cpp b/src/builtins/set.cpp
index 9417b884d..4257c90a5 100644
--- a/src/builtins/set.cpp
+++ b/src/builtins/set.cpp
@@ -244,7 +244,7 @@ static int validate_cmd_opts(const wchar_t *cmd, const set_cmd_opts_t &opts, int
     }
 
     if (argc == 0 && opts.erase) {
-        streams.err.append_format(BUILTIN_ERR_MISSING, cmd, argv[-1]);
+        streams.err.append_format(BUILTIN_ERR_MISSING, cmd, L"--erase");
         builtin_print_error_trailer(parser, streams.err, cmd);
         return STATUS_INVALID_ARGS;
     }

From 0e4d088b116f8455ed604be117ea78831b2cdfc5 Mon Sep 17 00:00:00 2001
From: David Adam <zanchey@ucc.gu.uwa.edu.au>
Date: Mon, 1 Jan 2024 22:48:20 +0800
Subject: [PATCH 197/200] Release 3.7.0

---
 CHANGELOG.rst | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index aaedccc83..2e6114104 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -1,7 +1,5 @@
-fish 3.7.0 (released ???)
-====================================
-
-.. ignore: 3443 5319 7375 9500 9515 9528 9538 9565 9667 9681 9690 9692 9704 9706 9707 9713 9718 9719 9721 9722 9728 9732 9734 9738 9741 9742 9743 9753 9759 9776 9783 9799 9800 9804 9812 9825 9841 9848 9850 9871 9875 9878 9880 9882 9899 9910 9914 9915 9919 9926 9932 9939 9943 9956 9960 9965 9970 9972 9975 9976 9977 9982 9983 9994 10007 10008 10011 10020 10023 10029 10038 10039 10051 10055 10059 10062 10073 10079 10081 10082 10084 10086 10089 10096 10097 10107 10113 10120 10130 10133 10144 10147 10149 10150 10152 10163 10171 
+fish 3.7.0 (released January 1, 2024)
+=====================================
 
 This release of fish includes a number of improvements over fish 3.6.4, detailed below. Although work continues on the porting of fish internals to the Rust programming language, that work is not included in this release. fish 3.7.0 and any future releases in the 3.7 series remain C++ programs.
 
@@ -15,7 +13,7 @@ Notable improvements and fixes
 
 - Performance improvements for command completions and globbing, where supported by the operating system, especially on slow filesystems such as NFS (:issue:`9891`, :issue:`9931`, :issue:`10032`, :issue:`10052`).
 - fish can now be configured to wait a specified amount of time for a multi-key sequence to be completed,  instead of waiting indefinitely. For example, this makes binding ``kj`` to switching modes in vi mode possible.
-  The timeout can be set via the new :envvar:`fish_sequence_key_delay_ms` (:issue:`7401`), and may be set by default in future versions.
+  The timeout can be set via the new :envvar:`fish_sequence_key_delay_ms` variable (:issue:`7401`), and may be set by default in future versions.
 
 Deprecations and removed features
 ---------------------------------

From b91723dab6888d25f6b959859289f2aed719992c Mon Sep 17 00:00:00 2001
From: Asger Hautop Drewsen <asger@tyilo.com>
Date: Wed, 3 Jan 2024 16:17:49 +0100
Subject: [PATCH 198/200] Log original exit code used when a builtin returns a
 negative exit code

---
 src/builtin.cpp                | 2 +-
 tests/checks/status-value.fish | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/builtin.cpp b/src/builtin.cpp
index 6ec0119c5..eda602d34 100644
--- a/src/builtin.cpp
+++ b/src/builtin.cpp
@@ -475,13 +475,13 @@ proc_status_t builtin_run(parser_t &parser, const wcstring_list_t &argv, io_stre
             return proc_status_t::empty();
         }
         if (code < 0) {
+            FLOGF(warning, "builtin %ls returned invalid exit code %d", cmdname.c_str(), code);
             // If the code is below 0, constructing a proc_status_t
             // would assert() out, which is a terrible failure mode
             // So instead, what we do is we get a positive code,
             // and we avoid 0.
             code = abs((256 + code) % 256);
             if (code == 0) code = 255;
-            FLOGF(warning, "builtin %ls returned invalid exit code %d", cmdname.c_str(), code);
         }
         return proc_status_t::from_exit_code(code);
     }
diff --git a/tests/checks/status-value.fish b/tests/checks/status-value.fish
index 9c9452130..ce02a45ad 100644
--- a/tests/checks/status-value.fish
+++ b/tests/checks/status-value.fish
@@ -26,22 +26,22 @@ echo $status
 # CHECKERR:      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~^
 
 $fish -c 'exit -5'
-# CHECKERR: warning: builtin exit returned invalid exit code 251
+# CHECKERR: warning: builtin exit returned invalid exit code -5
 echo $status
 # CHECK: 251
 
 $fish -c 'exit -1'
-# CHECKERR: warning: builtin exit returned invalid exit code 255
+# CHECKERR: warning: builtin exit returned invalid exit code -1
 echo $status
 # CHECK: 255
 
 # (we avoid 0, so this is turned into 255 again)
 $fish -c 'exit -256'
-# CHECKERR: warning: builtin exit returned invalid exit code 255
+# CHECKERR: warning: builtin exit returned invalid exit code -256
 echo $status
 # CHECK: 255
 
 $fish -c 'exit -512'
-# CHECKERR: warning: builtin exit returned invalid exit code 255
+# CHECKERR: warning: builtin exit returned invalid exit code -512
 echo $status
 # CHECK: 255

From 001f797f805901a1a85334b34da903432a007c51 Mon Sep 17 00:00:00 2001
From: ksyx <18738953+ksyx@users.noreply.github.com>
Date: Mon, 8 Jan 2024 18:31:52 -0500
Subject: [PATCH 199/200] fix: crash when running ELF w/ interpreter missing

The function `stat` as defined in `include/x86_64-linux-gnu/sys/stat.h`
marks its arguments as nonnull as in below. This UB causes crash in
release builds with variable `interpreter` assumed to be nonnull. Along
with failing stat returning nonzero value, this ultimately causes
`strlen` to be called with NULL as argument.

Definition of `stat`:
```
extern int stat (const char *__restrict __file,
		 struct stat *__restrict __buf) __THROW __nonnull ((1, 2));
```
Reproduce:
```
> # interp.c is any vaild single file C source
> gcc ./interp.c -Wl,--dynamic-linker=/bad -o interp
> echo './interp' > in.txt
> ./fish < in.txt
'./fish < in.txt' terminated by signal SIGSEGV (Address boundary error)
```

Co-authored-by: Moody Liu <mooodyhunter@outlook.com>
---
 src/postfork.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/postfork.cpp b/src/postfork.cpp
index a2884eb33..c56b9e610 100644
--- a/src/postfork.cpp
+++ b/src/postfork.cpp
@@ -463,7 +463,7 @@ void safe_report_exec_error(int err, const char *actual_cmd, const char *const *
             const char *interpreter =
                 get_interpreter(actual_cmd, interpreter_buff, sizeof interpreter_buff);
             struct stat buf;
-            auto statret = stat(interpreter, &buf);
+            auto statret = !interpreter || stat(interpreter, &buf);
             if (interpreter && (0 != statret || access(interpreter, X_OK))) {
                 // Detect Windows line endings and complain specifically about them.
                 auto len = strlen(interpreter);

From c31e194120b36360864511c341e368408cd300c2 Mon Sep 17 00:00:00 2001
From: Fabian Boehm <FHomborg@gmail.com>
Date: Tue, 9 Jan 2024 18:56:36 +0100
Subject: [PATCH 200/200] Revert "wildcard: Remove useless access() call for
 trailing slash"

This reverts commit 6823f5e3374f00f43e9d20a4db12d63e0bc5da84.

Fixes #10205
---
 src/wildcard.cpp           | 7 +++++--
 tests/checks/wildcard.fish | 4 ++++
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/wildcard.cpp b/src/wildcard.cpp
index 2683cfa1b..2c012637d 100644
--- a/src/wildcard.cpp
+++ b/src/wildcard.cpp
@@ -646,8 +646,11 @@ void wildcard_expander_t::expand_trailing_slash(const wcstring &base_dir, const
     }
 
     if (!(flags & expand_flag::for_completions)) {
-        // Trailing slash and not accepting incomplete, e.g. `echo /xyz/`. Insert this file, we already know it exists!
-        this->add_expansion_result(wcstring{base_dir});
+        // Trailing slash and not accepting incomplete, e.g. `echo /xyz/`. Insert this file if it
+        // exists.
+        if (waccess(base_dir, F_OK) == 0) {
+            this->add_expansion_result(wcstring{base_dir});
+        }
     } else {
         // Trailing slashes and accepting incomplete, e.g. `echo /xyz/<tab>`. Everything is added.
         dir_iter_t dir = open_dir(base_dir);
diff --git a/tests/checks/wildcard.fish b/tests/checks/wildcard.fish
index 189d6dff7..03f28aa81 100644
--- a/tests/checks/wildcard.fish
+++ b/tests/checks/wildcard.fish
@@ -11,6 +11,10 @@ touch ./b/file.txt
 
 set dirs ./a ./b
 echo $dirs/*.txt # CHECK: ./b/file.txt
+echo */foo/
+# CHECKERR: checks/wildcard.fish (line {{\d+}}): No matches for wildcard '*/foo/'. See `help wildcards-globbing`.
+# CHECKERR: echo */foo/
+# CHECKERR:      ^~~~~^
 
 cd $oldpwd
 rm -Rf $dir