mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-04 04:06:06 -05:00
term: mouse SGR mode: don't emit negative CSI values
When reporting the column/row pixel value in mouse SGR mode, we emitted negative values when the cursor was being dragged outside the window. Unfortunately, negative values aren't allowed in CSI parameters, as '-' is an intermediate value. It was done this way, to be consistent with XTerm behavior. Allegedly, XTerm has changed its behavior in patch 404. With that in mind, and seeing that foot has never emitted negative values in any other mouse mode, let's stop emitting negative values in SGR mode too. Closes #2226
This commit is contained in:
parent
ac6d7660dd
commit
6e533231b0
2 changed files with 8 additions and 2 deletions
|
|
@ -85,8 +85,11 @@
|
|||
state is ([#2202][2202]).
|
||||
* Scrollback search is now case sensitive when the search string
|
||||
contains at least one upper case character.
|
||||
* Mouse tracking in SGR pixel mode no longer emits negative column/row
|
||||
pixel values ([#2226][2226]).
|
||||
|
||||
[2202]: https://codeberg.org/dnkl/foot/issues/2202
|
||||
[2226]: https://codeberg.org/dnkl/foot/issues/2226
|
||||
|
||||
|
||||
### Deprecated
|
||||
|
|
|
|||
|
|
@ -3420,10 +3420,13 @@ report_mouse_click(struct terminal *term, int encoded_button, int row, int col,
|
|||
encoded_button, col + 1, row + 1, release ? 'm' : 'M');
|
||||
break;
|
||||
|
||||
case MOUSE_SGR_PIXELS:
|
||||
case MOUSE_SGR_PIXELS: {
|
||||
const int bounded_col = max(col_pixels, 0);
|
||||
const int bounded_row = max(row_pixels, 0);
|
||||
snprintf(response, sizeof(response), "\033[<%d;%d;%d%c",
|
||||
encoded_button, col_pixels + 1, row_pixels + 1, release ? 'm' : 'M');
|
||||
encoded_button, bounded_col + 1, bounded_row + 1, release ? 'm' : 'M');
|
||||
break;
|
||||
}
|
||||
|
||||
case MOUSE_URXVT:
|
||||
snprintf(response, sizeof(response), "\033[%d;%d;%dM",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue