Commit Graph

22814 Commits

Author SHA1 Message Date
Remo Senekowitsch
7c53bded3a completions/chezmoi: add upstream completions
Part of #12723
2026-05-07 17:52:00 +02:00
Remo Senekowitsch
163f25d516 completions/niri: add upstream completions
Part of #12723
2026-05-07 17:51:44 +02:00
Remo Senekowitsch
d8e73d2263 completions/just: use upstream completions
Closes #12722
2026-05-07 17:51:21 +02:00
Johannes Altmanninger
fb29c85a62 start new cycle
Created by ./build_tools/release.sh 4.7.0
2026-05-06 14:51:33 +08:00
Johannes Altmanninger
e071de3b68 Release 4.7.0
Created by ./build_tools/release.sh 4.7.0
4.7.0
2026-05-05 15:24:27 +08:00
Nahor
ed6fe3f315 tmux-history-search2: fix test on WSL or in console sessions
Those two do not use the "return symbol"

Closes #12704
2026-05-05 14:57:42 +08:00
Nahor
4f539dffaf cd: fix path when trying to cd out of the root directory
Part of #12704
2026-05-05 14:57:42 +08:00
Remo Senekowitsch
d885e0efd7 completions/date: add rfc-3339 option
Closes #12703
2026-05-05 14:57:23 +08:00
Johannes Altmanninger
330e897acc Update changelog 2026-05-05 14:55:56 +08:00
Peter Ammon
b638aa198f Make the tmux-history-search2.fish test pass reliably on macOS 2026-05-03 19:50:26 -07:00
Peter Ammon
fd44c23678 Suppress an annoying warning on nightly
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.
2026-05-03 18:03:37 -07:00
David Adam
f84179f8fe RPM/Debian packaging: add pkg-config dependency
This is required by the pcre2 crate to find the system PCRE2 library.
2026-05-03 23:05:03 +08:00
Johannes Altmanninger
71d6ec4ab9 wcsfilecmp: make sure trailing slashes sort first
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
2026-05-03 20:04:21 +08:00
Johannes Altmanninger
683e4c8d15 wcsfilecmp: extract function, use shadowing 2026-05-03 20:04:21 +08:00
xtqqczze
d7cc3c7bb6 format: use 2-space indents in toml files
Closes #12699
2026-05-03 20:04:21 +08:00
Johannes Altmanninger
9370830733 Make profiling API a bit harder to misuse 2026-05-03 20:03:46 +08:00
Johannes Altmanninger
161f31f42b run_1_job: remove code clone for profiling 2026-05-03 20:03:46 +08:00
Johannes Altmanninger
5998421410 Remove obsolete Send/Sync impls for ParsedSource 2026-05-03 20:03:46 +08:00
David Adam
5b1e163f22 docs/function: add caution about shadowing builtins
See #3000, #12962
2026-05-02 15:14:33 +08:00
Johannes Altmanninger
7c5fc85d96 builtin commandline: fix unintuitive clone 2026-05-01 18:35:41 +08:00
Johannes Altmanninger
2f9f46b2a5 eval_node: extract function for getting exec counts 2026-05-01 18:35:41 +08:00
Johannes Altmanninger
4b069b51e7 Remove "get_" prefix from some getters
In C++ we can't have a field and method sharing a name,
but in Rust we can.

For some structs, most getters don't have a "get_", so it's weird
that some do.  Remove the "get_" prefix where it's obvious enough.

While at it, give some related getters better names.
2026-05-01 18:35:41 +08:00
Johannes Altmanninger
398fc17b81 reader: use simpler test environment constructor
A following commit wants to pass parser by exclusive reference,
which disallows passing "parser" as well as "parser.vars()"
in one function call.  This use case also doesn't make sense.
The "OperationContext::test_only_foreground" constructor is used to
inject a special "PwdEnvironment" into the context.  When we don't need
this environment, we can use a regular constructor, which already uses
"parser.vars()".
2026-05-01 18:03:13 +08:00
Johannes Altmanninger
12fa0d8b3d reader: make exec_prompt_cmd a free function
A following commit will pass parser as "&mut Parser".  This would
create aliasing issues in our calls to exec_prompt_cmd; make it a
free function so rustc can understand how the borrows are split.
2026-05-01 18:03:13 +08:00
Johannes Altmanninger
0441bdc634 Remove ScopeGuard::commit in favor of drop
As of commit a296ee085c (Stop returning a value from ScopeGuarding::commit,
2025-03-15) "ScopeGuard::commit()" is equivalent to "drop()".
Let's use that instead.
2026-05-01 18:03:13 +08:00
Johannes Altmanninger
d0e47cf58a Move current_filename out of LibraryData
The ScopedRefCell wrapping from library_data
is used for two things
1. to allow mutating library_data from a &Parser (for this, a RefCell would be enough)
2. to replace "current_filename" for a scope

A following commit wants to pass parser as "&mut Parser", which
voids reason 1.  It will also remove the ScopedRefCell wrapping
from LibraryData because reason 2 alone is not strong enough.  Move
"current_filename" outside of that, next to "current_node" which is
already a ScopedRefCell.  In future we could maybe consolidate them
into one field, like (or even merging with) ScopedData.
2026-05-01 18:03:13 +08:00
Johannes Altmanninger
d35aa3860a Fix weird initial value for internal job ID
InternalJobId(0) aka InternalJobId::default() is treated specially
so it should not be given to a regular job.
2026-05-01 18:03:13 +08:00
Johannes Altmanninger
5971e79c3f Strong type for internal job IDs 2026-05-01 18:03:13 +08:00
Johannes Altmanninger
dad660cda5 Move internal job ID type
Move this type to where its non-default instances are constructed.
2026-05-01 18:03:13 +08:00
Johannes Altmanninger
8328e53050 reader: reduce variable scope 2026-05-01 18:03:13 +08:00
Johannes Altmanninger
4aadeea184 parser: remove unused field
This has been moved to InputData.
2026-05-01 18:03:13 +08:00
Johannes Altmanninger
df5067cc1c parse_execution: remove pipeline node reference from ExecutionContext
Upcoming changes will pass Parser by exclusive reference ("&mut") which
prevents aliasing; let's remove an alias which seems simpler anyway.
2026-05-01 18:03:13 +08:00
Johannes Altmanninger
3d708d6fc1 history: remove redundant argument 2026-05-01 18:03:13 +08:00
Johannes Altmanninger
a564238d82 highlight_and_colorize: remove redundant environment argument
This highlighting function is always called with with an operation
context created from a parser; Since parser.context().vars() is the same
as parser.vars(), we can use the former, reducing the number of aliases.
2026-05-01 18:03:13 +08:00
Johannes Altmanninger
64443aa173 Lower OnceLock to LazyLock
LazyLock is less powerful so we should use it when possible.

Ref: https://github.com/fish-shell/fish-shell/pull/12661#discussion_r3158097032
2026-05-01 18:03:13 +08:00
Johannes Altmanninger
d2c2b23d1f Fix "fish -d reader" crash on left mouse click
See #12693
2026-05-01 18:00:37 +08:00
Daniel Rainer
4e3898d0d7 feat: xtask gettext
Rewrite the PO file handling logic in Rust and make it available via an
xtask. Replaces the
`build_tools/{update_translations,fish_xgettext}.fish` scripts.

Main benefits:
- Better ergonomics
- Better error handling
- Eliminates the need for a fish executable for updating PO files,
  which is particularly useful in CI
- Improved performance, mainly due to concurrent threads working on the
  PO files in parallel

The behavior is mostly unchanged, with the minor exception that section
headers for empty sections are now omitted in PO files.
The interface for invoking the tooling is quite different. Instead of
working with flags, `cargo xtask gettext` has 3 subcommands:
- `update` modifies the PO files to match the current sources
- `check` is like update, but instead of modifying the PO files, it
  shows diffs between the current version of the PO files and what they
  would look like after updating. When there is a difference, the xtask
  exits non-zero, making it useful for checks to detect outdated PO
  files.
- `new` creates a new PO file for the given language.

Both the `update` and `check` command take any number of file paths to
specify the PO files to consider. If none are specified, all files in
`localization/po/` are considered.

Extracting gettext messages from Rust still requires compiling with the
`gettext-extract` feature active. In situations where compilation is
needed for other purposes as well, it can make sense to only build once
and then tell the gettext xtask about the directory into which the
messages have been extracted. This can be done via the
`--rust-extraction-dir` flag. If we stop having gettext messages in
Rust, this logic can be removed.

Closes #12676
2026-04-30 17:31:03 +00:00
Daniel Rainer
3ad45d8fb1 feat: make as_os_strs easier to use
Make trailing comma optional.

Return array, rather than reference to array, to eliminate lifetime
issues.

Closes #12688
2026-04-30 18:16:43 +08:00
xtqqczze
39bd54cb49 highlight: derive Display trait for HighlightRole 2026-04-28 21:49:51 +02:00
Johannes Altmanninger
281399561b Distinguish builtin read history session ID from private mode
Fixes #12662
2026-04-29 01:55:32 +08:00
Johannes Altmanninger
e5f57b1daf history: fix constructor naming
The only public constructor should be called new().
2026-04-29 01:55:32 +08:00
Johannes Altmanninger
6c04a72697 history: hide private constructor 2026-04-29 01:55:32 +08:00
Johannes Altmanninger
1034945690 Fix regression causing "nosuchcommand || hello" to short-circuit
Commit 3534c07584 (Adopt the new AST in parse_execution, 2020-07-03)
added to parse_execution_context_t::run_job_conjunction an early
return when any job in a job conjunction fails to launch.  This causes
"nosuchcommand || echo hello" to not execute the continuation.

Fix this by restoring the previous behavior.

Fixes #12654
2026-04-29 01:55:32 +08:00
Johannes Altmanninger
e2b18fc5b6 config.fish: don't load default theme in noninteractive shells
We define colors in noninteractive shells for historical reasons
(because colors used to be universal variables).

The other potential reason is to get regular syntax highlighting for
commands like:

	fish -c 'read --shell'

but if anyone actually uses that they can probably load a theme
explicitly.

Stop defining colors in noninteractive shells.  It's usually not
a good idea to make them behave differently from interactive ones,
but color seems only relevant for interactive shells?

Let's see if anyone complains.. we may end up reverting this if people
want to use noninteractive fish to query colors..  but I'm not sure
why that would be necessary.

Closes #12673
2026-04-29 01:48:47 +08:00
Johannes Altmanninger
319b093ef8 autoload: improve enum naming 2026-04-28 23:11:33 +08:00
Johannes Altmanninger
ab2678082e builtin string: add names to RegexError enum fields 2026-04-28 23:11:33 +08:00
Johannes Altmanninger
81e8eebd8d Use UpperCamelCase for enum variants
Missed in 17ba602acf (Use PascalCase for Enums, 2025-12-14).

Fixes #12647
2026-04-28 23:11:33 +08:00
Johannes Altmanninger
2b41f132be Remove obsolete comment working around late fish_indent bug 2026-04-28 15:41:15 +08:00
Johannes Altmanninger
688d1954a8 Fix unused import on systems without eventfd (Cygwin) 2026-04-28 15:27:35 +08:00
Johannes Altmanninger
96695a2859 Document how to remove workaround for Cygwin select() 2026-04-28 14:49:28 +08:00