Commit Graph

20252 Commits

Author SHA1 Message Date
Fabian Boehm
6627d403d3 tests: Override __fish_print_help
This effectively disables "--help", replacing it with just a stand-in
string.

The upshot is that it makes the test suite immune to whether or not it
can find the documentation - until now it needed to *not* find it,
which is weird.

(also it saves some useless lines)

Fixes #11270
2025-03-13 18:13:10 +01:00
Fabian Boehm
7224776f80 staticbuilds: Build fish_indent/key_reader binaries to test 2025-03-13 16:38:21 +01:00
Fabian Boehm
6d93e6324a staticbuilds: Rename files
Use x86_64 instead of amd64 because that's what uname calls it,
and try to get the version in there.
2025-03-13 16:32:41 +01:00
David Adam
1477bf7a54 CHANGELOG: fix formatting 2025-03-13 15:48:52 +08:00
David Adam
298d79ef58 CHANGELOG: actually #10838 is out entirely 2025-03-13 12:04:15 +08:00
David Adam
3a86f8e6c7 CHANGELOG: correct version that #10838 is in 2025-03-13 12:01:14 +08:00
David Adam
a1b50b1a0e Merge branch 'Integration_4.0.1' 2025-03-13 12:00:31 +08:00
David Adam
67b6afffd4 Release 4.0.1 4.0.1 2025-03-13 11:16:55 +08:00
David Adam
6df88e1a9f CHANGELOG: work on 4.0.1 2025-03-13 10:59:58 +08:00
David Adam
f8202408f9 cmake: specify MSRV 2025-03-13 10:47:47 +08:00
Johannes Altmanninger
61884bda36 Fix GitHub Actions build now that images come with ninja
Looks like the github actions image now has ninja installed.
This causes a failure; we effectively do

	$ (
		mkdir build && cd build
		cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo
	  )
	$ make VERBOSE=1
	[...]
	cd build; cmake .. -G "Ninja" \
		-DCMAKE_INSTALL_PREFIX="/usr/local" -DCMAKE_EXPORT_COMPILE_COMMANDS=1
	Re-run cmake no build system arguments
	CMake Error: Error: generator : Ninja
	Does not match the generator used previously: Unix Makefiles
	Either remove the CMakeCache.txt file and CMakeFiles directory or choose a different binary directory.

"make" fails because it runs from top-level, with GNUMakefile's logic to
use -GNinja if available.  This is at odds with the direct cmake invocation,
which defaults to -G'Unix Makefiles'.

We shouldn't mix direct cmake invocation and the top-level Makefiles, so
run make from the build directory instead.

While at it, update some test invocations missed in 8d6fdfd9de
(Remove cmake "test" target, 2025-02-02).  This should
help avoid missing test failure output in CI, see
https://github.com/fish-shell/fish-shell/issues/11116#issuecomment-2629406479

(cherry picked from commit b0be53ed6a)
2025-03-13 10:36:28 +08:00
David Adam
66584dadcc CHANGELOG: work on 4.0.1 2025-03-12 23:28:29 +08:00
Johannes Altmanninger
d2cf002e64 Note that only rustup<=1.27 works OOTB for bisecting
See b38551dde9 (Drag FindRust.cmake back into the land of the living,
2025-03-05).
2025-03-12 08:40:44 +01:00
David Adam
5944518e6e docs/fish_title: add example on disabling title changing
Work on #11241.

(cherry picked from commit 3c8e058b75)
2025-03-12 14:39:33 +08:00
David Adam
3c8e058b75 docs/fish_title: add example on disabling title changing
Work on #11241.
2025-03-12 14:36:40 +08:00
Johannes Altmanninger
19502ff9e7 Add hack to fix off-by-one error in Vi-mode cancel-commandline
The new cursor-end-mode "inclusive" (which is active in Vi mode) is causing
many issues.

One of them is because cancel-commandline wants to move to the end of the
command line before printing "^C".  Since "inclusive" cursor mode prevents
the cursor from moving past the last character, that one will be overwritten
with a "^".  Hack around this.

Closes #11261

(cherry picked from commit b08ff33291)
2025-03-11 20:24:04 +01:00
Johannes Altmanninger
b08ff33291 Add hack to fix off-by-one error in Vi-mode cancel-commandline
The new cursor-end-mode "inclusive" (which is active in Vi mode) is causing
many issues.

One of them is because cancel-commandline wants to move to the end of the
command line before printing "^C".  Since "inclusive" cursor mode prevents
the cursor from moving past the last character, that one will be overwritten
with a "^".  Hack around this.

Closes #11261
2025-03-11 20:23:30 +01:00
Johannes Altmanninger
5b94af6367 Restore cursor shape when deactivating Vi mode
Running

	fish_vi_key_bindings
	fish_default_key_bindings

ought to maintain cursor shape, at least in the default configuration,
so let's do that.

Fixes 9ef76860e6 (Default Vi cursor shapes for insert/replace mode, 2024-10-26).
2025-03-11 20:22:27 +01:00
lengyijun
18c4ee4b41 cleanup: rm strange code block 2025-03-11 20:01:49 +01:00
Johannes Altmanninger
b0be53ed6a Fix GitHub Actions build now that images come with ninja
Looks like the github actions image now has ninja installed.
This causes a failure; we effectively do

	$ (
		mkdir build && cd build
		cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo
	  )
	$ make VERBOSE=1
	[...]
	cd build; cmake .. -G "Ninja" \
		-DCMAKE_INSTALL_PREFIX="/usr/local" -DCMAKE_EXPORT_COMPILE_COMMANDS=1
	Re-run cmake no build system arguments
	CMake Error: Error: generator : Ninja
	Does not match the generator used previously: Unix Makefiles
	Either remove the CMakeCache.txt file and CMakeFiles directory or choose a different binary directory.

"make" fails because it runs from top-level, with GNUMakefile's logic to
use -GNinja if available.  This is at odds with the direct cmake invocation,
which defaults to -G'Unix Makefiles'.

We shouldn't mix direct cmake invocation and the top-level Makefiles, so
run make from the build directory instead.

While at it, update some test invocations missed in 8d6fdfd9de
(Remove cmake "test" target, 2025-02-02).  This should
help avoid missing test failure output in CI, see
https://github.com/fish-shell/fish-shell/issues/11116#issuecomment-2629406479
2025-03-11 00:46:41 +01:00
Johannes Altmanninger
e37e1b8f78 Fix regression causing glitches when prompt has control character
Since commit 0627c9d9af (Render control characters as Unicode Control Pictures,
2020-08-29), we render control character in the commandline as "␇" etc.
They can be inserted via either history search, or bindings such as

	bind ctrl-g "commandline -i \a"

That commit incorrectly assumes that the prompt is rendered the same way as
the command line (which goes through "ScreenData" etc).
This is wrong -- prompt text is written to stdout as-is, and a prompt that
outputs \t (tab) or \a (BEL) is valid.  The wrong assumption means that we
overestimate the width of prompts containing control characters.

(For some reason, after switching from Vi insert to Vi normal mode, we seem
to get the width right which means the command line jumps around)

Let's revert to the old width computation for any prompt text.

Closes #11252

(cherry picked from commit 4d81cf8af4)
2025-03-11 00:03:34 +01:00
Johannes Altmanninger
4d81cf8af4 Fix regression causing glitches when prompt has control character
Since commit 0627c9d9af (Render control characters as Unicode Control Pictures,
2020-08-29), we render control character in the commandline as "␇" etc.
They can be inserted via either history search, or bindings such as

	bind ctrl-g "commandline -i \a"

That commit incorrectly assumes that the prompt is rendered the same way as
the command line (which goes through "ScreenData" etc).
This is wrong -- prompt text is written to stdout as-is, and a prompt that
outputs \t (tab) or \a (BEL) is valid.  The wrong assumption means that we
overestimate the width of prompts containing control characters.

(For some reason, after switching from Vi insert to Vi normal mode, we seem
to get the width right which means the command line jumps around)

Let's revert to the old width computation for any prompt text.

Closes #11252
2025-03-11 00:03:12 +01:00
Johannes Altmanninger
5d31be1c3e Fix regression causing crash on empty paste in Vi-mode
Fixes d51f669647 (Vi mode: avoid placing cursor beyond last character,
2024-02-14).

Closes #11256

(cherry picked from commit 2b4f150883)
2025-03-10 22:38:38 +01:00
Johannes Altmanninger
2b4f150883 Fix regression causing crash on empty paste in Vi-mode
Fixes d51f669647 (Vi mode: avoid placing cursor beyond last character,
2024-02-14).

Closes #11256
2025-03-10 22:28:40 +01:00
Johannes Altmanninger
ea6e819a33 completions/set: add fish_cursor_* variables 2025-03-10 22:28:40 +01:00
metamuffin
7a959723ef Print newline on path warnings to stderr instead of stdout (Rust port regression)
(cherry picked from commit 4227f534b4)
2025-03-09 14:13:44 +01:00
metamuffin
4227f534b4 Print newline on path warnings to stderr instead of stdout 2025-03-09 14:12:32 +01:00
Peter Ammon
7d3b157f13 Allow sprintf! macros to accept format string only
This allows something like `sprintf!("foo")`. Previously this was a compile time
error.

Fixes #11243
2025-03-08 20:26:03 -08:00
Peter Ammon
ad0feab86c Fix a Sphinx warning 2025-03-08 10:53:06 -08:00
Peter Ammon
2ecd0d011b Fix some clipplies 2025-03-08 10:52:27 -08:00
Johannes Altmanninger
ad7631093d Remove assertion about history items
For unknown reasons this assertion fails.  This means that 1b9b893169 (After
reading corrupted history entry, keep reading older entries, 2024-10-06)
is not fully working.  Go back to historical behavior for now.

Closes #11236

(cherry picked from commit 4f80e5cb54)
2025-03-08 13:14:44 +01:00
Johannes Altmanninger
2930c85926 Add hack to restore cursor position on undo ofter exec again
See f2dde229aa (Revert changes to restore cursor position after undo,
2025-03-05).

I think there are two problems with tmux when doing a final redraw of a
larger-than-screen commandline.  One is easy to trigger independent of
f2dde229aa.  The other is reproduced by the broken output in the tmux test
removed by that commit. Should root-cause them later.

Use a hack for now; this also happens to fix the broken output in tmux.
2025-03-08 13:12:38 +01:00
Johannes Altmanninger
4f80e5cb54 Remove assertion about history items
For unknown reasons this assertion fails.  This means that 1b9b893169 (After
reading corrupted history entry, keep reading older entries, 2024-10-06)
is not fully working.  Go back to historical behavior for now.

Closes #11236
2025-03-08 13:12:23 +01:00
Johannes Altmanninger
bd8d268255 Extend midnight commander workaround for when numlock/capslock is active
Midnight Commander 4.8.33 knows how to read the CSI u encoding of ctrl-o
(which is the only key it reads while the shell is in control).  But it fails
to when numlock or capslock is active.  Let's disable the kitty keyboard
protocol again until mc indicates that this is fixed.

Closes #10640

The other issue talked about in that issue is an unrelated mc issue, see
https://github.com/MidnightCommander/mc/issues/4597#issuecomment-2705900024
2025-03-07 12:14:56 +01:00
Niklas Liechti
90218821f9 Split content of *KnownHostsFile as this is a supported config option by ssh. 2025-03-06 21:53:30 -08:00
phanium
6e8d6328ee completions/flatpak: don't ignore packages with uppercase in name (#11230)
* completions/flatpak: don't ignore packages with uppercase in name

`[^A-Z]+` here seems to trim header section in old version flatpak (avoid one
more `tail -n -2`?) but this can ignore packages have uppercase name like
`org.gtk.Gtk3theme.Adwaita-dark`.

* completions/flatpak: use cached `__fish_print_flatpak_packages` for `flatpak install`
2025-03-06 21:39:10 -08:00
Peter Ammon
83f29ed09c Drag FindRust.cmake back into the land of the living
rustup has changed its output for 'rustup toolchain list --verbose`.
Teach FindRust.cmake about it, so that it may shamble on.

Cherry-picked from b38551dde9
2025-03-06 10:05:54 -08:00
Fabian Boehm
aca6836103 CHANGELOG add links 2025-03-06 11:37:19 +01:00
Peter Ammon
cc455ff976 Revert "CI: Disable FreeBSD"
With the prior commit, CMake and rustup can continue to talk to each other, for
now.

This reverts commit b69a1b2ffe.
2025-03-05 22:05:00 -08:00
Peter Ammon
b38551dde9 Drag FindRust.cmake back into the land of the living
rustup has changed its output for 'rustup toolchain list --verbose`.
Teach FindRust.cmake about it, so that it may shamble on.

This was reported against BSD and also affects macOS and ALSO affects Linux; our
CI just doesn't have a new enough rustup. Anyways we can't have nice things.
2025-03-05 21:53:54 -08:00
Peter Ammon
f2dde229aa Revert changes to restore cursor position after undo
This feature is nice and desirable, but it was implemented in a intrusive way
by modifying the sequence of bytes we emit when running a command; this in
turn requires changing a bunch of tests.

This sequence hasn't changed in decades and the consequences of changing it
are hard to predict, given that it is likely terminal dependent; we've
already found a regression.

It's fine to reintroduce this but it should be done in a less intrusive way
(conceptually that seems straightforward - we're just remembering the cursor
position).

Revert "Fix spurious blank lines when executing scrolled commandline"

This reverts commit 0e512f8033.

Revert "On undo after execute, restore the cursor position "

This reverts commit 610338cc70.
2025-03-05 17:57:48 -08:00
Peter Ammon
c9f1979b05 Revert "On undo after execute, restore the cursor position"
This reverts commit 815bc054e7.

This is too ambitious for a patch release, given that it affects how every
typed-in command runs.
2025-03-05 15:54:20 -08:00
Peter Ammon
4a35c48ce5 Changelog fix for 11221 2025-03-05 14:11:17 -08:00
Gabriel de Perthuis
f336cf5624 Fix dirent->d_name usage
Closes https://github.com/fish-shell/fish-shell/issues/11221

(cherry picked from commit a0dada5618)
2025-03-05 22:35:01 +01:00
Fabian Boehm
30fa57022a docs: Switch link from gitter to matrix
Gitter is now useless,  matrix is a known thing that people may have
clients and accounts for already
2025-03-05 22:34:38 +01:00
Gabriel de Perthuis
a0dada5618 Fix dirent->d_name usage
Closes https://github.com/fish-shell/fish-shell/issues/11221
2025-03-05 13:29:46 -08:00
Johannes Altmanninger
4ff94b657f __fish_apropos: fixup broken macOS version check
Due to the parens, this prints the version twice.  Fixes 49023adec7
(Consolidate some calls to uname(1) around shell startup, 2025-03-05).
2025-03-05 14:30:06 +01:00
Johannes Altmanninger
1504731d53 Backout new assertion to support old Rust
error[E0015]: cannot call non-const fn `zeroed::<libc::statfs>` in constants
	   --> src/path.rs:712:35
	    |
	712 |             let f_type = unsafe { mem::zeroed::<libc::statfs>() }.f_type;
	    |                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	    |
	    = note: calls in constants are limited to constant functions, tuple structs and tuple variants

	error: `std::mem::size_of_val` is not yet stable as a const fn
	   --> src/path.rs:713:13
	    |
	713 |             mem::size_of_val(&f_type) <= mem::size_of::<usize>()
	    |             ^^^^^^^^^^^^^^^^^^^^^^^^^

(cherry picked from commit 54f9778003)
2025-03-05 13:02:53 +01:00
Johannes Altmanninger
54f9778003 Backout new assertion to support old Rust
error[E0015]: cannot call non-const fn `zeroed::<libc::statfs>` in constants
	   --> src/path.rs:712:35
	    |
	712 |             let f_type = unsafe { mem::zeroed::<libc::statfs>() }.f_type;
	    |                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	    |
	    = note: calls in constants are limited to constant functions, tuple structs and tuple variants

	error: `std::mem::size_of_val` is not yet stable as a const fn
	   --> src/path.rs:713:13
	    |
	713 |             mem::size_of_val(&f_type) <= mem::size_of::<usize>()
	    |             ^^^^^^^^^^^^^^^^^^^^^^^^^
2025-03-05 13:02:31 +01:00
Johannes Altmanninger
9dce68fab4 Fix crash on negative stat f_type (Rust-port regression)
Fixes #11219

(cherry picked from commit e5852a6100)
2025-03-05 12:34:59 +01:00