feat: emit multi-cursor positions via kitty protocol with auto-detection#15475
Closed
pierloh wants to merge 3 commits into
Closed
feat: emit multi-cursor positions via kitty protocol with auto-detection#15475pierloh wants to merge 3 commits into
pierloh wants to merge 3 commits into
Conversation
Author
Contributor
|
dupe of #14757 |
Emit cursor positions via kitty multi-cursor protocol (CSI > 29 ; ... SP q) after each render frame. Handles normal mode (cursor hidden via DECTCEM), insert mode single selection (native cursor), and multi-selection (all cursors via protocol). Viewport-clipped, truncated at 64 cursors. Config: kitty-multi-cursor (auto/enabled/disabled) Implemented for both crossterm and termina backends. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add Auto variant to KittyMultiCursorConfig (default), matching kitty keyboard protocol config pattern - Probe terminal via CSI > SP q with 100ms timeout on /dev/tty - Add supports_multi_cursor_protocol() to crossterm backend (OnceCell) - Update termina detect_capabilities for Auto probing - Skip redundant per-frame clear emissions via had_extra_cursors state - Fix clear sequence to CSI > 0 SP q (drop unnecessary ;4) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
4948f91 to
83e2f7d
Compare
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Member
|
There is existing work on this in #14757, I would prefer to continue there. We should not be writing literal escape sequences in the helix codebase. Instead escape sequences should be covered by types in termina (also see helix-editor/termina#14). |
Author
|
Makes sense, thanks for having a look. Will checkout this other PR in coming days. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Emits cursor positions to the terminal using the kitty multiple cursors protocol (
CSI > 29 ; 2:row:col ... SP q), enabling terminals with custom shader support to render visual effects at cursor locations.What it does
restore()Auto-detection
Probes terminal support at startup by sending the protocol's detection query (
CSI > SP q) via/dev/ttywith a 100ms timeout. Works through multiplexers like zellij that forward the query.Config
Follows the same three-way config pattern as
kitty-keyboard-protocol.Implementation
helix-tui/src/backend/mod.rs: sequence builder + Unix probe functionhelix-tui/src/backend/crossterm.rs:OnceCell-based lazy detectionhelix-tui/src/backend/termina.rs: detection during capability probinghelix-term/src/application.rs: cursor collection + emission with state trackingTested with a custom Alacritty build (terminal side) and zellij fork (multiplexer pass-through).