diff --git a/docs/changelog.rst b/docs/changelog.rst index 62138830a..f1d94e467 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -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 diff --git a/kitty/screen.c b/kitty/screen.c index c24d64293..17c035966 100644 --- a/kitty/screen.c +++ b/kitty/screen.c @@ -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);