mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-15 22:05:24 -05:00
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.
This commit is contained in:
parent
20ff492d33
commit
0e6b1f7508
1 changed files with 5 additions and 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--;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue