lint.fish receives arguments that contain multiple includes and defines.
As a result, we passed arguments like
"-I/usr/include -I$HOME/fish-shell/build -I/usr/include"
to cppcheck which interprets this as a single include directory.
This leads to errors like this one (because the "build" dir was missing):
src/common.h:4:0: information: Include file: "config.h" not found. [missingInclude]
Prior to this change, a glob like `**/file.txt` would only match
`file.txt` in subdirectories; the `**` must match at least one directory.
This is historical behavior.
With this change we move a little closer to bash's implementation by
allowing a literal `**` segment to match in the current directory. That
is, `**/foo` will match both `foo` and `bar/foo`, while `b**/foo` will
only match `bar/foo`.
Fixes#7222.
Before running a command, or before importing a command from bash history,
we perform error checking. As part of error checking we expand commands
including variables and globs. If the glob is very large, like `/**`, then
we could hang expanding it.
One fix would be to limit the amount of expansion from the glob, but
instead let's just not expand command globs when performing error checking.
Fixes#7407
If the user types something like `/**`, prior to this change we would
attempt to expand it in the background for both highlighting and
autosuggestions. This could thrash your disk and also consume a lot of
memory.
Add a a field to operation_context_t to allow specifying a limit, and add
a "default background" limit of 512 items.
Historically fish has not supported tab completing or autosuggesting
wildcards with **. Prior to this fix, we would test every file match,
discover the ** wildcard, and then ignore it. Instead look for **
wildcards at the top level.
This prevents autosuggesting with /** from chewing up your disk.
Of note: The rpm/yum thing seems to be coupled, so I put it into one
function that tries the yum helper and uses the rpm path otherwise.
Zypper is already its own thing, so this should only be used for yum
and probably dnf (does that still have the helper?)
Zypper can be dropped, as that already used a separate function in the file.
Apk can just be inlined - it's literally one line for installed and another for all packages.
This function doesn't make any sense.
Most things that expect package names expect package names for *one
specific package manager*.
It only happens to work, most of the time, because most people only
have one package manager installed.
When a completion's "--arguments" script ran, it would clobber $status with its value,
so when you repainted your prompt, it would now show the completion
script's status rather than the status of what you last ran.
Solve this by just storing the status and restoring it - other places
do this by calling exec_subshell with apply_exit_status set to false,
which does basically the same thing. We can't use it here because we
don't want to run a "full" script, we only want the arguments to be
expanded, without a "real" command.
No, I have no idea how to test this automatically.
Fixes#7555.