Added Kitty Multicursor Support#14757
Conversation
Add support for kitty's multiple cursors protocol to show real terminal cursors at all selection positions when using bar/underline cursors.
These include fixes in files not in the original kitty commit in order to get a clean bill of health from cargo clippy.
| // Detect kitty multi-cursor support (available in kitty >= 0.43.0) | ||
| if matches!( | ||
| term_program().as_deref(), | ||
| Some("kitty") | Some("xterm-kitty") |
There was a problem hiding this comment.
I think this detection should be changed to how its described in the kitty docs, otherwise other terminals supporting this feature will not be able to use it out of the box -> https://github.com/kovidgoyal/kitty/blob/master/docs/multiple-cursors-protocol.rst#querying-for-support
There was a problem hiding this comment.
I believe Termina lacks the capability at the moment. I'll work on a pull request there to add it.
| write!(self.terminal, "\x1b[>0;4 q")?; | ||
|
|
||
| if !cursors.is_empty() { | ||
| write!(self.terminal, "\x1b[>29")?; // Shape 29 = follow main cursor | ||
| for (x, y) in cursors { | ||
| write!(self.terminal, ";2:{}:{}", y + 1, x + 1)?; // 1-indexed coords | ||
| } | ||
| write!(self.terminal, " q")?; |
There was a problem hiding this comment.
These commands belong in Termina too, we shouldn't be writing escape sequences as literal text
There was a problem hiding this comment.
Gotcha, I'll update the termina pull request
Use Cursor instead of manually writing escape sequences
| #[derive(Debug, Clone, Copy, Eq, PartialEq, PartialOrd, Ord, Serialize, Deserialize, Default)] | ||
| #[serde(rename_all = "lowercase")] | ||
| pub enum Severity { | ||
| #[default] | ||
| Hint, | ||
| Info, | ||
| Warning, | ||
| Error, | ||
| } | ||
|
|
||
| impl Default for Severity { | ||
| fn default() -> Self { | ||
| Self::Hint | ||
| } | ||
| } | ||
|
|
There was a problem hiding this comment.
It looks like this and other changes (like slice_from_raw_parts_mut below) are unrelated and are probably lints from newer versions of Rust. If you install Rust using rustup it will respect the version set in rust-toolchain.toml. We keep an MSRV that is intentionally older, see https://github.com/helix-editor/helix/blob/master/docs/CONTRIBUTING.md#minimum-stable-rust-version-msrv-policy
These extra changes should be reset
|
Any updates on this? |
|
Now that #15857 has been merged, can we please add this too before cutting the new release so that we finally get cursor animations? |
Added support for kitty's multiple cursors protocol to show real terminal cursors at all selection positions.
This closes/addresses issue #14517