Report cursor rows relative to the origin margin

This commit is contained in:
Hassan Raza 2026-10-17 13:37:52 +05:00
parent 7e936d87e0
commit d6061b4270
No known key found for this signature in database
2 changed files with 3 additions and 1 deletions

View file

@ -231,6 +231,8 @@ Detailed list of changes
0.50.0 [future]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Fix cursor position reports returning the wrong row in origin mode
- macOS: A new option :opt:`restore_session_after_logout` to save the state of
every kitty instance, including the scrollback of every window, encrypted with
a key in the keychain, when logging out, restarting or shutting down the

View file

@ -3284,7 +3284,7 @@ report_device_status(Screen *self, unsigned int which, bool private) {
y++;
} else x--;
}
if (self->modes.mDECOM) y -= MAX(y, self->margin_top);
if (self->modes.mDECOM) y -= MIN(y, self->margin_top);
// 1-based indexing
int sz = snprintf(buf, sizeof(buf) - 1, "%s%u;%uR", (private ? "?" : ""), y + 1, x + 1);
if (sz > 0) write_escape_code_to_child(self, ESC_CSI, buf);