aboutsummaryrefslogtreecommitdiff
path: root/terminal.c
diff options
context:
space:
mode:
Diffstat (limited to 'terminal.c')
-rw-r--r--terminal.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/terminal.c b/terminal.c
index 06eac0d6..8a7dd826 100644
--- a/terminal.c
+++ b/terminal.c
@@ -3084,7 +3084,7 @@ term_osc8_close(struct terminal *term)
int r = start.row;
int start_col = start.col;
- do {
+ while (true) {
int end_col = r == end.row ? end.col : term->cols - 1;
struct row *row = term->grid->rows[r];
@@ -3121,7 +3121,13 @@ term_osc8_close(struct terminal *term)
}
#endif
start_col = 0;
- } while (r++ != end.row);
+
+ if (r == end.row)
+ break;
+
+ r++;
+ r &= term->grid->num_rows - 1;
+ }
done:
free(term->vt.osc8.uri);