Fix --hold always restoring cursor to block shape instead of respecting the value of cursor_shape

This commit is contained in:
Kovid Goyal
2025-02-18 20:21:07 +05:30
parent 359d9e12e8
commit 375583259a
4 changed files with 12 additions and 4 deletions

View File

@@ -618,6 +618,7 @@ parse_kitty_dcs(PS *self, uint8_t *buf, size_t bufsz) {
dispatch("ask|", handle_remote_askpass, 0)
dispatch("clone|", handle_remote_clone, 0)
dispatch("edit|", handle_remote_edit, 0)
dispatch("restore-cursor-appearance|", handle_restore_cursor_appearance, 0)
return false;
#undef dispatch

View File

@@ -1524,6 +1524,13 @@ class Window:
text = process_remote_print(msg)
print(text, end='', flush=True)
def handle_restore_cursor_appearance(self, msg: memoryview | None = None) -> None:
opts = get_options()
self.screen.cursor.blink = opts.cursor_blink_interval[0] != 0
self.screen.cursor.shape = opts.cursor_shape
self.screen.cursor_visible = True
delattr(self.screen.color_profile, 'cursor_color')
def send_cmd_response(self, response: Any) -> None:
self.screen.send_escape_code_to_child(ESC_DCS, '@kitty-cmd' + json.dumps(response))