diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2021-01-14 13:41:34 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2021-01-14 13:41:34 +0000 |
| commit | 5efd34c3c408602544e9884954316638b32c2c3f (patch) | |
| tree | b8276f03880088737ca33d970f9f4b10d86fa15e /sixel.c | |
| parent | changelog: superceded -> superseded (diff) | |
sixel: current geometry: don’t exceed current window dimensions
This is similar to what XTerm does, and fixes an issue with lsix,
where the output did not wrap.
Diffstat (limited to 'sixel.c')
| -rw-r--r-- | sixel.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -1145,7 +1145,8 @@ sixel_geometry_report_current(struct terminal *term) { char reply[64]; snprintf(reply, sizeof(reply), "\033[?2;0;%u;%uS", - term->sixel.max_width, term->sixel.max_height); + min(term->cols * term->cell_width, term->sixel.max_width), + min(term->rows * term->cell_height, term->sixel.max_height)); term_to_slave(term, reply, strlen(reply)); LOG_DBG("query response for current sixel geometry: %ux%u", |
