Commit Graph

22961 Commits

Author SHA1 Message Date
Johannes Altmanninger
616ff5c5e9 config.fish: lazy load job control functions
These don't really belong in config.fish.  Put them in function files,
like similar wrappers.  The redundancy is ugly but if it's a problem
we can use code generation to fix that.
2026-06-09 22:24:07 +09:00
Johannes Altmanninger
f525b8a7b6 Merge misc fixes 2026-06-09 22:24:07 +09:00
Johannes Altmanninger
8585def79d Merge key decoding fixes 2026-06-09 22:24:07 +09:00
Johannes Altmanninger
bb6774bef8 CHANGELOG improvements 2026-06-09 22:24:07 +09:00
Johannes Altmanninger
85908c3950 input decoding: rewrite recursive escape sequence parsing
parse_escape_sequence() can self-recurse once, to parse sequences of
the form "\e\e...", where we attempt to interpret the first byte as
either legacy alt (if the "\e..." suffix decodes to a key), or legacy
escape (if it doesn't).

On "\e\e]11;rgb:ffff/ffff/ffff\e\\", i.e. with the inner sequence
being an OSC which doesn't produce a key event, we (tragically)
stop parsing the sequence and assume legacy escape.

Rewrite the logic to keep parsing whole escape sequences whenever
possible.  Also, don't drop any leading \e even if we later error.
Also, make sure each key event gets the correct "originating sequence".

This makes

	tmux new-session fish -C '
		bind alt-b "echo alt-b"
		bind escape "echo escape"
		bind alt-escape "echo alt-escape"
		sleep 2
	'

output the following after quickly pressing "escape" five times
followed by "b" one time:

	escape
	alt-escape
	escape
	alt-b

which is weird but fine because "alt-escape" is rarely used.

If this proves to be a problem, we could disable translation of "\e\e"
to "alt-escape"?

Closes #12379
2026-06-09 22:24:07 +09:00
Johannes Altmanninger
24109b3fe7 CHANGELOG: fix rst formatting 2026-06-09 22:24:07 +09:00
Johannes Altmanninger
19535d9933 input decoding: minimize logic 2026-06-09 22:24:07 +09:00
Johannes Altmanninger
a98000cb36 Add all terminal commands to reader log 2026-06-09 22:24:07 +09:00
Johannes Altmanninger
53edd49213 input decoding: sequence parsing to return query events too
A following commit wants to make "on_byte_read()" potentially return
multiple CharEvent values, in case there is a legacy escape.

Today "parse_csi()" and friends simply insert into the input queue.
This makes it hard to get the ordering right when we return multiple
events.

Change the parsing functions to return their result rather than
queuing directly.
2026-06-09 22:24:07 +09:00
Johannes Altmanninger
b541931b6e docs: replace mention of /usr/share/fish/completions
This directory is no longer since 0fafff2c89 (CMake: stop installing
embedded files, 2026-05-08). Instead of telling users to see "status
list-files", refer them to the source directly.
2026-06-09 22:24:07 +09:00
Johannes Altmanninger
0c3283cbed input decoding: make read_sequence_byte overridable
A following commit wants to inject mock input bytes in unit tests.
Allow this in a quick-and-dirty way by making the input-byte-yielding an
overridable trait method again. Unfortunately this needs to be in the
shared trait; we can't specialize a private trait since specialization
is not supported in stable Rust.
2026-06-09 22:24:07 +09:00
Johannes Altmanninger
070aa01472 docs fish_delta: reword 2026-06-09 22:24:07 +09:00
Johannes Altmanninger
943300c572 input decoding: fix parsing of CSI/SS3 sequences prefixed with legacy alt
Commit af137e5e96 (scrollback-push to query for indn/cuu via XTGETTCAP,
2025-01-05) extracted a bool variable

	recursive_invocation = buffer.len() == 2

It replaced another instance of "buffer.len() == 2" with that variable,
but that's wrong because buffer has grown since then (so it's either
2 or 3).  Flip the bool to fix this.

While at it, tighten an assertion.
2026-06-09 22:24:07 +09:00
Johannes Altmanninger
52fabc3e31 wildcard: make symlink check easier to read 2026-06-09 22:24:07 +09:00
Johannes Altmanninger
800d8a5728 input decoding: use byte literal
We use b"\x1b" elsewhere in this file so be consistent with that.
2026-06-09 22:24:07 +09:00
Johannes Altmanninger
86f92cb1a2 Remove crate-wide suppression of non_camel_case_types lint 2026-06-09 22:24:07 +09:00
Johannes Altmanninger
693169a633 input decoding: add log messages on invalid CSI format 2026-06-09 22:24:07 +09:00
Johannes Altmanninger
59e68e23d5 Idiomatic type name for parsed options
Each builtin is inside its own module, so there is no need to repeat
the builtin name.
2026-06-09 22:24:07 +09:00
Johannes Altmanninger
0033854858 Apply clippy::ref-option lint 2026-06-09 22:24:07 +09:00
Clément Bœsch
6fe05fa772 fix(git-completion): add missing completion for git rebase --show-current-patch and --quit
Closes #12805
2026-06-09 22:24:07 +09:00
Johannes Altmanninger
f2e2c622bb input/input_common: reorganize modules
While at it, rename "input mapping" to "binding", to be consistent
with builtin bind. The "input" bit is already implied by the module
hierarchy.

Also, merge definitions of "enum ReadlineCmd" and
"INPUT_FUNCTION_METADATA" using a macro.

Review with

	git show --color-moved=zebra --color-moved-ws=allow-indentation-change
2026-06-09 22:24:07 +09:00
Johannes Altmanninger
a580d82407 Stop exposing internal module names when we can use re-exports
Types like Environment are sometimes imported using their FQN and
sometimes via their re-export in the parent module; it seems better
to have one canonical name. I think we usually use the re-exports
already, so use them always.

It't not as trivial to enforce this in child modules (such as "mod
tests" which) but that's not a big loss.

While at it, make some other consistency improvements to imports.
2026-06-09 22:24:07 +09:00
Johannes Altmanninger
31a348e70d wutil: remove unused function 2026-06-09 22:24:07 +09:00
Johannes Altmanninger
c4aa726111 wutil: place re-exports before imports
Public items are more important to the reader, so put them first
2026-06-09 22:24:07 +09:00
Johannes Altmanninger
499297fb03 input: remove unused code 2026-06-09 22:24:07 +09:00
Johannes Altmanninger
336df7793a Comment about handing over input data to reader on init 2026-06-09 22:24:07 +09:00
Johannes Altmanninger
a3239ef123 Run "gettext update" and "format" xtasks 2026-06-09 22:24:07 +09:00
Mahmoud Al-Qudsi
197f542750 completions/zpool: Improve zpool replace completion filtering 2026-06-08 12:29:44 -05:00
Mahmoud Al-Qudsi
0645ca231e completions/zpool: Fix broken regex and get rid of nested escape hell 2026-06-08 12:29:41 -05:00
Mahmoud Al-Qudsi
5e20c72232 completions/zpool: Complete diskid/DISK-XXXX and partitions under FreeBSD 2026-06-08 12:29:37 -05:00
Mahmoud Al-Qudsi
e37cad7fef Add disallowed-methods to clippy.toml
We should probably be using `disallowed-methods` more; this is one I had
locally before `clippy.toml` was included in the repo.
2026-06-08 12:28:48 -05:00
Shayan
acd3c45a47 completions/magick: remove deprecated convert command and dependencies 2026-06-02 22:29:34 +08:00
David Adam
1abeae2f4b docs: standardise on "fish" as the name for the shell
This is a potential bikeshed project but if fish is being used as a
proper noun, it should either be capitalised all the time or none of the
time, and the latter looks better.
2026-06-02 14:13:24 +08:00
David Adam
7304fdfffb CHANGELOG: log #7206
Closes #11909.
2026-06-02 13:44:24 +08:00
David Adam
af09b60aeb fix cd symlink resolution tests on Cygwin 2026-06-02 13:43:40 +08:00
David Adam
611a1a0bdf highlight: handle cd now that it has multiple arguments
Work on #11909.
2026-06-02 13:43:39 +08:00
David Adam
7154dd8051 update translations 2026-06-02 13:43:39 +08:00
Asuka Minato
0eb17fa58f Implement cd -L and cd -P
Closes #7206
2026-06-02 13:43:32 +08:00
Johannes Altmanninger
e4123df7be config.fish: remove unicode_start on linux console login
This command typically does

	ioctl(open("/dev/tty"), KDSKBMODE, K_UNICODE)
	printf '\033%%G'
	stty iutf8

Other shells don't do this; it seems like this is typically already done
before the shell is started, for example by systemd's vconsole-setup.
We only do it in very specific scenarios (login shells on linux), so
if this is really needed, we should make it reliable. Bravely remove it.
2026-06-02 11:43:40 +08:00
Wes Higbee
4b2aba31ee complete: tab-complete anywhere-position abbrs in non-command position
Make abbreviations with `--position anywhere` appear in the completion
menu when tabbing in argument position (e.g. `cat foo.log pg<TAB>`
shows pgr, pgrv, pjq, etc.), not just in command position.

Lift "do_file" into an enum, so we don't have to check "is_redirection"
twice, and can express more accurately the reason for not completing
abbreviations after redirection.

Co-authored-by: Johannes Altmanninger <aclopte@gmail.com>

Closes #12764
2026-06-02 11:38:29 +08:00
Johannes Altmanninger
c10e782838 Remove unused allocation in complete_abbr argument
Helps the next commit.
2026-06-02 11:32:52 +08:00
Johannes Altmanninger
71ce491783 abbr unit tests: remove abbreviations after test
This helps avoid a test failure in a futre commit which offers
abbreviations created with --position=anywhere as completions.
2026-06-02 11:32:52 +08:00
Johannes Altmanninger
b5ae8df24c abbrs: use safer API 2026-06-02 11:31:21 +08:00
Johannes Altmanninger
f717c5e2a0 Fix "bind -M somemode" crash for empty bind modes
This loop iterates over all bindings and crashes if a mode filter
argument is given for a mode that has no binding.  Fix this by
continuing the loop earlier.

Fixes 11d6e92cb5 (Show file location when querying bindings with bind, 2025-12-28)

Fixes #12798
2026-06-02 08:44:27 +08:00
Johannes Altmanninger
7acd489a06 Don't show private mode greeting if greeting is empty list
Reintroduce a subset of 0e4a75c0b5 (Do not print greeting with empty
$fish_greeting and --private, 2019-11-08) after it has been removed
in 72a44460c6 (Move fish_greeting to a function, 2020-05-30).

Closes #12796
2026-06-01 15:50:31 +08:00
ritoban23
11d6e92cb5 Show file location when querying bindings with bind
Closes #12215
Closes #12504
Closes #12221
2026-05-31 07:43:32 +08:00
Sean Reifschneider
eb535322d0 Fix cW Vi mode regression deleting trailing space
Missed in 02c0455 (Fix Vi mode cw deleting trailing whitespace, 2026-02-12),

Closes #12790
Closes #12791
2026-05-31 07:38:44 +08:00
Johannes Altmanninger
cb2f279550 minor style cleanup 2026-05-30 21:34:19 +08:00
Johannes Altmanninger
dc9668c8a4 Remove unused workflow to build docker images
Implied by f48166ff36 (update-dependencies: remove things used for Cirrus,
2026-05-29).

See #12626
2026-05-30 18:05:50 +08:00
Johannes Altmanninger
a3b009dd43 build_tools/update-dependencies.sh
Steps:

1. Run: build_tools/update-dependencies.sh
2. Remove obsolete small_rng feature from Cargo.toml
3. Re-run failed part
4. Run: cargo +nightly -Zunstable-options update --breaking
5. Address rng breaking changes
2026-05-30 17:52:48 +08:00