Commit Graph

22010 Commits

Author SHA1 Message Date
Johannes Altmanninger
f1f14cc8fa input: extract function for enqueuing query response 2025-12-14 16:29:14 +01:00
Johannes Altmanninger
707bfe3ce6 fish_config theme show: list default scheme first
Webconfig does the same ("Add the current scheme first, then the
default.").
2025-12-14 16:29:14 +01:00
Johannes Altmanninger
d8f1a2a24f Move sample_prompts/themes to share/
They are used by "fish_config" CLI too, so no need to make them
private to webconfig.  Putting them at top-level seems simpler overall.
2025-12-14 16:29:14 +01:00
Johannes Altmanninger
dbdecaba6d fish_config: remove hardcoded set of colors to erase
This is incomplete, and we'll solve the problem differently. For now,
leave colors that are not mentioned in the theme.  This causes problems
for sparse themes, but a following commit will fix that by making
"fish_config theme choose" erase all variables set by a previous
invocation (but not erase variables set by the user).  Only webconfig
won't do that since it (historically) uses copy semantics, but we
could change that too if needed.

This also breaks the guarantee mentioned by this comment in webconfig:

> Ensure that we have all the color names we know about, so that if the
> user deletes one he can still set it again via the web interface

which should be fine because:
1. a following commit will always set all globals at interactive init,
   so colors should only be missing in edge cases ("fish -c fish_config").
2. it's easy to recover from by setting a default theme.
2025-12-14 16:26:14 +01:00
Johannes Altmanninger
66f6493fbf fish_config theme dump: speed up
For better or worse, "set -L" prints all of $history, which makes
"fish_config theme show" very slow.  Fix this by only printing the
relevant variables.  While at, make the escaping function use the
shared subset of fish and POSIX shell quoting syntax, to allow a
following commit to use shlex.split().
2025-12-14 16:25:14 +01:00
Johannes Altmanninger
76e0f9a3e8 fish_config: extract function for iterating over themes 2025-12-14 16:24:13 +01:00
Johannes Altmanninger
697afdefeb fish_config: extract some functions for reading theme files
A following commit wants to add some more logic and call some of
fish_config's private APIs from webconfig.  We could keep it all in
one file but I'm not sure we should so try the splitting we usually do.
2025-12-14 16:23:53 +01:00
Johannes Altmanninger
aba89f9088 docs: one sentence per line 2025-12-14 16:23:37 +01:00
Johannes Altmanninger
344187e01a fish_config: extract function 2025-12-14 16:23:37 +01:00
Johannes Altmanninger
9f11de24d4 webconfig.py: remove dead code 2025-12-14 16:23:37 +01:00
Johannes Altmanninger
7996637db5 Make fish immediately show color changes again
Historically, fish tried to re-exec the prompt and repaint immediately
when a color variable changed.

Commit f5c6306bde (Do not repaint prompt on universal variable events,
but add event handler for fish_color_cwd, 2006-05-11) restricted this
to only variables used in the prompt like "fish_color_cwd".

Commit 0c9a1a56c2 (Lots of work on web config Change to make fish
immediately show color changes, 2012-03-25) added repainting back
for all colors (except for pager colors).

Commit ff62d172e5 (Stop repainting in C++, 2020-12-11) undid that.

Finally, 69c71052ef (Remove __fish_repaint, 2021-03-04) removed the
--on-variable repaint handlers added by the first commit.

So if color changes via either
1. webconfig
2. an event handler reacting to the terminal switching between light/dark mode
3. a binding etc.

then we fail to redraw. Affects both colors used in prompts and those
not used in prompts.

Fix that by adding back the hack from the second commit.  This is
particularly important for case 2, to be added by a following commit.

In future we can remove this hack by making "--on-variable" take
a wildcard.
2025-12-14 16:23:37 +01:00
Johannes Altmanninger
d67cdf5f6f Update changelog 2025-12-14 16:23:37 +01:00
Johannes Altmanninger
7dd2004da7 Re-enable focus reporting on non-tmux
I can no longer reproduce the issue described in bdd478bbd0 (Disable
focus reporting on non-tmux again for now, 2024-04-18).  Maybe the
TTY handoff changes fixed this.  Let's remove this workaround and
enable focus reporting everywhere.
2025-12-14 16:23:37 +01:00
Johannes Altmanninger
4000503c03 DRY DSR sequences a bit 2025-12-14 16:23:37 +01:00
Johannes Altmanninger
7c994cd784 fish_config: extract some functions for finding theme variables etc.
To be used in a following commit.
2025-12-14 16:23:37 +01:00
Johannes Altmanninger
e68ea35f02 fish_config: improve consistency
The theme variable filter applies to whole lines, so it's weird to
only apply it to the first token, and we don't do that elsewhere.
2025-12-14 16:21:16 +01:00
Johannes Altmanninger
5cc953b18d Default theme variants specialized for light/dark mode
Start by converting the "default" theme's colors to RGB, using
XTerm colors since they are simple, see
https://en.wikipedia.org/wiki/ANSI_escape_code#3-bit_and_4-bit.

Then make the following changes:

for both default-light and default-dark:
- Reinstate fish_color_command/fish_color_keyword as blue since one
  of the reasons in 81ff6db62d (default color scheme: Make commands
  "normal" color, 2024-10-02) doesn't hold anymore.
- bravely replace "fish_pager_color_selected_background -r" with
  something that hopefully matches better.
  Note we can't trivially use the fallback to
  "fish_color_search_match", since for unknown reasons,
  "fish_pager_color_selected_background" is only for background and
  the others are for foreground.

for default-light:
- brgreen (00ff00) looks bad on light background, so replace it with green (00cd00).
  This means that we no longer use two different shades of green in the default theme
  (which helps address the "fruit salad" mentioned 81ff6db62d).
- yellow (cdcd00) looks bad on light background, make it darker (a0a000)
- fish_pager_color_progress's --background=cyan (00cdcd) seems a bit too bright, make it darker
  - same for other uses of cyan (also for consistency)
  - this means fish_color_operator / fish_color_escape can use 00cdcd I guess.
for default-dark:
- use bright green (00ff00) for all greens
- use bright blue (5c5cff) instead of regular blue for command/keyword
- make autosuggestions a bit lighter (9f9f9f instead of 7f7f7f) 
- etc.. I think I made the two themes mostly symmetrical.

Part of #11580
2025-12-14 16:21:16 +01:00
Johannes Altmanninger
f264ee0b10 webconfig theme: rename "fish-default" theme
The "fish-" prefix is not needed here and it would add more noise to
a following commit which adds default-{dark,light} variants that use
24 bit RGB colors.
2025-12-14 15:44:58 +01:00
Johannes Altmanninger
3c6978c038 webconfig theme: minor changes to default theme
Don't set fish_pager_color_completion,
it already falls back to fish_color_normal.

Also remove a comment, it's obvious and maybe no longer
true, since 8 bit colors are widely available now, see
https://github.com/fish-shell/fish-shell/issues/11344#issuecomment-3568265178

Though we prefer 24 bit colors wherever we can.
2025-12-14 15:44:58 +01:00
Johannes Altmanninger
d5732b132e webconfig themes: consistent quoting 2025-12-14 15:44:58 +01:00
Johannes Altmanninger
ae22cc93db webconfig themes: shell-friendly filenames
For historical reasons (namely the webconfig origin), our theme
names contain spaces and uppercase letters which can be inconvenient
when using the "fish_config theme choose" shell command.  Use more
conventional file names.

Web config still uses the pretty names, using the ubiquitous "# name:"
property.
2025-12-14 15:44:58 +01:00
Johannes Altmanninger
51e551fe5f doc/fish_config: fix copy-paste errors 2025-12-14 15:44:58 +01:00
Johannes Altmanninger
33cb8679ba fish_config theme show: remove unused argument 2025-12-14 15:44:58 +01:00
Johannes Altmanninger
655b1aa7a1 fish_prompt: remove stray initialization of fish_color_status
I can't reproduce the problem mentioned in 0420901cb2 (default prompt:
Set fish_color_status if unset, 2021-04-11).
2025-12-14 15:44:58 +01:00
Johannes Altmanninger
daba5fdbcd fish_delta: acknowledge workaround for no-stdin-in-cmdsub 2025-12-14 15:44:58 +01:00
Johannes Altmanninger
01bd380d00 webconfig.py: reuse "fish_config theme dump" 2025-12-14 15:44:58 +01:00
Johannes Altmanninger
801c4f8158 webconfig.py: simplify "functions" output parsing
This outputs one-item-per-line if stdout is a terminal.
2025-12-14 15:44:58 +01:00
Johannes Altmanninger
e331e30e38 __fish_config_interactive: minor style change 2025-12-14 15:44:58 +01:00
Johannes Altmanninger
7bd30ac3c4 __fish_config_interactive: inline function 2025-12-14 15:44:58 +01:00
Johannes Altmanninger
5631a7ec86 Fix color variable filter regex 2025-12-14 15:44:58 +01:00
Johannes Altmanninger
a9c43e7396 webconfig js: remove redundant code clone
The server side (webconfig.py) will already reset missing colors
to empty.
2025-12-14 15:44:58 +01:00
Johannes Altmanninger
2a6c0e4437 webconfig js: remove obsolete workaround
I cannot reproduce.
2025-12-14 15:44:58 +01:00
Johannes Altmanninger
7f224d0dfd DRY color variable names 2025-12-14 15:42:56 +01:00
Johannes Altmanninger
f818002f38 webconfig.py: use full color names
Optimize for ease of maintenance.
2025-12-14 15:42:56 +01:00
Johannes Altmanninger
6b8e82946a webconfig.py: remove dead code
Both descriptions for bindings and color variables are unused.
2025-12-14 15:42:56 +01:00
Johannes Altmanninger
faaff2754b webconfig.py: fix stale return type
This function returns a heterogeneous list (containing dicts/lists)
by accident. Fix that and reduce code duplication.  Fixes c018bfdb4d
(Initial work to add support for angularjs, 2013-08-17).
2025-12-14 15:42:12 +01:00
Johannes Altmanninger
5c0e72bb89 webconfig.py: simplify 2025-12-14 15:40:03 +01:00
Johannes Altmanninger
b3b7d2cb00 webconfig js: remove debug log statement 2025-12-14 15:40:03 +01:00
Johannes Altmanninger
f503dcb92d webconfig js: resolve a comment 2025-12-14 15:37:46 +01:00
Johannes Altmanninger
7f1b53a9f1 webconfig.py: remove a workaround for Python 2 2025-12-14 15:37:46 +01:00
Johannes Altmanninger
938e780007 fish_config theme save: remove dead code 2025-12-14 15:37:46 +01:00
Johannes Altmanninger
3e7c5ae399 __fish_config_interactive: make config file initialization independent of uvars
Helps the following commits.
2025-12-14 15:37:46 +01:00
Johannes Altmanninger
548f37eabb Simplify make_tarball.sh
Note that we don't need to set the mtime anymore -- it was added in
5b5b53872c (tarball generation: include config.h.in, set mode and
ownership, 2013-09-09) for autotools' multi-stage builds.
2025-12-14 15:37:46 +01:00
Johannes Altmanninger
135fc73191 Remove man/HTML docs from tarball, require Sphinx instead
Advantages of prebuilt docs:
- convenient for users who compile the tarball
- convenient for packagers who don't have sphinx-build packaged
  (but packaging/installing that should be easy nowadays?
  see https://github.com/fish-shell/fish-shell/issues/12052#issuecomment-3520336984)

Disadvantages:
- Extra build stage / code path
- Users who switch from building from tarball to building from source
  might be surprised to lose docs.
- People put the [tarballs into Git repositories](https://salsa.debian.org/debian/fish), which seems weird.

Remove the tarball.

Let's hope this is not too annoying to users who build on outdated
distros that don't have sphinx -- but those users can probably use
our static builds, skipping all compilation.

To avoid breaking packagers who use `-DBUILD_DOCS=OFF` (which still
installs prebuilt docs), rename the option.

Closes #12088
2025-12-14 15:37:46 +01:00
Johannes Altmanninger
1fe5497b5d Remove redundant saving of TTY flags
The logic added by 2dbaf10c36 (Also refresh TTY timestamps
after external commands from bindings, 2024-10-21) is obsoleted
by TtyHandoff.  That module is also responsible for calling
reader_save_screen_state after it writes to the TTY, so we don't
actually need to check if it wrote anything.
2025-12-14 15:37:46 +01:00
Johannes Altmanninger
6b85450dea Silence error log for legacy escape specifically
This happens after pressing escape while kitty keyboard protocol is
disabled (or not supported).
2025-12-14 15:37:46 +01:00
Johannes Altmanninger
2309c27a2d Replace ifdef with cfg! 2025-12-14 10:24:49 +01:00
exploide
8b5d66def8 completions: added arp-scan
Closes #12158
2025-12-14 08:44:08 +01:00
xtqqczze
27852a6734 fix: clippy::ptr_as_ptr
https://rust-lang.github.io/rust-clippy/master/index.html#ptr_as_ptr

Closes #12136
2025-12-11 17:46:58 +01:00
xtqqczze
cc29216ea9 fix: clippy::ptr_cast_constness
https://rust-lang.github.io/rust-clippy/master/index.html#ptr_cast_constness

Part of #12136
2025-12-11 17:46:58 +01:00