diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2021-02-14 16:13:46 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2021-02-21 19:15:31 +0000 |
| commit | 0e6b1f7508e9f2e683227d42964c1c7092eb181a (patch) | |
| tree | 87323f7f4c13bbcaf259ea3d901583169609d7f6 | |
| parent | term: osc-8: open: typo: close previous URL if ‘begin’ coords are *non-negative* (diff) | |
term: osc-8: close: ignore zero-length URLs
If the client application emitted e.g:
\E]8;;http://foo\E\\\E]8;;\E\\
i.e. an anchor without content, then we ended up with an ‘end’
coordinate that lied *before* the ‘start’ coordinate, since we
subtract one (column) from the end point to make it inclusive.
| -rw-r--r-- | terminal.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -3047,6 +3047,11 @@ term_osc8_close(struct terminal *term) .row = grid_row_absolute(term->grid, term->grid->cursor.point.row), }; + if (start.row == end.row && start.col == end.col) { + /* Zero-length URL, e.g: \E]8;;http://foo\E\\\E]8;;\E\\ */ + goto done; + } + /* end is *inclusive */ if (--end.col < 0) { end.row--; |
