During our one-time migration away from universal variables,
we create ~/.config/fish/conf.d/fish_frozen_theme.fish
if we think that the current theme is different from the default.
The default uvar-backed theme had changed over time, but existing
installations would not be upgraded. Because of this, we have
a heuristic that assumes that values coinciding with historical
default values also stem from a default. Some historical values are
missing. Add them.
There are more left, see 03b23dd1b6 (Update default colors,
2022-01-27).
Fixes#12725
In non-interactive shells we only ever use our simple command-not-found
handler; the fancy ones are only intended for interactive shells, see
537ab32dd9 (Add support for the Ubuntu 'command-no-found' handler,
which suggests a package to install in order to get a command.,
2008-01-15).
I'm not sure if this behavior difference is really a good idea,
but I guess we can avoid rocking the boat for now.
Make the implementation less surprising by moving it into the obvious
file. No behavior change intended.
We no longer emit the "fish_command_not_found" event ourselves,
so the event handlers are only useful to users who
1. run "emit fish_command_not_found"
2. copy the definition of "fish_command_not_found" to their config and run
that with fish < 3.2.
Probably no one does 1; there are no matches in
https://github.com/search?utf8=%E2%9C%93&q=%22emit+fish_command_not_found%22+language%3Afish&type=code
Reason 2 is less relevant after 5 years.
For additional evidence, none of our specializations
("/usr/libexec/pk-command-not-found" etc.) react to the event,
and no one has ever complained.
Stop registering any fish_command_not_found as event handler,
for consistency and simplicity.
While at it, remove the documentation on how to make it work for
version < 3.2.
If a user passes "-i" when running a script, they ought to expect
weird behavior i.e. fish might run the user's interactive-only
configuration which might print things to TTY etc. But at least
for our part of the configuration, we can avoid depending on the
user-settable interactive bit.
__fish_config_interactive is already only called when we paint the
first prompt, either for a prompt (which implies we're an interactive
shell) or for builtin read (which does not imply anything about the
interactivity of the shell).
Only print greetings when not in interactive read. Notably, "status
is-interactive-read" is not overridable by the user.
This helps us get rid of more "status is-interactive" switches.
The "if status is-interactive" was added by ae593decfc (Replace
__fish_git_branch_prompt.fish with __fish_git_prompt.fish, 2012-06-20)
presumably to avoid repaints in noninteractive cases. The repaints
have been removed in 76457bdc4e (fish_git_prompt: Remove repaint
from variable handlers, 2021-03-04) so this is no longer necessary.
There is already a GitHub workflow doing lint checks so it is redundant
and wastes time (4+ min).
Moreover, other platforms do not do it, so when it fails, it gives
the appearance that there is a Windows specific build issue beyond
linting.
Closes#12740
On Cygwin, check.sh was running all the tests twice, one with symlinks
enabled, and one without. But most tests do no use symlinks so
re-running those does not test anything new and it's just a major waste
of resources and time (and cygwin is quite slow already).
So only re-run the tests that use symlinks, i.e. that use `ln`.
Filter on mentions of `ln` and not `cygwin_nosymlink` because the latter
is only needed when a test would fail in one of the two scenarios, and
not all tests with symlinks do.
Completions, functions, tools, and various ancillary files have been
shipped within the fish binary for some time. We don't need two copies
in packages, plus some of them are never read from the filesystem.
Commit e2b18fc5b6 (config.fish: don't load default theme in
noninteractive shells, 2026-04-28) broke webconfig: since "fish_config
theme choose default" was removed from non-interactive shells,
webconfig won't know the current theme in interactive shells.
Fix this by adding secret knob that allows webconfig to have
noninteractive fish set the same colors as interactive fish again.
This assumes that plugins won't need the knob, i.e. won't need to
know the "current" theme.
Alternatively, webconfig could run "fish -i" but that could cause
issues if an "if status is-interactive" block in user-config does
something naughty such as writing to stdout even if it's not a terminal.
Alternatively, we could do
fish -c '
if test -z "$(__fish_theme_variables)"
fish_config theme choose default
end
# can dump current theme now
'
but that does not feel as reliable (what if the user explicitly does
"set -e" on all color variables or).
Fixes#12717
Prior to this commit, running
> cargo +nightly bench --features benchmark --no-run
Reports:
warning: feature `test` is declared but not used
--> src/lib.rs:1:58
|
1 | #![cfg_attr(all(nightly, feature = "benchmark"), feature(test))]
| ^^^^
|
= note: `#[warn(unused_features)]` (part of `#[warn(unused)]`) on by default
Which is a false positive. Allow unused features in this cfg_attr.
This command
cd $(mktemp -d)
mkdir a "a b"
complete -C": "
prints
a b/
a/
which is wrong ordering.
Usually the trailing slash should not be compared.
Fix this by always sorting slashes first. Not sure if this is correct
for middle slashes but I couldn't find a case where it matters.
Closes#12695