Commit Graph

19657 Commits

Author SHA1 Message Date
Fabian Boehm
1c11055241 Don't clone argv for builtins
We capture the process already, and we use argv by reference for the
other cases.

argv can be big, and this reduces allocations and thereby memory usage
and speed.

E.g. `set -l foo **` with 200k matches has 25% reduced memory usage
and ~5% reduced runtime.
2025-01-17 10:02:32 +01:00
Fabian Boehm
28fb5b5207 Fix error for "fish --foo" without option argument
Wgetopt needs a ":" at the beginning to turn on this type of error.

I'm not sure why that is now, and we might want to change it (but tbh
wgetopt could do with a replacement anyway).

Fixes #11049
2025-01-17 09:52:53 +01:00
Fabian Boehm
45439f07d7 Update tests and docs for 4.0 target 2025-01-16 13:38:26 +01:00
David Adam
452aa6c614 feature_flags: update target release for 3.8 flags to 4.0
(cherry picked from commit 24abbb6de7)
2025-01-15 22:12:22 +08:00
Daniel Fleischer
8c92ea1642 Add lazygit completions (#11019)
(cherry picked from commit 29c45100fa)
2025-01-15 21:08:12 +08:00
Fabian Boehm
d2bfb51611 Workaround Kitty spamming the log for ModifyOtherKeys
Some checks failed
make test / ubuntu (push) Has been cancelled
make test / ubuntu-32bit-static-pcre2 (push) Has been cancelled
make test / ubuntu-asan (push) Has been cancelled
make test / macos (push) Has been cancelled
Rust checks / rustfmt (push) Has been cancelled
Rust checks / clippy (push) Has been cancelled
Fixes #11040
2025-01-14 20:10:33 +01:00
Fabian Boehm
806734cc56 Make new ctrl-c behavior "clear-commandline"
Some checks are pending
make test / ubuntu (push) Waiting to run
make test / ubuntu-32bit-static-pcre2 (push) Waiting to run
make test / ubuntu-asan (push) Waiting to run
make test / macos (push) Waiting to run
Rust checks / rustfmt (push) Waiting to run
Rust checks / clippy (push) Waiting to run
And leave the old behavior under the name "cancel-commandline".

This renames "cancel-commandline-traditional" back to
"cancel-commandline", so the old name triggers the old behavior.

Fixes #10935
2025-01-14 20:00:31 +01:00
Branch Vincent
8e141070b2 completions: add fish-lsp (#11017)
(cherry picked from commit 7970ca55af)
2025-01-14 23:48:48 +08:00
David Adam
b009c0d480 Debian packaging: update dependencies
Some checks failed
Rust checks / clippy (push) Has been cancelled
make test / ubuntu (push) Has been cancelled
make test / ubuntu-32bit-static-pcre2 (push) Has been cancelled
make test / ubuntu-asan (push) Has been cancelled
make test / macos (push) Has been cancelled
Rust checks / rustfmt (push) Has been cancelled
Ubuntu Focal calls the package with col "bsdmainutils", which is a
transitional package on newer version of both Debian and Ubuntu.

Closes #11037.

(Adapted from commit 54fef433e9)
2025-01-12 21:21:50 +08:00
Klaus Hipp
b3aa79e9aa Fix completion typos
Some checks failed
make test / ubuntu (push) Has been cancelled
make test / ubuntu-32bit-static-pcre2 (push) Has been cancelled
make test / ubuntu-asan (push) Has been cancelled
make test / macos (push) Has been cancelled
Rust checks / rustfmt (push) Has been cancelled
Rust checks / clippy (push) Has been cancelled
(cherry picked from commit 5c25d3c3b1)
2025-01-09 16:51:39 +01:00
phanium
fbf9ac8046 Fix missing of builtin token description
(cherry picked from commit ef7aa793c6)
2025-01-09 16:49:38 +01:00
Fabian Boehm
fb6d3c3669 type: Do not translate the type "builtin"
Some checks are pending
make test / ubuntu (push) Waiting to run
make test / ubuntu-32bit-static-pcre2 (push) Waiting to run
make test / ubuntu-asan (push) Waiting to run
make test / macos (push) Waiting to run
Rust checks / clippy (push) Waiting to run
Rust checks / rustfmt (push) Waiting to run
This is a functional string, it should not be translated.

And we do not translate the others.
2025-01-09 16:41:44 +01:00
César Sagaert
d6dccc3c88 DNF5 completion support (#11035)
* dnf5 completions

* address comments

(cherry picked from commit 00c7baf68c)
2025-01-09 16:36:23 +01:00
Klaus Hipp
f36a7262db Revert "Fix typo in npm completions: isntall -> install" (#11014)
Some checks are pending
make test / ubuntu (push) Waiting to run
make test / ubuntu-32bit-static-pcre2 (push) Waiting to run
make test / ubuntu-asan (push) Waiting to run
make test / macos (push) Waiting to run
Rust checks / rustfmt (push) Waiting to run
Rust checks / clippy (push) Waiting to run
* Revert "Fix typo in npm completions: isntall -> install"

This reverts commit f4b01bb638.

* Add comments about typos in `npm` completions

(cherry picked from commit 4def0ac616)
2025-01-08 08:53:33 +08:00
Fabian Boehm
8a5b1ccc17 Revert "Probe for kitty keyboard protocol support"
Some checks are pending
make test / ubuntu (push) Waiting to run
make test / ubuntu-32bit-static-pcre2 (push) Waiting to run
make test / ubuntu-asan (push) Waiting to run
make test / macos (push) Waiting to run
Rust checks / rustfmt (push) Waiting to run
Rust checks / clippy (push) Waiting to run
This needs to be tested more, it has shown issues in MS conhost,
and potentially others.

Changing strategy after beta isn't the greatest idea.

This reverts commit 4decacb933.

See #10994
2025-01-07 20:28:24 +01:00
Steve Walker
52a2bed38c fix python completion #10943
(cherry picked from commit b574a5e4f6)
2025-01-07 23:30:56 +08:00
Klaus Hipp
cbfbac2198 Fix completion typos for apt-build, htop and wget (#11016)
(cherry picked from commit ea4e4a4279)
2025-01-07 21:48:23 +08:00
Klaus Hipp
a9b7dd1a9b Fix typos in docs (#11015)
Some checks are pending
make test / ubuntu (push) Waiting to run
make test / ubuntu-32bit-static-pcre2 (push) Waiting to run
make test / ubuntu-asan (push) Waiting to run
make test / macos (push) Waiting to run
Rust checks / rustfmt (push) Waiting to run
Rust checks / clippy (push) Waiting to run
(cherry picked from commit 9b67b2ae07)
2025-01-07 21:32:23 +08:00
Johannes Altmanninger
4decacb933 Probe for kitty keyboard protocol support
Some checks are pending
make test / ubuntu (push) Waiting to run
make test / ubuntu-32bit-static-pcre2 (push) Waiting to run
make test / ubuntu-asan (push) Waiting to run
make test / macos (push) Waiting to run
Rust checks / rustfmt (push) Waiting to run
Rust checks / clippy (push) Waiting to run
I believe this fixes more cases than it breaks.  For example
this should fix Termux which seems to be popular among fish
users. Unfortunately I haven't yet managed to test that one.

Cherry-pick of all of
- e49dde87cc (Probe for kitty keyboard protocol support, 2025-01-03)
- 10f1f21a4f (Don't send kitty kbd protocol probe until ECHO is disabled, 2025-01-05)
- dda4371679 (Stop sending CSI 5n when querying for kitty keyboard support, 2025-01-05)
2025-01-06 11:20:10 +01:00
Johannes Altmanninger
620eed466b Retry writing some escape sequences on EINTR
Cherry-picked from bc26481558.
2025-01-06 11:20:10 +01:00
Lzu Tao
33fe575112 Add more convenient key bindings for VI mode
Some checks are pending
make test / ubuntu (push) Waiting to run
make test / ubuntu-32bit-static-pcre2 (push) Waiting to run
make test / ubuntu-asan (push) Waiting to run
make test / macos (push) Waiting to run
Rust checks / rustfmt (push) Waiting to run
Rust checks / clippy (push) Waiting to run
To make it more familiar to vi/vim users.

In all mode, ctrl-k is bind to kill-line.

In Vi visual mode:
* press v or i turn into normal or insert mode respectively.
* press I turn to insert mode and move the cursor to beginning of line.
* because fish doesn't have upcase/locase-selection, and most people reach for
  g-U rather than g-u, g-U binds to togglecase-selection temporarily.

(cherry picked from commit f9b79926f1)
2025-01-05 23:00:55 +08:00
David Adam
13f7e6d0a5 docs/interactive: update key bindings added for 4.0
(cherry picked from commit 6c3150aa05)
2025-01-05 22:28:45 +08:00
cornmander
44a8344da1 Add completions for Google Cloud commands. (#11005)
Some checks are pending
make test / ubuntu (push) Waiting to run
make test / ubuntu-32bit-static-pcre2 (push) Waiting to run
make test / ubuntu-asan (push) Waiting to run
make test / macos (push) Waiting to run
Rust checks / rustfmt (push) Waiting to run
Rust checks / clippy (push) Waiting to run
The `gcloud` and `gsutil` Google Cloud commands use argcomplete, so integrating them is easy with the `__fish_argcomplete_complete` function.

(cherry picked from commit d842a6560e)
2025-01-05 15:25:23 +08:00
David Adam
92919effc5 CHANGELOG: work on 4.0.0
Some checks are pending
make test / ubuntu (push) Waiting to run
make test / ubuntu-32bit-static-pcre2 (push) Waiting to run
make test / ubuntu-asan (push) Waiting to run
make test / macos (push) Waiting to run
Rust checks / rustfmt (push) Waiting to run
Rust checks / clippy (push) Waiting to run
2025-01-04 21:53:32 +08:00
Lzu Tao
046cadb53a Add completion for gem-fetch
(cherry picked from commit 7eb254f2ba)
2025-01-04 21:26:26 +08:00
idealseal
a5f99afa47 feat(comp): Update completions for resolvectl
(cherry picked from commit 2e12a2b6c4)
2025-01-04 20:42:44 +08:00
idealseal
24397c71cd feat(comp): Update completion for md5sum
(cherry picked from commit a780e4da15)
2025-01-04 20:39:56 +08:00
Johannes Altmanninger
566ff38fee Mention lack of support for ctrl-backspace and alternatives
Closes #10936

(cherry picked from commit cde503b0a8)
2025-01-04 20:32:06 +08:00
Thayne McCombs
7ea2ab4ebb fix[completions]: Add set-timeout to bootctl
(cherry picked from commit 33dd823f45)
2025-01-04 20:18:12 +08:00
Johannes Altmanninger
e6e647092d Fix off-by-one error in Vi-style upcase-word at commandline end
cursor_selection_mode=inclusive means the commandline position is
bounded by the last character. Fix a loop that fails to account
for this.

Fixes d51f669647 (Vi mode: avoid placing cursor beyond last character,
2024-02-14).

This change looks very odd because if the commandline is like

	echo foo.

it makes us try to uppercase the trailing period even though that's
not part of word range.  Hopefully this is harmless.

Note that there seem to be more issues remaining, for example Vi-mode
paste leaves the cursor in an out-of-bounds odd position.

Fixes #10952
Closes #10953

Reported-by: Lzu Tao <taolzu@gmail.com>

(cherry picked from commit 69f0d960cf)
2025-01-04 20:17:32 +08:00
Fabian Boehm
5845a3f7ad __fish_complete_subcommand: Just complete -C for a given commandline
Some checks are pending
make test / ubuntu (push) Waiting to run
make test / ubuntu-32bit-static-pcre2 (push) Waiting to run
make test / ubuntu-asan (push) Waiting to run
make test / macos (push) Waiting to run
Rust checks / rustfmt (push) Waiting to run
Rust checks / clippy (push) Waiting to run
Fixes #10980.

This would, if a commandline was given, still revert to checking
the *real* commandline if it was empty.

Unfortunately, in those cases, it could have found a command and tried
to complete it.

If a commandline is given, that is what needs to be completed.

(note this means this is basically useless in completions that use it
like `sudo` and could just be replaced with `complete -C"$commandline"`)

(cherry picked from commit d5efef1cc5)
2025-01-03 19:35:14 +01:00
Alexei Mikhailov
ff8a879e80 completions/exercism: use generate script
Some checks are pending
make test / ubuntu (push) Waiting to run
make test / ubuntu-32bit-static-pcre2 (push) Waiting to run
make test / ubuntu-asan (push) Waiting to run
make test / macos (push) Waiting to run
Rust checks / rustfmt (push) Waiting to run
Rust checks / clippy (push) Waiting to run
Exercism ships with it's own completions and a generation script, so let's use
that one instead.

(cherry picked from commit 9b26fff278)
2025-01-02 21:57:57 +08:00
Klaus Hipp
6749a44d0f Update code completions
Some checks are pending
make test / ubuntu (push) Waiting to run
make test / ubuntu-32bit-static-pcre2 (push) Waiting to run
make test / ubuntu-asan (push) Waiting to run
make test / macos (push) Waiting to run
Rust checks / rustfmt (push) Waiting to run
Rust checks / clippy (push) Waiting to run
(cherry picked from commit 2b46d97c68)
2025-01-02 14:12:00 +08:00
EmilyGraceSeville7cf
550a076fa3 feat(completion) support batsh command
(cherry picked from commit 1bda6043c8)
2025-01-02 09:16:26 +08:00
EmilyGraceSeville7cf
c28659a045 feat(completion): support folderify command
(cherry picked from commit d8d5913159)
2025-01-02 09:16:26 +08:00
Benjamin Kellermann
d2608588fc add completion for btrbk (#10752)
* add completion for btrbk

completions for btrbk https://github.com/digint/btrbk/

* change indent + spaces

(cherry picked from commit 2ac1523e54)
2025-01-02 09:16:26 +08:00
Ilya Grigoriev
dd333cdc82 completions/tmux: add skeleton "Windows and Panes" bindings (#10854)
Some checks are pending
make test / ubuntu (push) Waiting to run
make test / ubuntu-32bit-static-pcre2 (push) Waiting to run
make test / ubuntu-asan (push) Waiting to run
make test / macos (push) Waiting to run
Rust checks / rustfmt (push) Waiting to run
Rust checks / clippy (push) Waiting to run
These are quite mechanical, but include all the commands (as of tmux
3.5a) in the "Windows and Panes" section of `man tmux`. For these
commands, I included the target-pane/session/client/window flags and the
-F formatstring flags (but not the less generic flags specific to
individual commands).

Nice completion is implemented for those flags where the helper
functions were already implemented previously.

After this, tmux pane<tab> will hopefully be useful.

A few TODOs mention low-hanging fruit for somebody who better
understands fish's `complete` command syntax (or a future me).

Another piece of low-hanging fruit would be completion for all the
target-window flags. This PR merely lists them.

(cherry picked from commit b1064ac3a0)
2025-01-02 09:14:37 +08:00
Fabian Boehm
57a7920e15 CHANGELOG since 4.0b1
Some checks failed
make test / ubuntu (push) Has been cancelled
make test / ubuntu-32bit-static-pcre2 (push) Has been cancelled
make test / ubuntu-asan (push) Has been cancelled
make test / macos (push) Has been cancelled
Rust checks / rustfmt (push) Has been cancelled
Rust checks / clippy (push) Has been cancelled
2024-12-31 14:35:55 +01:00
Grant Hutchins
2f99a82700
Improve documentation for string escape
Some checks failed
make test / ubuntu (push) Has been cancelled
make test / ubuntu-32bit-static-pcre2 (push) Has been cancelled
Rust checks / rustfmt (push) Has been cancelled
Rust checks / clippy (push) Has been cancelled
make test / ubuntu-asan (push) Has been cancelled
make test / macos (push) Has been cancelled
Before, it unnecessarily stated that there are three `--style` options, when
there are actually four.

I also align the default `--style=script` argument to the beginning of the line
to match the other options visually for easier scanning.
2024-12-29 13:49:05 -08:00
Fabian Boehm
5f76fc3e41 Add status buildinfo (#10896)
Some checks are pending
make test / ubuntu (push) Waiting to run
make test / ubuntu-32bit-static-pcre2 (push) Waiting to run
make test / ubuntu-asan (push) Waiting to run
make test / macos (push) Waiting to run
Rust checks / rustfmt (push) Waiting to run
Rust checks / clippy (push) Waiting to run
This can be used to get some information on how fish was built - the
version, the build system, the operating system and architecture, the
features.

(cherry picked from commit 6f9ca42a30)
2024-12-29 13:37:29 +01:00
Joan Bruguera Micó
c0a2b55efd
Create new base directories with mode 0700
Some checks are pending
make test / ubuntu (push) Waiting to run
make test / ubuntu-32bit-static-pcre2 (push) Waiting to run
make test / ubuntu-asan (push) Waiting to run
make test / macos (push) Waiting to run
Rust checks / rustfmt (push) Waiting to run
Rust checks / clippy (push) Waiting to run
If base directories (e.g. $HOME/.config/fish) need to be created,
create them with mode 0700 (i.e. restricted to the owner).
This both keeps the behavior of old fish versions (e.g. 3.7.1) and is
compliant with the XDG Base Directory Specification.

See: https://specifications.freedesktop.org/basedir-spec/0.8/#referencing
2024-12-28 12:14:14 -08:00
Fabian Boehm
f75912d205 Create release-with-debug cargo profile, hook it up with cmake
Fixes #10959

(cherry picked from commit 66b80041cc)
2024-12-28 16:04:18 +01:00
Kid
701853fdd3 docs: Distinguish documents in sidebar
Some checks are pending
make test / ubuntu (push) Waiting to run
make test / ubuntu-32bit-static-pcre2 (push) Waiting to run
make test / ubuntu-asan (push) Waiting to run
make test / macos (push) Waiting to run
Rust checks / rustfmt (push) Waiting to run
Rust checks / clippy (push) Waiting to run
(cherry picked from commit a579abb81b)
2024-12-28 08:42:59 +01:00
Dmitry Gerasimov
ea2c53ca85
completions/dnf: Fix completions for DNF5 (#9862)
Some checks failed
Rust checks / rustfmt (push) Has been cancelled
Rust checks / clippy (push) Has been cancelled
make test / ubuntu (push) Has been cancelled
make test / ubuntu-32bit-static-pcre2 (push) Has been cancelled
make test / ubuntu-asan (push) Has been cancelled
make test / macos (push) Has been cancelled
Since DNF5 there's no implicit \n in repoquery output. For DNF4 this change
leaves blank lines in the output, but they are ignored anyway.
2024-12-26 12:02:22 -08:00
phanium
06105e9207 Fix alt-e cursor position restore on Vim <= 8 (#10946)
Some checks are pending
make test / ubuntu-32bit-static-pcre2 (push) Waiting to run
make test / ubuntu (push) Waiting to run
make test / ubuntu-asan (push) Waiting to run
make test / macos (push) Waiting to run
Rust checks / rustfmt (push) Waiting to run
Rust checks / clippy (push) Waiting to run
Cherry-picked from commit 94dfe1b053
2024-12-26 06:40:41 +01:00
David Adam
e858322749 Debian packaging: add some missing runtime dependencies
(cherry picked from commit eade6a5672)
2024-12-26 13:37:30 +08:00
David Adam
bd2ddda9a4 update CMake requirement
find_rust uses LIST(POP_BACK), which was added in 3.15.

(cherry picked from commit 044cea1bf3)
2024-12-26 13:37:30 +08:00
David Adam
6db110916b Debian packaging: reformat dependencies
(cherry picked from commit 74b1247461)
2024-12-26 13:37:30 +08:00
Fabian Boehm
d707a516d2 docs: Use grid in the CSS (#10942)
Some checks are pending
make test / ubuntu (push) Waiting to run
make test / ubuntu-32bit-static-pcre2 (push) Waiting to run
make test / ubuntu-asan (push) Waiting to run
make test / macos (push) Waiting to run
Rust checks / rustfmt (push) Waiting to run
Rust checks / clippy (push) Waiting to run
Instead of hardcoded 230px margin.

This also makes the ToC only take up a third of the screen when
narrow, and lets you scroll the rest.

Without, you'd have to scroll past the *entire* ToC, which is awkward

Remaining issue is the search box up top. Since this disables the one
in the sidebar once the window gets too narrow, that one is important,
and it isn't *great*

(cherry picked from commit 9b8793a2df)
2024-12-25 14:50:29 +01:00
Fabian Boehm
aed52049ab Remove SIGUNUSED
Some checks failed
make test / ubuntu (push) Has been cancelled
make test / ubuntu-32bit-static-pcre2 (push) Has been cancelled
make test / ubuntu-asan (push) Has been cancelled
make test / macos (push) Has been cancelled
Rust checks / rustfmt (push) Has been cancelled
Rust checks / clippy (push) Has been cancelled
It is, as the name implies, unused - it became SIGSYS, which we
already check.

Since it is entirely undefined on some architectures it causes a build
failure there, see discussion in #10633
2024-12-23 17:01:04 +01:00