Commit Graph

22722 Commits

Author SHA1 Message Date
xtqqczze
86c052b6ba fix non_upper_case_globals lint
Closes #12648
2026-04-19 17:37:41 +08:00
xtqqczze
68472da48a highlight: derive Display trait for HighlightRole
Closes #12645
2026-04-19 17:14:42 +08:00
Daniel D. Beck
4b172fc735 set_color: document output more prominently
Issue: https://github.com/fish-shell/fish-shell/issues/2378

Closes #12644
2026-04-19 17:14:42 +08:00
Nahor
944ab91fab tests: various fixes for Cygwin itself and ACL mounts
Most notably:
- Unlike MSYS, Cygwin seems to always properly handle symlinks (at least
in common scenarios)
- With ACL, "x" permission also requires "r" do to anything, be it files
or directories

Closes #12642
2026-04-19 17:09:36 +08:00
Johannes Altmanninger
34535fcb61 tests/checks/disown: fix signal delivery race
Intermittent test failure suggests that kill(3p) returns before the
signal is delivered.  Fix the failure by waiting until the signal
has been delivered before continuing the test.

Fixes #12635
2026-04-19 17:07:39 +08:00
Johannes Altmanninger
9e4eb37696 complete: remove stale comment
Commit a4b6348315 (clippy: fix collapsible_match lint, 2026-04-18) made
it so '$' characters are handled here, which contradicts the comment.
Remove it.
2026-04-19 15:55:13 +08:00
Johannes Altmanninger
dda76d7f18 Update to Rust 1.95 2026-04-19 15:53:36 +08:00
Johannes Altmanninger
fdb1d95521 updatecli.d/rust.yml: fix staleness check when using rustup 1.29 2026-04-19 15:53:08 +08:00
xtqqczze
937f3bc6cb Update to Rust 1.94 2026-04-19 00:17:30 +00:00
Daniel Rainer
ebc32adc09 clippy: fix map_unwrap_or lint
https://rust-lang.github.io/rust-clippy/rust-1.95.0/index.html#map_unwrap_or
2026-04-18 23:27:51 +00:00
xtqqczze
a4b6348315 clippy: fix collapsible_match lint
https://rust-lang.github.io/rust-clippy/rust-1.95.0/index.html#collapsible_match
2026-04-18 23:16:34 +00:00
xtqqczze
b21a4a7197 benchmark: fix unresolved import error
```rust
error[E0432]: unresolved import `crate::common::bytes2wcstring`
   --> src/common.rs:714:9
    |
714 |     use crate::common::bytes2wcstring;
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `bytes2wcstring` in `common`
```
2026-04-18 21:28:15 +00:00
xtqqczze
0cd227533f highlight: implement Display trait for HighlightRole 2026-04-17 20:27:24 -07:00
Johannes Altmanninger
5eb7687a64 tests/checks/tmux-complete4.fish: fix for macOS sed 2026-04-17 03:22:56 +08:00
Johannes Altmanninger
8d6426295e complete: automatically resolve REPLACES_TOKEN flag
This flag is implied by matches that require replacements.  Reflect that
in the Completion::new, reducing the number of places where we raise the
flag.  This slightly simplifies tasks like proving the parent commit.

There are other scenarios (e.g. wildcards) where we currently set
the flag additionally.
2026-04-17 01:31:29 +08:00
Johannes Altmanninger
85e76ba356 Fix option substr completions not being filtered out
Commit 3546ffa3ef (reader handle_completions(): remove dead filtering code,
2026-01-02) gives a proof of correctness that still makes sense;
The first lemma ("if will_replace_token") is trivially true, so no need to
assert it.
The second lemma ("if !will_replace_token") is violated in some edge cases:
we claim that given a token "-c", the option completion "--clip" is an exact match,
which is not true, it's a substring match.

Fix that, asserting the claim.
2026-04-17 01:31:29 +08:00
Johannes Altmanninger
fee4288122 complete: reuse string fuzzy match when completing ~$USER
If we get to this code path, we'll only get completions for user
names, so technically the full StringFuzzyMatch with its ranking of
samecase/smartcase/icase (only showing the best) might be overkill,
but it seems like a good idea to treat this the same way as other
completions.

The occasion for this commit is to correct a wrong
StringFuzzyMatch::exact_match() in the icase branch; which will be
important for a following commit.  Add a test for that.
2026-04-17 01:28:54 +08:00
Johannes Altmanninger
413246a93d reader handle_completions(): move loop-invariant code 2026-04-17 01:28:02 +08:00
Daniel Rainer
3cb939c9a8 fix: actually run without symlinks
The old behavior seems to have been introduced inadvertently:
https://github.com/fish-shell/fish-shell/pull/12636#issuecomment-4254328105

Closes #12636
2026-04-16 15:10:15 +08:00
Daniel Rainer
4790a444d8 lint: disable incorrect warning about unused fn
`cleanup` is used via `trap`.

Part of #12636
2026-04-16 15:10:15 +08:00
Daniel Rainer
da924927a0 cleanup: split up assignment and export
This prevents hiding failures of the `rustc` command.

Part of #12636
2026-04-16 15:10:15 +08:00
Daniel Rainer
29ff2fdd43 lint: disable warning about variable export
Here, we want `"$@"` to be expanded, since its components are the
arguments we want to pass to `export`.

Part of #12636
2026-04-16 15:10:14 +08:00
Daniel Rainer
732c04420b lint: disable warnings about desired behavior
We deliberately create subshells for the export in these cases, so we
don't want warnings about it.

Part of #12636
2026-04-16 15:10:14 +08:00
Daniel Rainer
947abd7464 cleanup: quote shell variables
This is not a functional change, since the variable names don't have
spaces, but it is more robust to changes and removes ShellCheck warnings

Part of #12636
2026-04-16 15:10:14 +08:00
Daniel Rainer
12cfe59578 fix: don't use echo -e in POSIX shell
The `-e` flag is not defined for `echo` in POSIX shell. Use `printf`
instead.

Part of #12636
2026-04-16 15:10:13 +08:00
Daniel Rainer
4b60d18b44 cleanup: remove unused variable
Part of #12636
2026-04-16 15:10:13 +08:00
Daniel Rainer
dd8e59db03 fix: check if system_tests args are empty
When `system_tests` is called without arguments, `[ -n "$@" ]` becomes
`[ -n ]`, which is true, resulting in running `export`, which lists all
exported variables, unnecessarily cluttering the output.
If `system_tests` is called with more than one argument, the check would
fail because having more than one argument after `-n` is invalid syntax.
Fix this by using `$*`, which concatenates all positional arguments to
`system_tests` into a single value.

Part of #12636
2026-04-16 15:10:13 +08:00
Johannes Altmanninger
47a3757f73 update changelog 2026-04-14 16:56:43 +08:00
Johannes Altmanninger
f278c29733 key: address "non_upper_case_globals" lint on named key constants 2026-04-14 16:56:43 +08:00
Peter Ammon
2bab8b5830 prompt_pwd: strip control characters
If a directory has a control sequence in it, then prompt_pwd (used in
the default prompt) would emit it to the console, which could cause
the terminal to interpret the escape sequence.

Strip control sequences from within prompt_pwd, in the same way as
we do in __fish_paste.fish, to sanitize it.

Closes #12629
2026-04-14 16:56:43 +08:00
Johannes Altmanninger
1dac221684 doc terminal_compatibility: tab title is OSC 1 2026-04-14 16:56:43 +08:00
David Adam
8dbbe71bc6 disable Linux development builds for now
I'll add the rest of the infrastructure later.
2026-04-13 21:12:51 +08:00
David Adam
d9d9eced98 workflow: build development builds on master branch 2026-04-12 21:11:26 +08:00
David Adam
64a829f0df add workflow to create development build source packages 2026-04-12 18:50:56 +08:00
Nahor
440e7fcbc1 Fix failing system tests on Cygwin
The main changes are:
- disabling some checks related to POSIX file permissions when a filesystem is
mounted with "noacl" (default on MSYS2)
- disabling some checks related to symlinks when using fake ones (file copy)

Windows with acl hasn't been tested because 1) Cygwin itself does not have any
Rust package yet to compile fish, and 2) MSYS2 defaults to `noacl`

Part of #12171
2026-04-11 18:55:00 +08:00
Nahor
52495c8124 tests: make realpath tests easier to debug
- Use the different strings for different checks to more easily narrow down
where a failure happens
- Move CHECK comments outside a `if...else...end` to avoid giving the impression
that the check only runs in the `if` case.

Part of #12171
2026-04-11 18:44:22 +08:00
Vishrut Sachan
467b03d715 git completions: prioritize recent commits for rebase --interactive
Fixes #12537

Closes #12619
2026-04-11 18:33:05 +08:00
Johannes Altmanninger
b5c40478f6 Fix typo, closes #12586, closes #12577 2026-04-11 18:33:05 +08:00
Johannes Altmanninger
1286745e78 Remove bits for async-signal-safety of old SIGTERM handler
This is implied by the parent commit.

To enable this, stop trying to run cleanup in panic handlers if we
panic on a background thread.
2026-04-11 18:25:26 +08:00
Yakov Till
b99ae291d6 Save history on SIGTERM and SIGHUP before exit
Previously, SIGTERM immediately re-raised with SIG_DFL, killing
fish without saving history. SIGHUP deferred via a flag but never
re-raised, so the parent saw a normal exit instead of signal death.

Unify both signals: the handler stores the signal number in a single
AtomicI32, the reader loop exits normally, throwing_main() saves
history and re-raises with SIG_DFL so the parent sees WIFSIGNALED.

Fixes #10300

Closes #12615
2026-04-11 18:06:02 +08:00
Daniel Rainer
8ae71c80f4 refactor: extract string escape and unescape funcs
Move the functions for escaping and unescaping strings from
`src/common.rs` into `fish_common`. It might make sense to move them
into a dedicated crate at some point, but for now just move them to the
preexisting crate to unblock other extraction.

Closes #12625
2026-04-11 17:49:50 +08:00
Daniel Rainer
cf6170200c refactor: move const to fish_widestring
Another step to eliminate dependency cycles between `src/expand.rs` and
`src/common.rs`.

Part of #12625
2026-04-11 17:49:49 +08:00
Daniel Rainer
c13038b968 refactor: move move char consts to widestring
This time, move char constants from `src/expand.rs` to
`fish_widestring`, which resolves a dependency cycle between
`src/expand.rs` and `src/common.rs`.

Part of #12625
2026-04-11 17:49:48 +08:00
Daniel Rainer
816077281d refactor: move encoding functions to widestring
The decoding functions for our widestrings are already in the
`fish_widestring` crate, so by symmetry, it makes sense to put the
encoding functions there as well. This also makes it easier to depend on
these functions, giving more options when it comes to further code
extraction.

Part of #12625
2026-04-11 17:49:47 +08:00
Daniel Rainer
78ea24a262 refactor: move char definitions into widestring
Use `fish_widestring` as the place where char definitions live. This has
the advantage that all our code can depend on `fish_widestring` without
introducing dependency cycles. Having a common place for character
definitions also makes it easier to see which chars have a special
meaning assigned to them.

This change also unblocks some follow-up refactoring by removing a
dependency cycle between `src/common.rs` and `src/wildcard.rs`.

Part of #12625
2026-04-11 17:49:46 +08:00
Daniel Rainer
6a5b9bcde1 refactor: move PUA-decoding function to widestring
These functions don't depend on `wcstringutil` functionality, so there
is no need for them to be there. The advantage of putting them into our
`widestring` crate is that quite a lot of code depends on it, and
extracting some of that code would result in crate dependency cycles if
the functions stayed in the `wcstringutil` crate. Our `widestring` crate
does not depend on any of our other crates, so there won't be any cyclic
dependency issues with code in it.

Part of #12625
2026-04-11 17:49:45 +08:00
Daniel Rainer
b7b786aabf cleanup: move escape_string_with_quote
It makes a lot more sense to have this function in the same module as
the other escaping functions. There was no usage of this function in
`parse_util` except for the test, so it makes little sense to keep the
function there. Moving it also eliminates a pointless cyclic dependency
between `common` and `parse_util`.

Part of #12625
2026-04-11 17:49:43 +08:00
Daniel Rainer
dc63b7bb20 cleanup: don't export write_loop twice
Exporting it as both `safe_write_loop` and `write_loop` is redundant and
causes inconsistencies. Remove the `pub use` and use `write_loop` for
the function name. It is shorter, and in Rust the default assumption is
that code is safe unless otherwise indicated, so there is no need to be
explicit about it.

Part of #12625
2026-04-11 17:49:42 +08:00
Daniel Rainer
9c819c020e refactor: don't reexport fish_common in common
Not reexporting means that imports have to change to directly import
from `fish_common`. This makes it easier to see which dependencies on
`src/common.rs` actually remain, which helps with identifying candidates
for extraction.

While at it, group some imports.

Part of #12625
2026-04-11 17:49:41 +08:00
Daniel Rainer
dc9b1141c8 refactor: extract fish_reserved_codepoint
Part of #12625
2026-04-11 17:49:40 +08:00