Commit graph

19784 commits

Author SHA1 Message Date
Mahmoud Al-Qudsi
417b2eb8c6 Re-add dynamic CTEST_PARALLEL_LEVEL detection
When it is not hard-coded in the environment variable of the same name.
2025-01-10 14:12:46 +01:00
Mahmoud Al-Qudsi
3bbfaf532e Bump CTEST_PARALLEL_LEVEL to match CTEST_BUILD_PARALLEL_LEVEL
This is an experiment to see if it causes any of the tests to flake and/or if it
even appreciably speeds up CI to begin with.

I note that there are tests added in 8bf8b10 that mutate global terminal state
but also note that local tests without CTEST_PARALLEL_LEVEL set at all have been
running to completion just fine without any observed flakiness *and* that our
Cirrus CI tests have this hard-coded to 6.
2025-01-10 14:12:46 +01:00
Fabian Boehm
c7358d14c8 Make fish_indent available as a builtin 2025-01-10 14:12:19 +01:00
Fabian Boehm
67eb0e8317 Make fish_key_reader available as a builtin
This brings us closer to making fish available as a single file.
2025-01-10 14:12:19 +01:00
Benjamin Weis
83586aebcc Update German translation 2025-01-10 14:10:36 +01:00
Mahmoud Al-Qudsi
c1a43b896c Skip select ebadf test under WSLv1 due to a WSL bug
WSLv1 won't return EBADF (or any error) if the fd was closed mid-select.
2025-01-09 17:30:08 -06:00
Mahmoud Al-Qudsi
0fcb2f7590 completions/cargo: Add --ignore-rust-version
New to 1.85; bypasses MSRV checks specified by `resolver = 3` or in
.cargo/config.toml
2025-01-09 17:06:31 -06:00
Mahmoud Al-Qudsi
e3868effe1 Update cargo dependencies 2025-01-09 17:00:30 -06:00
Mahmoud Al-Qudsi
b9c6806e45 Configure cargo to respect MSRV
The new 1.84 release has a new feature that makes `cargo update` MSRV-aware.

This is what it looks like in practice:

    Updating crates.io index
    Updating git repository `https://github.com/fish-shell/rust-pcre2`
From https://github.com/fish-shell/rust-pcre2
 * [new tag]         0.2.9-utf32 -> origin/tags/0.2.9-utf32
     Locking 7 packages to latest Rust 1.70 compatible versions
    Updating cc v1.2.6 -> v1.2.7
    Updating phf v0.11.2 -> v0.11.3
    Updating phf_codegen v0.11.2 -> v0.11.3
    Updating phf_generator v0.11.2 -> v0.11.3
    Updating phf_shared v0.11.2 -> v0.11.3
    Updating siphasher v0.3.11 -> v1.0.1
    Updating syn v2.0.94 -> v2.0.95
2025-01-09 16:50:13 -06:00
Fabian Boehm
b8208d72f7 Remove test for broken tmux output
Quite flaky on CI.

See #11036
2025-01-09 21:06:15 +01:00
Fabian Boehm
52cb42ba3d Remove unused fish_iswgraph 2025-01-09 20:20:28 +01:00
Klaus Hipp
5c25d3c3b1 Fix completion typos 2025-01-09 16:51:39 +01:00
phanium
ef7aa793c6 Fix missing of builtin token description 2025-01-09 16:49:41 +01:00
Fabian Boehm
fac29e775a type: Do not translate the type "builtin"
This is a functional string, it should not be translated.

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

* address comments
2025-01-09 16:35:46 +01:00
Johannes Altmanninger
0e512f8033 Fix spurious blank lines when executing scrolled commandline
The result of

	commandline -i ": '$(seq $LINES)"\n"first scrolled line'"

is a commandline that is scrolled by one line.

Before executing that commandline, we move the cursor down by one
too many line. This is a regression from 610338cc70 (On undo after
execute, restore the cursor position, 2024-12-21). Fix that.

The test also demonstrates an unrelated problem, probably specific
to tmux.
2025-01-09 14:43:21 +01:00
Fabian Boehm
8304fd0fd0 tmux-job: Add more sleeps 2025-01-08 19:10:38 +01:00
Fabian Boehm
f4f786633d pexpects/bind: Add missing expect_prompt 2025-01-08 19:10:38 +01:00
Fabian Boehm
ec3b3fe321 pexpects/signals: Decrease a timeout that should be reached
Saves ~10% of the *total* testing time (except for `cargo test`)
2025-01-08 19:10:38 +01:00
Fabian Boehm
d3762f11b5 tmux-commandline: Print $LINES
Maybe this'll show us what the issue on NetBSD is
2025-01-08 19:10:38 +01:00
Fabian Boehm
6db0f39676 exit_nohang: Harden a bit 2025-01-08 19:10:38 +01:00
Branch Vincent
7970ca55af
completions: add fish-lsp (#11017) 2025-01-08 11:25:36 -06:00
David Adam
ccbbae95ef update copyright years to be unbounded
There is no legal need to have the year written here and it's a chore to
keep it up to date.
2025-01-08 20:38:43 +08:00
Johannes Altmanninger
6d551b4459 Fix status buildinfo error on invalid args 2025-01-08 12:06:28 +01:00
Johannes Altmanninger
cc9083e220 Add some logging for XTGETTCAP 2025-01-08 12:06:28 +01:00
Johannes Altmanninger
14df28382d Work around terminals that echo DCS queries
Some terminals such as conhost and putty cannot parse DCS commands,
and will echo them back.

Work around this by making sure that this echoed text will not
be visible.

Do so by temporarily enabling the alternative screen buffer when
sending DCS queries (in this case only XTGETTCAP).  The alternative
screen buffer feature seems widely supported, and easier to get right
than trying to clear individual lines etc.

The alternative screen may still be visible for a
short time.  Luckily we can use [Synchronized Output](
https://gist.github.com/christianparpart/d8a62cc1ab659194337d73e399004036)
to make sure the screen change is never visible to the user.

Querying support for that is deemed safe since it only requires a
CSI command.

Note that it seems that every terminal that supports Synchronized
Output also parses DCS commands successfully.  This means that we
could get away without the alternative screen buffer in practice.
Not sure yet.

The implementation is slightly more complex than necessary in that it
defines a redundant ImplicitEvent. This is for two reasons: 1. I have
a pending change that wants to use it, so this removes diff noise and
2. we historically have sc/input_common.rs not depend on src/output.rs.
I dont' think any are strong reasons though.
2025-01-08 12:06:28 +01:00
Johannes Altmanninger
e6d57f2fb2 Minor style fix 2025-01-08 12:06:28 +01:00
Klaus Hipp
4def0ac616
Revert "Fix typo in npm completions: isntall -> install" (#11014)
* Revert "Fix typo in npm completions: isntall -> install"

This reverts commit f4b01bb638.

* Add comments about typos in `npm` completions
2025-01-07 12:32:16 -06:00
Steve Walker
b574a5e4f6 fix python completion #10943 2025-01-07 23:30:27 +08:00
Klaus Hipp
9b67b2ae07
Fix typos in docs (#11015) 2025-01-06 19:40:30 -06:00
Klaus Hipp
ea4e4a4279
Fix completion typos for apt-build, htop and wget (#11016) 2025-01-06 19:39:47 -06:00
Johannes Altmanninger
3405621dee Update littlecheck to fix spurious "not found" error on exit 127
Commit b6d76ae: we now use lines like "# RUN: fish=%fish %fish".
If a test exits with 127 we try to look up the command but use the
wrong name, which leads to unintelligible errors if the test exits
with 127 for other reasons.
2025-01-06 06:40:43 +01:00
Johannes Altmanninger
834001087d Disable kitty keyboard protocol on iTerm again for now
It causes alt-left to be sent as left in some cases; see #11004.

Upstream issue: https://gitlab.com/gnachman/iterm2/-/issues/12105
2025-01-06 06:24:13 +01:00
Johannes Altmanninger
e697add5b5 Feature flag to prevent executing off buffered keys
If I run "sleep 3", type a command and hit enter, then there is no
obvious way to cancel or edit the imminent command other than ctrl-c
but that also cancels sleep, and doesn't allow editing. (ctrl-z sort
of works, but also doesn't allow editing).

Let's try to limit ourselves to inserting the buffered command
(translating enter to a newline), and only execute once the user
actually presses enter after the previous command is done.
Hide it behind a new feature flag for now.

By making things less scary, this might be more user-friendly, at
the risk of breaking expectations in some cases.

This also fixes a class of security issues where a command like
`cat malicious-file.txt` might output escape sequences, causing
the terminal to echo back a malicious command; such files can still
insert into the command line but at least not execute it directly.
(Since it's only fixed partially I'm not really sure if the security
issue is a good enough motivation for this particular change.)

Note that bracketed paste probably has similar motivation as this feature.

Part of #10987
Closes #10991
2025-01-06 06:24:13 +01:00
Johannes Altmanninger
704b911168 Back out "Bind ctrl-l to clear-screen again for now"
As of the parent commits this should no longer cause breakage.

This backs out commit 07dd088d76.
2025-01-06 06:24:13 +01:00
Johannes Altmanninger
af137e5e96 scrollback-push to query for indn/cuu via XTGETTCAP
Some terminals like the Linux console don't support indn (scroll
forward). Let's query for the presence of these features, and fall
back to the traditional behavior if absent.

For now, break with the tradition of using the terminfo database that
we read ourselves. Instead ask the terminal directly via XTGETTCAP.
This is a fairly young feature implemented by terminals like xterm,
foot and kitty, however xterm doesn't expose these capabilities at
this point.

This is a good opportunity to try XTGETTCAP, since these are
capabilities we haven't used before. Advantages of XTGETTCAP are that
it works across SSH and is independent of $TERM (of course ignoring
$TERM may also be breaking to some users). Let's see if it sees
adoption in practice.

Tested to work on foot and kitty, allowing the default ctrl-l binding
to work without erasing any screen content.

See #11003
2025-01-06 06:24:13 +01:00
Johannes Altmanninger
75832b3c5d scrollback-push to fall back to clear-screen if missing CPR feature
The new ctrl-l implementation relies on Cursor Position Reporting (CPR)
This may not work on exotic terminals that don't support CSI 6n yet

As a workaround, probe for this feature by sending a CSI 6n (CPR)
on startup.  Until the terminal responds, have scrollback-push fall
back to clear-screen.

The theoretical problem here is that we might handle scrollback-push
before we have handled the response to our feature probe. That seems
fairly unlikely; also e49dde87cc has the same characteristics.

This could query a capability instead (via XTGETTCAP or otherwise)
but I haven't found one; and this seems at least as reliable.

While at it, change the naming a bit.

See #11003
2025-01-06 05:53:24 +01:00
Johannes Altmanninger
dda4371679 Stop sending CSI 5n when querying for kitty keyboard support
After we query kitty keyboard protocol support,
we send CSI 5n, to also receive a response if
the protocol is not supported.

However we don't bother to wait for the response, so this extra
message is not really useful (only to get better logs).  Remove it.
2025-01-06 05:51:38 +01:00
Johannes Altmanninger
10f1f21a4f Don't send kitty kbd protocol probe until ECHO is disabled
With tmux 3.0 (from 2019) inside SSH, the CSI 5n response is echoed.
I guess with all other terminals we were just lucky.  Move it to
right after where we disable ECHO I guess.

In general, asynchronous requests create a lot of potential for error,
we should try to get away from them.
2025-01-06 05:51:38 +01:00
Johannes Altmanninger
109ef88831 Add menu and printscreen keys
These aren't typically used in the terminal but they are present on
many keyboards.

Also reorganize the named key constants a bit.  Between F500 and
ENCODE_DIRECT_BASE (F600) we have space for 256 named keys.
2025-01-06 05:43:22 +01:00
Lzu Tao
f9b79926f1 Add more convenient key bindings for VI mode
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.
2025-01-05 23:00:21 +08:00
David Adam
6c3150aa05 docs/interactive: update key bindings added for 4.0 2025-01-05 22:27:00 +08:00
Johannes Altmanninger
07dd088d76 Bind ctrl-l to clear-screen again for now
Testing has revealed some problems on BSD and Windows terminals and
the Linux Console, let's revert to the old implementation until these
are fixed.  Leaving the changelog entry for now since it shouldn't
take long.

See #11003
2025-01-05 08:20:53 +01:00
Johannes Altmanninger
93e0a33d41 Log human-readable values also for not-yet-decoded bytes 2025-01-05 03:37:31 +01:00
Stefan Boca
dcddffd222
refactor: misc cleanup (#10998)
* refactor EnvVar: Arc<Box<[WString]>> -> Arc<[WString]>

* remove unnecessary `&mut` from EnvVar methods

* clippy: use eq_ignore_ascii_case instead of manual comparison

see https://rust-lang.github.io/rust-clippy/master/index.html#manual_ignore_case_cmp

* clippy: use `is_some_and` and `is_ok_and` instead of `map_or`

see https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or

* clippy: use `assert!()` instead of `assert_eq!()` with booleans
2025-01-04 19:49:44 -06:00
cornmander
d842a6560e
Add completions for Google Cloud commands. (#11005)
The `gcloud` and `gsutil` Google Cloud commands use argcomplete, so integrating them is easy with the `__fish_argcomplete_complete` function.
2025-01-04 19:45:05 -06:00
Mahmoud Al-Qudsi
b4e8cc8b79 Use explicit Timeout enum instead of magic constants
The FdReadableSet api was always intended to be converted to use Duration
instead of usec/msec once the ffi was removed. This lets us be explicit about
forever/infinite timeouts and removes the (small) chance of a collision between
u64::MAX and INFINITE.

I tried this out with `type Timeout = Option<Duration>` (only without the alias)
but was unhappy with easy it is to accidentally use `None` when you meant a
timeout of zero.
2025-01-04 18:40:36 -06:00
Mahmoud Al-Qudsi
83eb25d45f Mark function as test-only 2025-01-04 17:29:09 -06:00
Lzu Tao
7eb254f2ba Add completion for gem-fetch 2025-01-04 21:26:03 +08:00
idealseal
2e12a2b6c4 feat(comp): Update completions for resolvectl 2025-01-04 20:42:31 +08:00