From fd87bca102321e5804fef74dac8a6d267ae46732 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Sat, 13 Feb 2021 12:31:55 +0100 Subject: grid: enable rows to have ‘extra’ data associated with them MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch adds an ‘extra’ member to the row struct. It is a pointer to a struct containing extra data to be associated with this row. Initially, this struct contains a list of URL ranges. These define (OSC-8) URLs on this row. The ‘extra’ data is allocated on-demand. I.e. the pointer is NULL by default; it is *not* allocated by grid_row_alloc(). --- terminal.c | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) (limited to 'terminal.c') diff --git a/terminal.c b/terminal.c index 0051ca6d..17b985a8 100644 --- a/terminal.c +++ b/terminal.c @@ -2154,8 +2154,18 @@ term_scroll_partial(struct terminal *term, struct scroll_region region, int rows grid_swap_row(term->grid, i - rows, i); /* Erase scrolled in lines */ - for (int r = region.end - rows; r < region.end; r++) - erase_line(term, grid_row_and_alloc(term->grid, r)); + for (int r = region.end - rows; r < region.end; r++) { + struct row *row = grid_row_and_alloc(term->grid, r); + if (unlikely(row->extra != NULL)) { + tll_foreach(row->extra->uri_ranges, it) { + free(it->item.uri); + tll_remove(row->extra->uri_ranges, it); + } + free(row->extra); + row->extra = NULL; + } + erase_line(term, row); + } term_damage_scroll(term, DAMAGE_SCROLL, region, rows); term->grid->cur_row = grid_row(term->grid, term->grid->cursor.point.row); @@ -2222,8 +2232,18 @@ term_scroll_reverse_partial(struct terminal *term, grid_swap_row(term->grid, i, i - rows); /* Erase scrolled in lines */ - for (int r = region.start; r < region.start + rows; r++) - erase_line(term, grid_row_and_alloc(term->grid, r)); + for (int r = region.start; r < region.start + rows; r++) { + struct row *row = grid_row_and_alloc(term->grid, r); + if (unlikely(row->extra != NULL)) { + tll_foreach(row->extra->uri_ranges, it) { + free(it->item.uri); + tll_remove(row->extra->uri_ranges, it); + } + free(row->extra); + row->extra = NULL; + } + erase_line(term, row); + } term_damage_scroll(term, DAMAGE_SCROLL_REVERSE, region, rows); term->grid->cur_row = grid_row(term->grid, term->grid->cursor.point.row); -- cgit v1.3 From 841e5f0e50a65bc4787ba06a642355cf4fb514a5 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Sat, 13 Feb 2021 12:34:11 +0100 Subject: terminal: add OSC-8 state tracking to the VT sub-struct --- terminal.c | 6 ++++++ terminal.h | 14 ++++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) (limited to 'terminal.c') diff --git a/terminal.c b/terminal.c index 17b985a8..28c061ca 100644 --- a/terminal.c +++ b/terminal.c @@ -1102,6 +1102,9 @@ term_init(const struct config *conf, struct fdm *fdm, struct reaper *reaper, .blink = {.fd = -1}, .vt = { .state = 0, /* STATE_GROUND */ + .osc8 = { + .begin = {-1, -1}, + }, }, .colors = { .fg = conf->colors.fg, @@ -1645,6 +1648,9 @@ term_reset(struct terminal *term, bool hard) free(term->vt.osc.data); memset(&term->vt, 0, sizeof(term->vt)); term->vt.state = 0; /* GROUND */ + term->vt.osc8.begin = (struct coord){-1, -1}; + free(term->vt.osc8.uri); + term->vt.osc8.uri = NULL; if (term->grid == &term->alt) { term->grid = &term->normal; diff --git a/terminal.h b/terminal.h index 7df92efc..3f58180b 100644 --- a/terminal.h +++ b/terminal.h @@ -155,12 +155,24 @@ struct vt { struct vt_param v[16]; uint8_t idx; } params; + uint32_t private; /* LSB=priv0, MSB=priv3 */ + + struct attributes attrs; + struct attributes saved_attrs; + struct { uint8_t *data; size_t size; size_t idx; } osc; + + /* Start coordinate for current OSC-8 URI */ + struct { + struct coord begin; + char *uri; + } osc8; + struct { uint8_t *data; size_t size; @@ -168,8 +180,6 @@ struct vt { void (*put_handler)(struct terminal *term, uint8_t c); void (*unhook_handler)(struct terminal *term); } dcs; - struct attributes attrs; - struct attributes saved_attrs; }; enum cursor_origin { ORIGIN_ABSOLUTE, ORIGIN_RELATIVE }; -- cgit v1.3 From 682494d45a50e81aec0618bdd2d282ad17fe27d5 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Sat, 13 Feb 2021 12:34:48 +0100 Subject: terminal: add term_osc8_{open,close} functions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These functions update the OSC-8 URI state in the terminal. term_osc8_open() tracks the beginning of an URL, by storing the start coordinate (i.e. the current cursor location), along with the URL itself. Note that term_osc8_open() may not be called with an empty URL. This is important to notice, since the way OSC-8 works, applications close an URL by “opening” a new, empty one: \E]8;;https://foo.bar\e\\this is an OSC-8 URL\E]8;;\e\\ It is up to the caller to check for this, and call term_osc8_close() instead of term_osc8_open() when the URL is empty. However, it is *also* valid to switch directly from one URL to another: \E]8;;http://123\e\\First URL\E]8;;http//456\e\\Second URL\E]8;;\e\\ This use-case *is* handled by term_osc8_open(). term_osc8_close() uses the information from term_osc8_open() to add per-row URL data (using the new ‘extra’ row data). --- terminal.c | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ terminal.h | 3 +++ 2 files changed, 57 insertions(+) (limited to 'terminal.c') diff --git a/terminal.c b/terminal.c index 28c061ca..c6afbef1 100644 --- a/terminal.c +++ b/terminal.c @@ -3015,3 +3015,57 @@ term_ime_set_cursor_rect(struct terminal *term, int x, int y, int width, #endif } +void +term_osc8_open(struct terminal *term, const char *uri) +{ + if (unlikely(term->vt.osc8.begin.row < 0)) { + /* It’s valid to switch from one URI to another without + * closing the first one */ + term_osc8_close(term); + } + + term->vt.osc8.begin = (struct coord){ + .col = term->grid->cursor.point.col, + .row = grid_row_absolute(term->grid, term->grid->cursor.point.row), + }; + term->vt.osc8.uri = xstrdup(uri); +} + +void +term_osc8_close(struct terminal *term) +{ + if (term->vt.osc8.begin.row < 0) + return; + + if (term->vt.osc8.uri[0] == '\0') + goto done; + + struct coord start = term->vt.osc8.begin; + struct coord end = (struct coord){ + .col = term->grid->cursor.point.col, + .row = grid_row_absolute(term->grid, term->grid->cursor.point.row), + }; + + int r = start.row; + int start_col = start.col; + do { + int end_col = r == end.row ? end.col : term->cols - 1; + + struct row *row = term->grid->rows[r]; + if (row->extra == NULL) + row->extra = xcalloc(1, sizeof(*row->extra)); + + struct row_uri_range range = { + .start = start_col, + .end = end_col, + .uri = xstrdup(term->vt.osc8.uri), + }; + tll_push_back(row->extra->uri_ranges, range); + start_col = 0; + } while (r++ != end.row); + +done: + free(term->vt.osc8.uri); + term->vt.osc8.uri = NULL; + term->vt.osc8.begin = (struct coord){-1, -1}; +} diff --git a/terminal.h b/terminal.h index 3f58180b..6dc211d9 100644 --- a/terminal.h +++ b/terminal.h @@ -689,3 +689,6 @@ void term_ime_set_cursor_rect( void term_urls_reset(struct terminal *term); void term_collect_urls(struct terminal *term); + +void term_osc8_open(struct terminal *term, const char *uri); +void term_osc8_close(struct terminal *term); -- cgit v1.3 From b934969b858d8874e480cc9ee7f4ccf5657f6f2a Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Sat, 13 Feb 2021 13:44:07 +0100 Subject: term: add ‘id’ parameter to term_osc8_open() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The current OSC-8 URL’s ID is now tracked along with the URI itself, and its starting point. --- osc.c | 2 +- terminal.c | 4 +++- terminal.h | 5 +++-- 3 files changed, 7 insertions(+), 4 deletions(-) (limited to 'terminal.c') diff --git a/osc.c b/osc.c index fb4f15d6..b57bdd6c 100644 --- a/osc.c +++ b/osc.c @@ -433,7 +433,7 @@ osc_uri(struct terminal *term, char *string) if (uri[0] == '\0') term_osc8_close(term); else - term_osc8_open(term, uri); + term_osc8_open(term, id, uri); } static void diff --git a/terminal.c b/terminal.c index c6afbef1..218882f0 100644 --- a/terminal.c +++ b/terminal.c @@ -3016,7 +3016,7 @@ term_ime_set_cursor_rect(struct terminal *term, int x, int y, int width, } void -term_osc8_open(struct terminal *term, const char *uri) +term_osc8_open(struct terminal *term, uint64_t id, const char *uri) { if (unlikely(term->vt.osc8.begin.row < 0)) { /* It’s valid to switch from one URI to another without @@ -3028,6 +3028,7 @@ term_osc8_open(struct terminal *term, const char *uri) .col = term->grid->cursor.point.col, .row = grid_row_absolute(term->grid, term->grid->cursor.point.row), }; + term->vt.osc8.id = id; term->vt.osc8.uri = xstrdup(uri); } @@ -3066,6 +3067,7 @@ term_osc8_close(struct terminal *term) done: free(term->vt.osc8.uri); + term->vt.osc8.id = 0; term->vt.osc8.uri = NULL; term->vt.osc8.begin = (struct coord){-1, -1}; } diff --git a/terminal.h b/terminal.h index 6dc211d9..733fc92d 100644 --- a/terminal.h +++ b/terminal.h @@ -169,8 +169,9 @@ struct vt { /* Start coordinate for current OSC-8 URI */ struct { - struct coord begin; + uint64_t id; char *uri; + struct coord begin; } osc8; struct { @@ -690,5 +691,5 @@ void term_ime_set_cursor_rect( void term_urls_reset(struct terminal *term); void term_collect_urls(struct terminal *term); -void term_osc8_open(struct terminal *term, const char *uri); +void term_osc8_open(struct terminal *term, uint64_t id, const char *uri); void term_osc8_close(struct terminal *term); -- cgit v1.3 From ffbee5ff372787c13e68d413173ff2e3ba270b80 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Sat, 13 Feb 2021 13:44:58 +0100 Subject: term: add an ‘id’ member to the the ‘row_uri_range’ struct MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit term_osc8_close() sets it from the OSC-8 ID tracked in the VT sub-struct. --- terminal.c | 1 + terminal.h | 1 + 2 files changed, 2 insertions(+) (limited to 'terminal.c') diff --git a/terminal.c b/terminal.c index 218882f0..9051c566 100644 --- a/terminal.c +++ b/terminal.c @@ -3059,6 +3059,7 @@ term_osc8_close(struct terminal *term) struct row_uri_range range = { .start = start_col, .end = end_col, + .id = term->vt.osc8.id, .uri = xstrdup(term->vt.osc8.uri), }; tll_push_back(row->extra->uri_ranges, range); diff --git a/terminal.h b/terminal.h index 733fc92d..69c7c2ea 100644 --- a/terminal.h +++ b/terminal.h @@ -89,6 +89,7 @@ struct composed { struct row_uri_range { int start; int end; + uint64_t id; char *uri; }; -- cgit v1.3 From 663c43c139a4cc9405dde4d0d2e4d45eeac78e92 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Sat, 13 Feb 2021 14:16:53 +0100 Subject: term_osc8_close(): the URL *end* column is inclusive --- terminal.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'terminal.c') diff --git a/terminal.c b/terminal.c index 9051c566..efd260f1 100644 --- a/terminal.c +++ b/terminal.c @@ -3047,6 +3047,12 @@ term_osc8_close(struct terminal *term) .row = grid_row_absolute(term->grid, term->grid->cursor.point.row), }; + /* end is *inclusive */ + if (--end.col < 0) { + end.row--; + end.col = term->cols - 1; + } + int r = start.row; int start_col = start.col; do { -- cgit v1.3 From 20ff492d3341d73c43d0dfbfbb10ea0aac7deeaf Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Sun, 14 Feb 2021 17:12:43 +0100 Subject: term: osc-8: open: typo: close previous URL if ‘begin’ coords are *non-negative* MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- terminal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'terminal.c') diff --git a/terminal.c b/terminal.c index efd260f1..d9834f9e 100644 --- a/terminal.c +++ b/terminal.c @@ -3018,7 +3018,7 @@ term_ime_set_cursor_rect(struct terminal *term, int x, int y, int width, void term_osc8_open(struct terminal *term, uint64_t id, const char *uri) { - if (unlikely(term->vt.osc8.begin.row < 0)) { + if (unlikely(term->vt.osc8.begin.row >= 0)) { /* It’s valid to switch from one URI to another without * closing the first one */ term_osc8_close(term); -- cgit v1.3 From 0e6b1f7508e9f2e683227d42964c1c7092eb181a Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Sun, 14 Feb 2021 17:13:46 +0100 Subject: term: osc-8: close: ignore zero-length URLs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- terminal.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'terminal.c') diff --git a/terminal.c b/terminal.c index d9834f9e..3e2eb97f 100644 --- a/terminal.c +++ b/terminal.c @@ -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--; -- cgit v1.3 From 3e06362d74ebd68e9d6d675f8feb0daaa9610bf6 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Sun, 14 Feb 2021 20:33:59 +0100 Subject: terminal: scroll: use grid_row_reset_extra() --- terminal.c | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) (limited to 'terminal.c') diff --git a/terminal.c b/terminal.c index 3e2eb97f..52494c90 100644 --- a/terminal.c +++ b/terminal.c @@ -2162,14 +2162,7 @@ term_scroll_partial(struct terminal *term, struct scroll_region region, int rows /* Erase scrolled in lines */ for (int r = region.end - rows; r < region.end; r++) { struct row *row = grid_row_and_alloc(term->grid, r); - if (unlikely(row->extra != NULL)) { - tll_foreach(row->extra->uri_ranges, it) { - free(it->item.uri); - tll_remove(row->extra->uri_ranges, it); - } - free(row->extra); - row->extra = NULL; - } + grid_row_reset_extra(row); erase_line(term, row); } @@ -2240,14 +2233,7 @@ term_scroll_reverse_partial(struct terminal *term, /* Erase scrolled in lines */ for (int r = region.start; r < region.start + rows; r++) { struct row *row = grid_row_and_alloc(term->grid, r); - if (unlikely(row->extra != NULL)) { - tll_foreach(row->extra->uri_ranges, it) { - free(it->item.uri); - tll_remove(row->extra->uri_ranges, it); - } - free(row->extra); - row->extra = NULL; - } + grid_row_reset_extra(row); erase_line(term, row); } -- cgit v1.3 From 7f13d0084ea9498fb0cfb705724e4ee7212922ac Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Sun, 14 Feb 2021 20:50:55 +0100 Subject: terminal: osc8_close(): refactor: use grid_row_add_uri_range() --- terminal.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'terminal.c') diff --git a/terminal.c b/terminal.c index 52494c90..ce311c3d 100644 --- a/terminal.c +++ b/terminal.c @@ -3049,17 +3049,13 @@ term_osc8_close(struct terminal *term) do { int end_col = r == end.row ? end.col : term->cols - 1; - struct row *row = term->grid->rows[r]; - if (row->extra == NULL) - row->extra = xcalloc(1, sizeof(*row->extra)); - struct row_uri_range range = { .start = start_col, .end = end_col, .id = term->vt.osc8.id, .uri = xstrdup(term->vt.osc8.uri), }; - tll_push_back(row->extra->uri_ranges, range); + grid_row_add_uri_range(term->grid->rows[r], range); start_col = 0; } while (r++ != end.row); -- cgit v1.3 From 2074f8b6563b7a6331c94a9231cd5b5af8bd7ade Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Sun, 14 Feb 2021 21:29:22 +0100 Subject: urls: OSC-8 URLs can now optionally be underlined outside of url-mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch adds a new configuration option, ‘osc8-underline=url-mode|always’. When set to ‘url-mode’, OSC-8 URLs are only highlighted (i.e. underlined) in url-mode, just like auto-detected URLs. When set to ‘always’, they are always underlined, regardless of mode, and regardless of their other attributes. This is implemented by tagging collected URLs with a boolean, instructing urls_render() and urls_reset() whether they should update the cells’ ‘url’ attribute or not. The OSC-8 collecter sets this based on the value of ‘osc8-underline’. Finally, when closing an OSC-8 URL, the cells are immediately tagged with the ‘url’ attribute if ‘osc8-underline’ is set to ‘always’. --- config.c | 15 +++++++++++++++ config.h | 5 +++++ doc/foot.ini.5.scd | 14 +++++++++++++- foot.ini | 1 + terminal.c | 14 +++++++++++++- terminal.h | 1 + url-mode.c | 18 +++++++++++++++++- 7 files changed, 65 insertions(+), 3 deletions(-) (limited to 'terminal.c') diff --git a/config.c b/config.c index c2eaf382..d7d2c3a1 100644 --- a/config.c +++ b/config.c @@ -791,6 +791,19 @@ parse_section_main(const char *key, const char *value, struct config *conf, return false; } + else if (strcmp(key, "osc8-underline") == 0) { + if (strcmp(value, "url-mode") == 0) + conf->osc8_underline = OSC8_UNDERLINE_URL_MODE; + else if (strcmp(value, "always") == 0) + conf->osc8_underline = OSC8_UNDERLINE_URL_MODE; + else { + LOG_AND_NOTIFY_ERR( + "%s:%u: [default]: %s: invalid 'osc8-underline'; " + "must be one of 'url-mode', or 'always'", path, lineno, value); + return false; + } + } + else { LOG_AND_NOTIFY_ERR("%s:%u: [default]: %s: invalid key", path, lineno, key); return false; @@ -2243,6 +2256,8 @@ config_load(struct config *conf, const char *conf_path, .argv = NULL, }, + .osc8_underline = OSC8_UNDERLINE_ALWAYS, + .tweak = { .fcft_filter = FCFT_SCALING_FILTER_LANCZOS3, .allow_overflowing_double_width_glyphs = true, diff --git a/config.h b/config.h index 69930ec0..e8d15859 100644 --- a/config.h +++ b/config.h @@ -205,6 +205,11 @@ struct config { struct config_spawn_template notify; struct config_spawn_template url_launch; + enum { + OSC8_UNDERLINE_URL_MODE, + OSC8_UNDERLINE_ALWAYS, + } osc8_underline; + struct { enum fcft_scaling_filter fcft_filter; bool allow_overflowing_double_width_glyphs; diff --git a/doc/foot.ini.5.scd b/doc/foot.ini.5.scd index cdcdcfaa..3108c750 100644 --- a/doc/foot.ini.5.scd +++ b/doc/foot.ini.5.scd @@ -241,13 +241,25 @@ in this order: Clipboard target to automatically copy selected text to. One of *none*, *primary*, *clipboard* or *both*. Default: _primary_. - *workers* Number of threads to use for rendering. Set to 0 to disable multithreading. Default: the number of available logical CPUs (including SMT). Note that this is not always the best value. In some cases, the number of physical _cores_ is better. +*osc8-underline* + When to underline OSC-8 URLs. Possible values are *url-mode* and + *always*. + + When set to *url-mode*, OSC-8 URLs are only highlighted in URL + mode, just like auto-detected URLs. + + When set to *always*, OSC-8 URLs are always highlighted, + regardless of their other attributes (bold, italic etc). Note that + this does _not_ make them clickable. + + Default: _url-mode_ + # SECTION: scrollback diff --git a/foot.ini b/foot.ini index 1b309210..8ea060c9 100644 --- a/foot.ini +++ b/foot.ini @@ -29,6 +29,7 @@ # jump-label-letters=sadfjklewcmpgh # selection-target=primary # workers= +# osc8-underline=url-mode [scrollback] # lines=1000 diff --git a/terminal.c b/terminal.c index ce311c3d..3710f005 100644 --- a/terminal.c +++ b/terminal.c @@ -3049,13 +3049,25 @@ term_osc8_close(struct terminal *term) do { int end_col = r == end.row ? end.col : term->cols - 1; + struct row *row = term->grid->rows[r]; + + switch (term->conf->osc8_underline) { + case OSC8_UNDERLINE_ALWAYS: + for (int c = start_col; c <= end_col; c++) + row->cells[c].attrs.url = true; + break; + + case OSC8_UNDERLINE_URL_MODE: + break; + } + struct row_uri_range range = { .start = start_col, .end = end_col, .id = term->vt.osc8.id, .uri = xstrdup(term->vt.osc8.uri), }; - grid_row_add_uri_range(term->grid->rows[r], range); + grid_row_add_uri_range(row, range); start_col = 0; } while (r++ != end.row); diff --git a/terminal.h b/terminal.h index 7d6d0616..acff9d06 100644 --- a/terminal.h +++ b/terminal.h @@ -256,6 +256,7 @@ struct url { struct coord start; struct coord end; enum url_action action; + bool url_mode_dont_change_url_attr; /* Entering/exiting URL mode doesn’t touch the cells’ attr.url */ }; typedef tll(struct url) url_list_t; diff --git a/url-mode.c b/url-mode.c index 09e170e6..a441aa86 100644 --- a/url-mode.c +++ b/url-mode.c @@ -374,6 +374,18 @@ UNIGNORE_WARNINGS static void osc8_uris(const struct terminal *term, enum url_action action, url_list_t *urls) { + bool dont_touch_url_attr = false; + + switch (term->conf->osc8_underline) { + case OSC8_UNDERLINE_URL_MODE: + dont_touch_url_attr = false; + break; + + case OSC8_UNDERLINE_ALWAYS: + dont_touch_url_attr = true; + break; + } + for (int r = 0; r < term->rows; r++) { const struct row *row = grid_row_in_view(term->grid, r); @@ -396,7 +408,8 @@ osc8_uris(const struct terminal *term, enum url_action action, url_list_t *urls) .url = xstrdup(it->item.uri), .start = start, .end = end, - .action = action})); + .action = action, + .url_mode_dont_change_url_attr = dont_touch_url_attr})); } } } @@ -542,6 +555,9 @@ urls_assign_key_combos(const struct config *conf, url_list_t *urls) static void tag_cells_for_url(struct terminal *term, const struct url *url, bool value) { + if (url->url_mode_dont_change_url_attr) + return; + const struct coord *start = &url->start; const struct coord *end = &url->end; -- cgit v1.3