Commit Graph

19957 Commits

Author SHA1 Message Date
Fabian Boehm
66f1aba0f2 completions/commandline: Add missing options
Some checks failed
Rust checks / clippy (push) Has been cancelled
make test / ubuntu-asan (push) Has been cancelled
make test / ubuntu (push) Has been cancelled
make test / ubuntu-32bit-static-pcre2 (push) Has been cancelled
Rust checks / rustfmt (push) Has been cancelled
make test / macos (push) Has been cancelled
Lock threads / lock (push) Has been cancelled
2025-01-29 20:17:46 +01:00
Fabian Boehm
ef4fad763f Remove fish.desktop harder 2025-01-29 17:21:14 +01:00
Justin Zobel
a42c5b4025 Remove fish.desktop file as it was only needed for AppImages which were decided against. 2025-01-29 17:19:39 +01:00
David Adam
be48d73599 docs/fish: minor style/proofing edits 2025-01-29 20:28:00 +08:00
David Adam
1cf71656ef docs/language: update target release for feature flags from 3.8 to 4.0
see also 24abbb6de7
2025-01-29 20:27:14 +08:00
Johannes Altmanninger
acf9ba4195 Fix regression causing missing automatic history saving after adding ephemeral items
Commit f36f757fa6 (Never rewrite history file when adding ephemeral
items, 2024-10-06) has a glaring bug: when adding to history ephemeral
items that has potential paths, we fail to re-enable automatic saving,
which effectively disables automatic saving for the entire session.

Only a call to history::save_all() at exit saves us from losing data.
But until exit, other fish will see our history (unless we run history
save/merge or similar).

Fix the imbalanced enable/disable and restructure the code a bit.
Also, extend the change from f36f757fa6 (never vacuum on ephemeral
items) to private mode.
2025-01-29 10:16:19 +01:00
Ilya Grigoriev
064d867873 language.rst: make description of features more consistent (minor)
The version where a feature became the default is now described inline,
to make it a single source of truth. I could have fixed the other
section where this was described, but this seemed easier.

I also removed a few details that seem no longer relevant.
2025-01-28 21:23:45 -08:00
David Adam
2184aaf9b4 completions/acpi: correct the -c option as cooling
Closes #11068.
2025-01-28 21:47:05 +08:00
Ilya Grigoriev
f241187c4a completions/tmux: some windows and panes boolean flag completions
This documents some non-argument options for the window and panes
commands. The choice of what to document is somewhat arbitrary,
this commit is biased towards options that I find confusing or
misleading without documentation (is `-a` "all" or "after"?)
and the command that seem more useful to me.

I also didn't cover the options that would be covered by
#10855 (though this PR can be used independently). I'm not
sure how much difference this made, it might not matter at
all.
2025-01-28 21:38:34 +08:00
Ilya Grigoriev
77406ddd11 completions/tmux: complete commands inside tmux lscm
Make `tmux lscm <tab>` work.
2025-01-28 21:37:16 +08:00
Ilya Grigoriev
183e20cc3a completions/tmux: complete all flags when tmux lscm is available
These dynamic completions are exhaustive, but not as well-documented or
as ergonomic as the manual completions. So, any manual completions
should override them.
2025-01-28 21:37:16 +08:00
Ilya Grigoriev
27e5ed7456 completions/tmux: complete all subcommands when tmux lscm works
For example, `tmux shell<tab>` now completes to `if-shell` and
`run-shell`, though no additional information is provided.
2025-01-28 21:37:16 +08:00
Johannes Altmanninger
d2b2c5286a Fix regression decoding function keys
Commit 109ef88831 (Add menu and printscreen keys, 2025-01-01)
accidentally broke an assumption by inverting f1..f12.  Fix that.

Fixes #11098
2025-01-27 21:49:29 +01:00
Fabian Boehm
9116c61736 completions/nmcli: Complete at runtime
This used to get all the interfaces and ssids when the completions
were loaded. That's obviously wrong, given that ssids especially can, you know, change
2025-01-27 20:46:38 +01:00
Fabian Boehm
4370fb755d completions/git: Handle untracked files separately
This uses `git ls-files`, which has a simpler format (just the
filenames on separate lines), in order to print the untracked files.

This allows us to skip them in the `git status` call, which reduces
the output a lot and removes two `string match`.

In a repository with over half a million files (my home directory, if
I made it one), this improves time by a third (12s to 8s).

In a smaller repo (fish-shell) it's barely measurable.
2025-01-27 18:24:08 +01:00
kerty
514f4b9e23 Rename some methods of ReaderHistorySearch to improve clarity 2025-01-27 18:19:04 +01:00
Johannes Altmanninger
b73c8abb79 Fix regression causing crash when history token search hits end
This is consistent with what we do for highlighting history search,
see d7354880e3 (Fix regression causing crash in token history search,
2025-01-27).  In future, we should try to find a better fix (and a
better test).

Fixes the other problem described in #11096
2025-01-27 18:13:07 +01:00
Fabian Boehm
5c81e18b2e completions/git: Handle gigantic repos better
Determine if untracked files are off via `__fish_git`, so we get the
repo used on the commandline etc,

and if it isn't, at least don't error out. Yes, this *can* print a
hundred megabytes of filenames.
2025-01-27 17:52:32 +01:00
Fabian Boehm
bba15c6d14 completions/csvlens: Fix missing option 2025-01-27 17:51:35 +01:00
Johannes Altmanninger
d7354880e3 Fix regression causing crash in token history search
I'm not yet sure how to reproduce 4dfcd4cb4e (reader: Check bounds
for color, 2022-08-26).  Commit 55fd43d86c (Port reader, 2023-12-22)
accidentally changed historical behavior, fix that.

Fixes #11096
2025-01-27 06:32:15 +01:00
Johannes Altmanninger
fff421ad9c Work around mc and dvtm not responding to Primary DA
The two terminals Midnight Commander and dvtm are special in that
they filter requests (or perhaps responses) like

	printf "\x1b[0c"

and don't implement the response themselves -- so we never get
one. Let's work around that until we can fix it.

Disable the kitty protocol in mc for now (to keep the code simple),
though we could certainly re-enable it.

Fixes 64859fc242 (Blocking wait for responses to startup queries, 2025-01-25).
2025-01-27 06:32:15 +01:00
ccoVeille
90e916e164 Fix typo in tests 2025-01-26 20:30:48 -08:00
ccoVeille
0047abbe7a Fix typo in code 2025-01-26 20:30:48 -08:00
ccoVeille
b6a1bedab9 Fix typos in comments 2025-01-26 20:30:48 -08:00
Mahmoud Al-Qudsi
88c8992cc3 Add inline attribute 2025-01-26 17:21:49 -06:00
Fabian Boehm
2b2f824b94 completions/git: Handle huge repositories for "add" better
`git add` may have to go through literal megabytes of file information
because of tons of untracked files.

So, if the repository is set to not show untracked files (because it's
too slow for the prompt), let's fall back on regular file completions.

(the alternative is to go back to `while read`, but that takes much
longer in repositories of a sensible size)

Fixes #11095
2025-01-26 21:41:36 +01:00
Johannes Altmanninger
c651a79cb6 Fix regression causing builtin commandline to report wrong relative cursor
Regressed in 55fd43d86c (Port reader, 2023-12-22).

Fixes #11085
2025-01-26 15:51:05 +01:00
Johannes Altmanninger
4c28a7771e Sanitize some inputs in CSI parser
This was copied from C++ code but we have overflow checks, which
forces us to actually handle errors.

While at it, add some basic error logging.

Fixes #11092
2025-01-26 15:39:21 +01:00
Johannes Altmanninger
2d234bb676 Only request keyboard protocols once we know if kitty kbd is supported
Today we might
1. enable modifyOtherKeys
2. get a reply indicating the kitty keyboard protocol is supported
3. because of 2, we never turn off modifyOtherKeys again

Let's get rid of this weird issue by enabling either modifyOtherKeys
or the kitty enhancements only after we know whether the kitty protocol
is supported.

This means we need to call terminal_protocols_enable_ifn() before every
call to readch() until the querying is done.  Fortunately, this is
already in place in read_normal_chars(); there are other places that
call readch() but none of those is executed until querying has completed.
2025-01-26 15:39:21 +01:00
Johannes Altmanninger
64859fc242 Blocking wait for responses to startup queries
At startup we query for
- the cursor position (CSI 6 n)
- kitty keyboard protocol support (CSI ? u)
- terminfo capabilities via XTGETTCAP

Since we don't wait for responses, those can leak into child processes.
Some child processes like fzf cannot decode DCS replies.  Plug the
leak by ending each round of querying by asking for the Primary Device
Attribute, and resume input processing only after a response has been
received, (or ctrl-c as an escape hatch).

This is a nice simplification. Tested with the lowest common
denominator (putty, Terminal.app and st).

Fixes #11079
2025-01-26 14:22:52 +01:00
Johannes Altmanninger
06b49b9721 Update pexpect helper output sanitization 2025-01-26 14:19:40 +01:00
Johannes Altmanninger
630a06cf8f Work around st terminal resetting cursor on CSI ? u
The st terminal wrongly parses CSI ? u as DECRC. A fix has been
proposed upstream.  Let's also work around it I guess (not to mention
that querying in the first place is also sort of a workaround).
2025-01-26 14:19:40 +01:00
Johannes Altmanninger
95d61ea0fb Split /etc/{,man}path by colons too
I don't know how /etc/manpath ends up containing lines like
"path1:path2".  But path_helper splits them so we should do too.

4ea11424b8/path_helper/path_helper.c (L149)

Fixes #10684
2025-01-26 14:19:40 +01:00
Johannes Altmanninger
6e2c5d4365 Add trailing slash (not space) to variable name completions that produce valid paths
Closes #5798
2025-01-26 14:19:40 +01:00
Fabian Boehm
545a23734e Remove some ffi wrappers 2025-01-25 20:03:13 +01:00
Mahmoud Al-Qudsi
d69a9296a6 completions/llm: Complete model alias target 2025-01-25 12:50:03 -06:00
kerty
3fdd2d3fc2 Small refactor of HighlightSpec 2025-01-23 17:09:29 +01:00
kerty
db546da3ca Made undo/redo not update autosuggestion if failed 2025-01-23 17:09:29 +01:00
kerty
6a9f1b925d Make flash highlight autosuggestion on failed deletion 2025-01-23 17:09:29 +01:00
kerty
bffbf0cd57 Make flash highlight relevant commandline section 2025-01-23 17:09:29 +01:00
kerty
b5c869d5e7 Make parse_util_token_extent return its output instead of mutating input. 2025-01-23 17:09:29 +01:00
kerty
4994000a27 Small refactor of Reader::flash 2025-01-23 17:09:29 +01:00
ccoVeille
d5fdcc96c8 Fix typos in .rst files 2025-01-23 22:06:12 +08:00
Johannes Altmanninger
aee729bd44 Update changelog for cancel-commandline 2025-01-23 02:28:00 +01:00
Fabian Boehm
4e13ce33c5 functions/__fish_cancel_commandline: Follow rename of bind function
See #10935
2025-01-22 17:43:59 +01:00
Fabian Boehm
eab9e647f4 checks/tmux-history-pager: Disable on CI in general
Keeps failing for timing reasons and it's already quite slow.

See #11036
2025-01-21 17:32:27 +01:00
Fabian Boehm
e67819f532 Wrap libc::umask 2025-01-21 17:31:15 +01:00
Johannes Altmanninger
29cddabfe4 Fix regression causing fish_key_reader to not request kitty flags
Fixes 081c3282b7 (Refresh TTY timestamps also in some rare cases,
2025-01-15).
2025-01-21 14:09:33 +01:00
David Adam
945a535570 fish_default_key_bindings: remove duplicate ctrl-k binding
It's in the shared bindings since f9b7992.
2025-01-20 19:48:57 +08:00
Johannes Altmanninger
8208a12a76 Back out "Support help argument in "{ -h""
This backs out commit efce176ceb.
2025-01-19 18:57:21 +01:00