Skip to content

Commit 0772a01

Browse files
committed
More docs for extra cursors
1 parent bacd13d commit 0772a01

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

docs/multiple-cursors-protocol.rst

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,4 +147,24 @@ Interaction with other terminal controls and state
147147
only by this protocol.
148148

149149
**Clearing the screen**
150-
150+
The escape codes used to clear the screen (`ED <https://vt100.net/docs/vt510-rm/ED.html>`__)
151+
with parameters 2, 3 and 22 must remove all extra cursors,
152+
this is so that the clear command can be used by users to clear the screen of extra cursors.
153+
154+
**Reset***
155+
This must remove all extra cursors.
156+
157+
**Alternate screen***
158+
Switching between the main and alternate screens must remove all extra
159+
cursors.
160+
161+
**Scrolling**
162+
The index (IND) and reverse index (RI) escape codes that cause screen
163+
contents to scroll into scrollback or off screen must not affect
164+
the extra cursors in any way. They remain at exactly the same position.
165+
It is upto applications to manage extra cursor positions when using these
166+
escape codes if needed. There are not a lot of use cases for scrolling
167+
extra cursors with screne content, since extra cursors are meant to be
168+
ephemeral and on screen only, not in scrollback. This allows terminals
169+
to avoid the extra overhead of adjusting positions of the extra cursors
170+
on every scroll.

kitty/screen.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ static Line* range_line_(Screen *self, int y);
174174
void
175175
screen_reset(Screen *self) {
176176
screen_pause_rendering(self, false, 0);
177+
self->extra_cursors.count = 0;
177178
self->main_pointer_shape_stack.count = 0; self->alternate_pointer_shape_stack.count = 0;
178179
if (self->linebuf == self->alt_linebuf) screen_toggle_screen_buffer(self, true, true);
179180
if (screen_is_overlay_active(self)) {

0 commit comments

Comments
 (0)