Commit Graph

21562 Commits

Author SHA1 Message Date
Johannes Altmanninger
28e8f45828 fish_config theme choose: correct error message for standalone builds 2025-10-15 12:00:24 +02:00
Johannes Altmanninger
ac8ef4da9e fish_config: don't redo __fish_bin_dir computation
__fish_bin_dir is already computed exactly like this.
2025-10-15 12:00:24 +02:00
Johannes Altmanninger
52241712b4 fish_vi_key_bindings: hack to prevent error when overriding fish_vi_cursor
As discovered in https://matrix.to/#/!YLTeaulxSDauOOxBoR:matrix.org/$BFAjMPXBA9UczLT8h-7XpiyGUDv0Cz5g6ijbgdEVl_w
2025-10-15 12:00:24 +02:00
Johannes Altmanninger
584a21b34b tests/fish_config theme {choose,save} 2025-10-15 12:00:24 +02:00
Johannes Altmanninger
b82920dc26 fish_delta: share logic between standalone and installed builds 2025-10-15 12:00:24 +02:00
Johannes Altmanninger
ea69133e48 tests/fish_delta 2025-10-15 12:00:24 +02:00
Johannes Altmanninger
f72ebca1e4 fish_delta: fix spurious output in standalone builds 2025-10-15 12:00:24 +02:00
Johannes Altmanninger
40d772fde3 share: share logic between standalone and installed builds 2025-10-15 12:00:24 +02:00
Johannes Altmanninger
d4837f9ef1 fish_config prompt choose: reset mode prompt and load it like right prompt
Fixes #11937
2025-10-15 12:00:24 +02:00
Alan Wu
b44209e14e Nim sample prompt: Don't print replace_one mode twice
Previously, it showed `[R]` twice when  `fish_bind_mode` is `replace_one`:

```console
┬─[user@hostname:~]─[00:00:01 PM][R]
─[R]
╰─>$ 
```

Closes #11942
2025-10-15 12:00:24 +02:00
Johannes Altmanninger
531269bb84 fish_config theme {choose,save}: share logic between standalone and installed builds 2025-10-15 12:00:24 +02:00
Johannes Altmanninger
80faf5e805 fish_config theme show: load fish_config's internal functions too
To be used in the next commit.
The comment seems incorrect.
2025-10-15 12:00:24 +02:00
Johannes Altmanninger
0d5fd181be tests/fish_config: share logic between standalone and installed builds 2025-10-15 12:00:24 +02:00
Johannes Altmanninger
8c279b854d fish_config theme {choose,save}: explode color list
Easier to cross-reference and update this way.
2025-10-15 12:00:24 +02:00
Johannes Altmanninger
f1f95c6867 fish_config theme {choose,save}: use early return 2025-10-15 12:00:24 +02:00
Johannes Altmanninger
ecedd8caed fish_config theme: share logic between standalone and installed mode 2025-10-15 12:00:24 +02:00
Johannes Altmanninger
ce5b5ec053 fish_config prompt {choose,save}: delete code clone
The "choose" one did not define fish_prompt unconditionally but that
looks like a bug.
2025-10-15 12:00:24 +02:00
Johannes Altmanninger
37e0a5ae8d fish_config prompt save: don't define right prompt unnecessarily
If no "fish_right_prompt" is defined, then we also don't need to
define and save an empty one.  We can do nothing, which seems cleaner.
It's also what "fish_config prompt choose" does.  Git blame shows no
explicit reason for for this inconsistency.

Probably the implicit reason is that when both styles where introduced
(both in 69074c1591 (fish_config: Remove right prompt in `choose` and
`save`, 2021-09-26)), that was before the "fish_config prompt choose:
make right prompt hack less weird" commit, so the "prompt choose"
code path didn't know whether the prompt existed until after checking,
hence "--erase" was more suitable.. but that inconsistency is gone.
2025-10-15 12:00:24 +02:00
Johannes Altmanninger
5792df9738 fish_config prompt: share logic between standalone and installed mode 2025-10-15 12:00:24 +02:00
Johannes Altmanninger
73f0e14d90 tests/fish_config {prompt,theme} list 2025-10-15 12:00:24 +02:00
Johannes Altmanninger
a216cfdd2f fish_{config,update_completions}: extract function for standalone builds 2025-10-15 12:00:24 +02:00
Johannes Altmanninger
fad0e39cfa tests/fish_update_completions: simple system test 2025-10-15 12:00:24 +02:00
Johannes Altmanninger
4532fc0c1b builtin status: sort list-files, like globs
This is important for deterministic behavior across both standalone
and installed builds in "fish_config prompt list".

I later realized that we could use "path sort" I suppose, but why
not fix the problem for everyone.
2025-10-15 12:00:24 +02:00
Johannes Altmanninger
03d21edd63 builtin status list-files: extract loop 2025-10-15 12:00:24 +02:00
Johannes Altmanninger
f72b833e38 fish_config theme save: reset prompts in standalone builds too 2025-10-15 12:00:24 +02:00
Johannes Altmanninger
45a3f4f1d6 fish_config prompt {choose,save}: remove dead code
Introduced by dd0d45f88f (fish_config prompt: remove dead code,
2025-09-28).
2025-10-15 12:00:24 +02:00
Johannes Altmanninger
3aab119e5b fish_config prompt save: extract loop 2025-10-15 12:00:24 +02:00
Johannes Altmanninger
0a1ca206fa fish_config prompt save: use early return 2025-10-15 12:00:24 +02:00
Johannes Altmanninger
028e05fff1 fish_config prompt choose: improve right prompt hack
Rather than first sourcing the prompt, and then erasing the right
prompt unless the prompt file defined the right prompt, start by
erasing the right prompt.  This is simpler (needs no conditional).
2025-10-15 12:00:24 +02:00
Johannes Altmanninger
dabd956216 fish_config prompt show: make indentation more helpful 2025-10-15 12:00:24 +02:00
Johannes Altmanninger
441f90fb55 __fish_data_list_files: fix for installed builds
This is only used in test code where bad output is ignored.
To be tested by a following commit.
2025-10-15 12:00:24 +02:00
Johannes Altmanninger
3b52d3db42 tests/fish_config prompt {choose,save} 2025-10-14 20:38:17 +02:00
Johannes Altmanninger
39943a8406 tests/fish_config: sort 2025-10-14 12:37:26 +02:00
Johannes Altmanninger
48bdf24964 __fish_data_with_file: better variable name 2025-10-14 12:37:26 +02:00
Johannes Altmanninger
fed2714e30 Rename abstraction for standalone/installed data files 2025-10-14 12:02:08 +02:00
Peter Ammon
c8262929e1 Restore statfs instead of statvfs behavior
MNT_LOCAL is NOT a flag for statvfs on macOS or possibly other BSDs
(except NetBSD which does not have statfs). Revert to statfs on other
platforms.
2025-10-13 14:15:05 -07:00
Peter Ammon
0ded3ed6f9 Rework ulimit constants
Use a macro to reduce the size of these modules.
2025-10-13 13:05:36 -07:00
Peter Ammon
2b428fae38 Fix remaining BSD build issues
Now building on FreeBSD / OpenBSD / NetBSD / DragonflyBSD
2025-10-13 11:16:48 -07:00
Johannes Altmanninger
b07adb532a chsh docs: look up fish in $PATH instead of /usr/local/bin
Now that the « chsh -s $(command -v) » approach should work both
in and outside fish, it seems like we should use that.

Non-macOS users probably shouldn't do this, but there's already a
big warning above this section.

Fixes #11931
2025-10-13 14:03:36 +02:00
Johannes Altmanninger
af72d4aebc Upgrade libc crate for _CS_PATH 2025-10-13 14:03:36 +02:00
Johannes Altmanninger
bfab595379 tests/checks/fish_config: try to work around intermittent CI failure
This is mysteriously failing intermittently on GitHub Actions CI
and OBS.  We get

  The CHECK on line 31 wants:
    {{\\x1b\\[m}}{{\\x1b\\[4m}}fish default{{\\x1b\\[m}}
  which failed to match line stdout:21:
    \x1b[38;2;7;114;161m/bright/vixens\x1b[m \x1b[38;2;34;94;121mjump\x1b[m \x1b[38;2;99;175;208m|\x1b[m \x1b[m\x1b[4mfish default\x1b[m

and it doesn't look like it's produced by the "grep -A1" below,
because the later output looks correct.

See https://github.com/fish-shell/fish-shell/pull/11923#discussion_r2417592216
2025-10-13 14:03:35 +02:00
Peter Ammon
d72adc0124 Add some vagrantfiles for building on BSDs
This only builds, doesn't run tests. Use:

    ./build_fish_on_bsd.sh dragonflybsd_6_4 freebsd_14_0 netbsd_9_3 openbsd_7_4

To build on all of them.

Note they don't all build yet.
2025-10-12 19:00:59 -07:00
Johannes Altmanninger
5f0d83d2f2 cirrus: remove "file" dependency from focal-arm64 builds
Probably that was also part of --install-recommends.
fish requires "file", but system tests don't.
2025-10-12 07:17:48 +02:00
Johannes Altmanninger
03f54171c6 cirrus: delete commented configurations 2025-10-12 07:17:48 +02:00
Johannes Altmanninger
f391b4a179 docker: add back CMake for the images used in Cirrus
build_tools/check.sh would give more coverage (the translation
checks is the main difference) but it tests embed-data builds;
for now testing, traditionally installed builds is more important
(especially since I always test check.sh locally already). In future
we will probably make embedding mandatory and get rid of this schism.
2025-10-12 07:17:48 +02:00
Johannes Altmanninger
8db674b6b5 docker: fix SSL error
Cirrus builds fail with

	error: failed to get `pcre2` as a dependency of package `fish v4.1.0-snapshot (/tmp/cirrus-ci-build)`
	...
	Caused by:
	  the SSL certificate is invalid; class=Ssl (16); code=Certificate (-17)

Likely introduced by b644fdbb04 (docker: do not install recommended
packages on Ubuntu, 2025-10-06).  Some Ubuntu Dockerfiles already
install ca-certificates explicitly but others do not. Fix the latter.
2025-10-12 07:17:48 +02:00
Johannes Altmanninger
f03113d048 __fish_cache_put: fix for BusyBox stat
On alpine, tests/checks/check-completions fails with

	stat: can't read file system information for '%u:%g': No such file or directory
2025-10-12 07:17:48 +02:00
Johannes Altmanninger
6c48e214ca tests/checks/check-completions: fix for embed-data builds 2025-10-12 07:17:48 +02:00
Johannes Altmanninger
189a2e90dd __fish_print_commands: remove code clone
Also, use it for help completions also on embed-data builds.
2025-10-12 07:11:35 +02:00
Johannes Altmanninger
9b44138917 __fish_print_commands: fix environment variable injection 2025-10-12 07:08:24 +02:00