This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch tymux-12-session-parity
in repository terminology.

View the commit online.

commit edba1d35952bbfde00f9d7093ecafa2c3138ad44
Author: Cedric BAIL <[email protected]>
AuthorDate: Sun Nov 22 20:18:26 2026 -0600

    termd_tymux: publish hyperlink targets to clients
    
    Cells in a session carry only the daemon's link id, so OSC 8 links
    could not be followed from a native client. The daemon now publishes
    each link in the session table, and a client reads it the first time
    it needs it.
    
    The daemon reuses an id as soon as it is free, so a client must never
    take an old cell for the new link. An entry only applies from the
    frame it was published for, a hover remembers the URL it showed, and a
    delayed click opens only the URL that was clicked. A click whose link
    was redrawn during the delay now does nothing rather than risk opening
    another one.
    
    Clients also refuse a screen memfd that is short or not sealed against
    shrinking, as a read of the table would otherwise raise SIGBUS.
    
    tybenchd -i 5 1000000, no links, release build, median of 5 iterations,
    3 interleaved runs:
      before: 0.349 0.354 0.350 s
      after:  0.348 0.351 0.350 s
---
 man/tymux.1               |  10 +--
 src/bin/termd_tymux.c     |  51 +++++++++++
 src/bin/termio.c          | 105 ++++++++++++++++------
 src/bin/termiointernals.h |   4 +
 src/bin/termpty.c         |   3 +
 src/bin/termpty.h         |  58 +++++++++++-
 src/bin/termptyesc.c      |   3 +
 src/bin/termsrv.c         |  37 ++++++++
 src/bin/termsrv.h         |   5 ++
 src/bin/termsrv_table.c   |  34 +++++++
 src/bin/termsrv_table.h   |   5 ++
 src/bin/termtymux.c       | 224 ++++++++++++++++++++++++++++++++++++++++++++++
 src/bin/termtymux.h       |   4 +
 src/bin/tymux.c           |   6 ++
 src/bin/tytest.c          |   4 +
 src/bin/tytest_tymux.c    | 185 ++++++++++++++++++++++++++++++++++++++
 src/bin/tytest_tymux.h    |   1 +
 src/bin/unit_tests.h      |   3 +
 tests/meson.build         |   6 ++
 19 files changed, 713 insertions(+), 35 deletions(-)

diff --git a/man/tymux.1 b/man/tymux.1
index 2ccfacfd..eaac9ecc 100644
--- a/man/tymux.1
+++ b/man/tymux.1
@@ -206,8 +206,9 @@ closes the terminal, like any other terminal whose shell exited.
 A terminal a native hand-off (see \fBNATIVE HAND\-OFF\fP) attaches to has
 its own scrollback: it reads the lines the daemon keeps in shared memory,
 mapping only the part it shows, so scrolling, selection, search and the
-miniview work on it like on any other terminal. Hyperlinks in that backlog
-are not: the daemon does not send the link targets, only inert text. A
+miniview work on it like on any other terminal, and so do hyperlinks, whose
+targets the daemon shares through the same memory (a link whose target does not
+fit in the shared table is plain text). A
 terminal that attaches keeps as many of the lines the daemon holds as its
 own scrollback setting allows, the oldest ones being dropped first; the
 daemon itself holds as many as the scrollback setting of Terminology's
@@ -226,9 +227,8 @@ other commands introduced by ESC }) and color scheme changes (OSC 4, 10,
 11 and 12) are ignored in a session, and desktop notifications (OSC 99
 and 777) are not forwarded, because the daemon that emulates the session
 drops them.
-Hyperlinks (OSC 8) have no destination in either mode: the inline proxy
-draws them as plain text, and a native hand-off receives only their
-index in the daemon, not their target, so they cannot be followed.
+Hyperlinks (OSC 8) work in a native hand-off, which reads their targets from
+the daemon; the inline proxy draws them as plain text.
 .PP
 The size of a session is capped at 1920 columns by 1280 rows in both
 modes: a larger terminal leaves the excess blank.
diff --git a/src/bin/termd_tymux.c b/src/bin/termd_tymux.c
index be57633a..057a1291 100644
--- a/src/bin/termd_tymux.c
+++ b/src/bin/termd_tymux.c
@@ -1,6 +1,7 @@
 #include "private.h"
 #include <errno.h>
 #include <fcntl.h>
+#include <stdatomic.h>
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
@@ -76,6 +77,7 @@ struct tag_TermDTymux
    Config           *config;
    int               shm_fd;
    TermSrvShmHeader *shm;
+   TermSrvTableWriter *table;
    Eina_List        *clients;
    /* clients paused by a hijack, most recent first */
    Eina_List        *paused;
@@ -110,6 +112,49 @@ _screen_flush(TermDTymux *td)
    return termsrv_shm_write_end(shm);
 }
 
+/* The record of a link is its key and its URL, each ended by a NUL: the key
+ * is empty when the link has none. It is valid from the next frame. */
+static void
+_cb_pty_record(void *data, Termpty *ty, TermSrvTableKind kind, uint32_t id,
+               Eina_Bool alive)
+{
+   TermDTymux *td = data;
+   const Term_Link *link;
+   const char *key;
+   char stack[1024], *record = stack;
+   size_t key_len, url_len;
+   uint64_t valid_from;
+
+   if (kind != TERMSRV_TABLE_LINK)
+     return;
+   if (!alive)
+     {
+        termsrv_table_unpublish(td->table, kind, id);
+        return;
+     }
+   link = ty->hl.links + id;
+   key = link->key ? link->key : "";
+   key_len = strlen(key);
+   url_len = strlen(link->url);
+   if (key_len + url_len + 2 > sizeof(stack))
+     {
+        record = malloc(key_len + url_len + 2);
+        if (!record)
+          {
+             termsrv_table_unpublish(td->table, kind, id);
+             return;
+          }
+     }
+   memcpy(record, key, key_len + 1);
+   memcpy(record + key_len + 1, link->url, url_len + 1);
+   valid_from = atomic_load_explicit(&td->shm->write_seq,
+                                     memory_order_relaxed) + 2;
+   termsrv_table_publish(td->table, kind, id, record,
+                         key_len + url_len + 2, valid_from);
+   if (record != stack)
+     free(record);
+}
+
 static void _client_del(Client *client);
 static void _client_pages_prune(Client *client);
 static void _client_free(Client *client);
@@ -946,6 +991,9 @@ termd_tymux_new(const char *name, const char *cmd)
    rw_fd = -1;
    td->shm->magic = TERMSRV_SHM_MAGIC;
    td->shm->version = TERMSRV_SHM_VERSION;
+   td->table = termsrv_table_writer_new(TERMSRV_SHM_TABLE(td->shm));
+   if (!td->table)
+     goto err;
 
    td->pty = termpty_new(cmd, EINA_FALSE, NULL, 80, 24, td->config, name, 0);
    if (!td->pty)
@@ -958,6 +1006,8 @@ termd_tymux_new(const char *name, const char *cmd)
    td->pty->cb.bell.data = ""
    td->pty->cb.exited.func = _cb_pty_exited;
    td->pty->cb.exited.data = ""
+   td->pty->record_hook.func = _cb_pty_record;
+   td->pty->record_hook.data = ""
    /* termpty_new() made no store for the scrollback of 0 it was given:
     * the session's is in memfds, for the clients to map */
    termpty_backlog_store_backing_set(td->pty, BACKLOG_STORE_MEMFD);
@@ -1009,6 +1059,7 @@ termd_tymux_free(TermDTymux *td)
    eina_list_free(td->paused);
    if (td->pty)
      termpty_free(td->pty);
+   termsrv_table_writer_free(td->table);
    if (td->shm)
      munmap(td->shm, TERMSRV_SHM_TOTAL_SIZE);
    if (td->shm_fd >= 0)
diff --git a/src/bin/termio.c b/src/bin/termio.c
index 4f498c57..81191833 100644
--- a/src/bin/termio.c
+++ b/src/bin/termio.c
@@ -992,6 +992,20 @@ _should_inline(const Evas_Object *obj)
    return EINA_TRUE;
 }
 
+/* The link of the id under the pointer, if it still has the target the user
+ * was shown. Otherwise the hover is dropped, so that nothing acts on a target
+ * the user did not see. */
+static Term_Link *
+_link_shown_get(Termio *sd)
+{
+   Term_Link *hl = term_link_get(sd->pty, sd->link.id);
+
+   if (term_link_has_url(hl, sd->link.url))
+     return hl;
+   termio_remove_links(sd);
+   return NULL;
+}
+
 /*
  * Returned string needs to be freed.
  * Does not handle colors */
@@ -1011,8 +1025,9 @@ termio_link_get(const Evas_Object *obj,
    link = sd->link.string;
    if (sd->link.id)
      {
-        Term_Link *hl = term_link_get(sd->pty, sd->link.id);
-        if (!hl || !hl->url)
+        Term_Link *hl = _link_shown_get(sd);
+
+        if (!hl)
           return NULL;
         link = hl->url;
         if (from_escape_code)
@@ -1476,10 +1491,14 @@ _cb_ctxp_link_content_copy(void *data,
 
    if (sd->link.id)
      {
-        Term_Link *hl = term_link_get(sd->pty, sd->link.id);
+        Term_Link *hl = _link_shown_get(sd);
 
-        if (!hl || !hl->url)
-          return;
+        if (!hl)
+          {
+             sd->ctxpopup = NULL;
+             evas_object_del(obj);
+             return;
+          }
         _termio_set_selection_text(sd, ELM_SEL_TYPE_CLIPBOARD, hl->url);
      }
    else
@@ -1487,6 +1506,13 @@ _cb_ctxp_link_content_copy(void *data,
         struct ty_sb sb = {.buf = NULL, .len = 0, .alloc = 0};
         char *raw_link;
 
+        /* a render dropped the link while the menu was open */
+        if (!sd->link.string || sd->link.x1 < 0)
+          {
+             sd->ctxpopup = NULL;
+             evas_object_del(obj);
+             return;
+          }
         termio_selection_get(sd,
                              sd->link.x1, sd->link.y1,
                              sd->link.x2, sd->link.y2,
@@ -1508,7 +1534,12 @@ _cb_ctxp_link_copy(void *data,
    Evas_Object *term = data;
    Termio *sd = evas_object_smart_data_get(term);
    EINA_SAFETY_ON_NULL_RETURN(sd);
-   EINA_SAFETY_ON_NULL_RETURN(sd->link.string);
+   if (!sd->link.string || (sd->link.id && !_link_shown_get(sd)))
+     {
+        sd->ctxpopup = NULL;
+        evas_object_del(obj);
+        return;
+     }
    _termio_set_selection_text(sd, ELM_SEL_TYPE_CLIPBOARD, sd->link.string);
 
    sd->ctxpopup = NULL;
@@ -1688,12 +1719,13 @@ _cb_link_down(void *data,
    Term_Link *hl = NULL;
 
 
-   if (!sd->link.string && sd->link.id)
+   if (sd->link.id)
      {
-        hl = term_link_get(sd->pty, sd->link.id);
-        if (!hl || !hl->url)
+        hl = _link_shown_get(sd);
+        if (!hl)
           return;
-        sd->link.string = eina_stringshare_add(hl->url);
+        if (!sd->link.string)
+          sd->link.string = eina_stringshare_add(hl->url);
      }
 
    if (ev->button == 1)
@@ -1706,6 +1738,15 @@ _cb_link_down(void *data,
      {
         Evas_Object *ctxp;
 
+        if (!sd->link.is_color && sd->pty->selection.is_active)
+          {
+             int cx = 0, cy = 0;
+
+             termio_cursor_to_xy(sd, ev->canvas.x, ev->canvas.y, &cx, &cy);
+             if (_mouse_in_selection(sd, cx, cy))
+               return;
+          }
+
         ctxp = elm_ctxpopup_add(sd->win);
         sd->ctxpopup = ctxp;
 
@@ -1742,16 +1783,6 @@ _cb_link_down(void *data,
              const char *raw_link;
              size_t len;
 
-             if (sd->pty->selection.is_active)
-               {
-                  int cx = 0, cy = 0;
-
-                  termio_cursor_to_xy(sd, ev->canvas.x, ev->canvas.y, &cx, &cy);
-                  if (_mouse_in_selection(sd, cx, cy))
-                    return;
-               }
-
-
              if (hl)
                {
                   raw_link = hl->url;
@@ -1821,7 +1852,11 @@ _cb_link_up_delay(void *data)
    EINA_SAFETY_ON_NULL_RETURN_VAL(sd, EINA_FALSE);
 
    sd->link_do_timer = NULL;
-   if (!sd->didclick) _activate_link(data, EINA_TRUE);
+   if (!sd->didclick &&
+       term_link_activation_ok(sd->link_do_url, sd->link.string))
+     _activate_link(data, EINA_TRUE);
+   eina_stringshare_del(sd->link_do_url);
+   sd->link_do_url = NULL;
    sd->didclick = EINA_FALSE;
    return EINA_FALSE;
 }
@@ -1848,8 +1883,12 @@ _cb_link_up(void *data,
           {
              if (sd->link_do_timer)
                ecore_timer_reset(sd->link_do_timer);
-             else
-               sd->link_do_timer = ecore_timer_add(0.2, _cb_link_up_delay, data);
+             else if (sd->link.string)
+               {
+                  sd->link_do_url = eina_stringshare_ref(sd->link.string);
+                  sd->link_do_timer = ecore_timer_add(0.2, _cb_link_up_delay,
+                                                      data);
+               }
           }
         sd->link.down.down = EINA_FALSE;
      }
@@ -2094,6 +2133,8 @@ termio_remove_links(Termio *sd)
 
    eina_stringshare_del(sd->link.string);
    sd->link.string = NULL;
+   eina_stringshare_del(sd->link.url);
+   sd->link.url = ""
 
    sd->link.x1 = -1;
    sd->link.y1 = -1;
@@ -2101,6 +2142,7 @@ termio_remove_links(Termio *sd)
    sd->link.y2 = -1;
    sd->link.suspend = 0;
    sd->link.id = 0;
+   sd->link.down.down = EINA_FALSE;
    sd->link.is_color = EINA_FALSE;
    sd->link.color.r = 0;
    sd->link.color.g = 0;
@@ -2150,8 +2192,12 @@ _hyperlink_mouseover(Termio *sd,
    EINA_SAFETY_ON_NULL_RETURN(sd);
 
    /* If it's the same link, consider we already have the correct links
-    * displayed */
-   if (sd->link.id == link_id)
+    * displayed, unless the id has a new target since */
+   if (term_link_hover_keep(sd->link.id, link_id,
+                            term_link_has_url(term_link_get(sd->pty, link_id),
+                                              sd->link.url),
+                            sd->link_do_timer || sd->ctxpopup ||
+                            sd->link.down.down))
      return;
 
    if (sd->link.suspend)
@@ -2161,8 +2207,9 @@ _hyperlink_mouseover(Termio *sd,
    sd->link.id = link_id;
 
    hl = term_link_get(sd->pty, link_id);
-   if (!hl || !hl->url)
+   if (!hl)
      return;
+   sd->link.url = ""
 
    /* Scan the whole screen and display links as needed */
    termio_object_geometry_get(sd, &ox, &oy, &ow, &oh);
@@ -3015,6 +3062,10 @@ _smart_mouseover_apply(Termio *sd)
    EINA_SAFETY_ON_NULL_RETURN(sd);
    config = sd->config;
 
+   /* the menu acts on the link it was opened for */
+   if (sd->ctxpopup)
+     return;
+
    if ((sd->mouse.cx < 0) || (sd->mouse.cy < 0) ||
        (sd->link.suspend) || (!term_is_focused(sd->term)))
      {
@@ -3934,6 +3985,7 @@ _smart_del(Evas_Object *obj)
    if (sd->anim) ecore_animator_del(sd->anim);
    if (sd->delayed_size_timer) ecore_timer_del(sd->delayed_size_timer);
    if (sd->link_do_timer) ecore_timer_del(sd->link_do_timer);
+   eina_stringshare_del(sd->link_do_url);
    if (sd->mouse_move_job) ecore_job_del(sd->mouse_move_job);
    if (sd->mouseover_delay) ecore_timer_del(sd->mouseover_delay);
    if (sd->progress_stale_timer) ecore_timer_del(sd->progress_stale_timer);
@@ -3956,6 +4008,7 @@ _smart_del(Evas_Object *obj)
    if (sd->pty) termpty_free(sd->pty);
 #endif
    eina_stringshare_del(sd->link.string);
+   eina_stringshare_del(sd->link.url);
    if (sd->glayer) evas_object_del(sd->glayer);
    if (sd->win)
      evas_object_event_callback_del_full(sd->win, EVAS_CALLBACK_DEL,
diff --git a/src/bin/termiointernals.h b/src/bin/termiointernals.h
index cf92b015..0e40556a 100644
--- a/src/bin/termiointernals.h
+++ b/src/bin/termiointernals.h
@@ -68,6 +68,8 @@ struct tag_Termio
    } mouse;
    struct {
       const char *string;
+      /* the target id had when the hover started, as shown to the user */
+      const char *url;
       int x1, y1, x2, y2;
       Eina_Bool is_color;
       int suspend;
@@ -158,6 +160,8 @@ struct tag_Termio
    Ecore_Animator *anim;
    Ecore_Timer *delayed_size_timer;
    Ecore_Timer *link_do_timer;
+   /* the target link_do_timer was armed for */
+   const char *link_do_url;
    Ecore_Timer *mouse_selection_scroll_timer;
    Ecore_Job *mouse_move_job;
    Ecore_Timer *mouseover_delay;
diff --git a/src/bin/termpty.c b/src/bin/termpty.c
index 08d1cb9c..b5aa314a 100644
--- a/src/bin/termpty.c
+++ b/src/bin/termpty.c
@@ -2185,6 +2185,9 @@ term_link_free(Termpty *ty, Term_Link *link)
      return;
    uint16_t id = (link - ty->hl.links);
 
+   if (EINA_UNLIKELY(ty->record_hook.func != NULL) && link->url)
+     ty->record_hook.func(ty->record_hook.data, ty, TERMSRV_TABLE_LINK,
+                          id, EINA_FALSE);
    eina_stringshare_del(link->key);
    link->key = NULL;
    eina_stringshare_del(link->url);
diff --git a/src/bin/termpty.h b/src/bin/termpty.h
index 26338886..a3aefd3e 100644
--- a/src/bin/termpty.h
+++ b/src/bin/termpty.h
@@ -4,6 +4,7 @@
 #include "config.h"
 #include "media.h"
 #include "sb.h"
+#include "termsrv_table.h"
 
 typedef struct tag_Termcell      Termcell;
 typedef struct tag_Termatt       Termatt;
@@ -362,6 +363,18 @@ struct tag_Termpty
        uint8_t *bitmap;
        uint32_t size;
    } hl;
+   /* tymuxd only: a link or block was created, or is about to be freed */
+   struct {
+      void (*func) (void *data, Termpty *ty, TermSrvTableKind kind,
+                    uint32_t id, Eina_Bool alive);
+      void *data;
+   } record_hook;
+   /* Shadow ptys only: refreshes hl.links[id] from the session table before
+    * term_link_get() returns it. */
+   struct {
+      void (*link) (void *data, Termpty *ty, uint16_t id);
+      void *data;
+   } resolver;
    TitleIconElem *title_icon_stack;
    /* OSC 99 notifications still waiting for their last chunk, oldest first */
    Eina_List *notify_pending;
@@ -502,11 +515,21 @@ void term_link_free_if_unused(Termpty *ty, uint16_t link_id);
 void term_link_table_drop_if_empty(Termpty *ty);
 
 /* The link link_id, NULL for none, or for an id the table, dropped since,
- * no longer holds. */
+ * no longer holds. With a resolver, NULL too when the session has no
+ * target for the id. */
 static inline Term_Link *
 term_link_get(Termpty *ty, uint16_t link_id)
 {
-   if (!link_id || (link_id >= ty->hl.size))
+   if (!link_id)
+     return NULL;
+   if (EINA_UNLIKELY(ty->resolver.link != NULL))
+     {
+        Term_Link *link = &ty->hl.links[link_id];
+
+        ty->resolver.link(ty->resolver.data, ty, link_id);
+        return link->url ? link : NULL;
+     }
+   if (link_id >= ty->hl.size)
      return NULL;
    return &ty->hl.links[link_id];
 }
@@ -742,13 +765,40 @@ term_link_eq(Termpty *ty, Term_Link *hl, uint16_t link_id)
     hl_id = hl - ty->hl.links;
     if (hl_id == link_id)
         return EINA_TRUE;
-    hl2 = &ty->hl.links[link_id];
-    if (!hl->key || !hl2->key ||
+    hl2 = term_link_get(ty, link_id);
+    if (!hl2 || !hl->key || !hl2->key ||
         strcmp(hl->key, hl2->key) != 0)
         return EINA_FALSE;
     return (strcmp(hl->url, hl2->url) == 0);
 }
 
+/* Whether link is still the target url, a stringshare taken from it: the
+ * daemon of a session may give an id a new target while the user holds the
+ * old one. */
+static inline Eina_Bool
+term_link_has_url(const Term_Link *link, const char *url)
+{
+   return link && url && (link->url == url);
+}
+
+/* Whether a hover on link id keeps the shown hover of shown_id. An action
+ * pending on it, such as a press or a menu, keeps it even when the id got a
+ * new target: the pin then stays stale and refuses the action. */
+static inline Eina_Bool
+term_link_hover_keep(uint16_t shown_id, uint16_t id, Eina_Bool target_same,
+                     Eina_Bool action_pending)
+{
+   return (shown_id == id) && (target_same || action_pending);
+}
+
+/* Whether the delayed activation of a click may open current: only the target
+ * the click was made on, which is a stringshare, and still shown. */
+static inline Eina_Bool
+term_link_activation_ok(const char *clicked, const char *current)
+{
+   return clicked && current && (clicked == current);
+}
+
 /* Copy dst[0] over dst[1] to dst[n - 1], doubling the copied span: a
  * per-cell struct assignment loop is compiled into a store-forwarding
  * stall per cell. */
diff --git a/src/bin/termptyesc.c b/src/bin/termptyesc.c
index d3ecd9d4..0192f6a1 100644
--- a/src/bin/termptyesc.c
+++ b/src/bin/termptyesc.c
@@ -4890,6 +4890,9 @@ _handle_hyperlink(Termpty *ty,
       goto end;
     hl->key = key;
     hl->url = ""
+    if (EINA_UNLIKELY(ty->record_hook.func != NULL))
+      ty->record_hook.func(ty->record_hook.data, ty, TERMSRV_TABLE_LINK,
+                           hl - ty->hl.links, EINA_TRUE);
     key = NULL;
     url = ""
 
diff --git a/src/bin/termsrv.c b/src/bin/termsrv.c
index ae07cb0e..b7a5152c 100644
--- a/src/bin/termsrv.c
+++ b/src/bin/termsrv.c
@@ -517,6 +517,18 @@ termsrv_msg_send_fd(int fd, TermSrvMsgType type,
    return _sendmsg_all(fd, &msg);
 }
 
+Eina_Bool
+termsrv_shm_fd_valid(int fd)
+{
+   struct stat st;
+   int seals;
+
+   if (fstat(fd, &st) < 0 || (size_t)st.st_size < TERMSRV_SHM_TOTAL_SIZE)
+     return EINA_FALSE;
+   seals = fcntl(fd, F_GET_SEALS);
+   return (seals >= 0) && (seals & F_SEAL_SHRINK);
+}
+
 int
 termsrv_fd_read_only(int fd)
 {
@@ -1005,6 +1017,31 @@ termsrv_reply_strip_flush(TermSrvReplyStrip *strip, Eina_Binbuf *out)
 #include <Elementary.h>
 #include "termpty.h"
 
+/* Test: the screen memfd of a daemon is refused when it is short or when its
+ * size is not sealed. */
+int
+tytest_termsrv_shm_fd_valid(void)
+{
+   int fd;
+
+   fd = memfd_create("test-shm", MFD_CLOEXEC | MFD_ALLOW_SEALING);
+   assert(fd >= 0);
+   assert(ftruncate(fd, TERMSRV_SHM_TOTAL_SIZE) == 0);
+   assert(!termsrv_shm_fd_valid(fd));
+   assert(termsrv_memfd_seal(fd) == 0);
+   assert(termsrv_shm_fd_valid(fd));
+   close(fd);
+
+   fd = memfd_create("test-shm", MFD_CLOEXEC | MFD_ALLOW_SEALING);
+   assert(fd >= 0);
+   assert(ftruncate(fd, TERMSRV_SHM_TOTAL_SIZE - 1) == 0);
+   assert(termsrv_memfd_seal(fd) == 0);
+   assert(!termsrv_shm_fd_valid(fd));
+   close(fd);
+   assert(!termsrv_shm_fd_valid(-1));
+   return 0;
+}
+
 /* Test: termsrv_chord_filter() forwards plain input untouched, drops the
  * detach chord, forwards Ctrl+b followed by anything else, and recognizes
  * a chord split across two calls. out is one Eina_Binbuf reused (and reset)
diff --git a/src/bin/termsrv.h b/src/bin/termsrv.h
index 49c1ec10..8620dd55 100644
--- a/src/bin/termsrv.h
+++ b/src/bin/termsrv.h
@@ -490,6 +490,11 @@ termsrv_memfd_seal(int fd)
  * error. */
 int termsrv_fd_read_only(int fd);
 
+/* Whether fd, the screen memfd a daemon handed over, holds the whole screen
+ * and table, and cannot shrink under a mapping: a peer that truncated it
+ * would make a read raise SIGBUS. */
+Eina_Bool termsrv_shm_fd_valid(int fd);
+
 /* Gathers the bytes of a connection until they make whole messages.
  * Zero it before use. */
 typedef struct
diff --git a/src/bin/termsrv_table.c b/src/bin/termsrv_table.c
index 089b6cef..bb9a6e64 100644
--- a/src/bin/termsrv_table.c
+++ b/src/bin/termsrv_table.c
@@ -336,6 +336,40 @@ termsrv_table_read(const void *table, TermSrvTableKind kind, uint32_t id,
    return -1;
 }
 
+uint32_t
+termsrv_table_generation_get(const void *table, TermSrvTableKind kind,
+                             uint32_t id, uint64_t shown_seq)
+{
+   const TermSrvTableSlot *slots = table;
+   const TermSrvTableSlot *slot;
+   size_t index;
+   int attempt;
+
+   if (!_slot_index(kind, id, &index)) return 0;
+   slot = &slots[index];
+
+   for (attempt = 0; attempt < READ_ATTEMPTS; attempt++)
+     {
+        uint32_t seq, gen;
+        uint64_t valid_from;
+
+        seq = atomic_load_explicit(&slot->seq, memory_order_acquire);
+        if (seq & 1)
+          {
+             sched_yield();
+             continue;
+          }
+        gen = atomic_load_explicit(&slot->generation, memory_order_relaxed);
+        valid_from = atomic_load_explicit(&slot->valid_from,
+                                          memory_order_relaxed);
+        atomic_thread_fence(memory_order_acquire);
+        if (atomic_load_explicit(&slot->seq, memory_order_relaxed) != seq)
+          continue;
+        return (valid_from > shown_seq) ? 0 : gen;
+     }
+   return 0;
+}
+
 #if defined(BINARY_TYTEST)
 #include <assert.h>
 #include <pthread.h>
diff --git a/src/bin/termsrv_table.h b/src/bin/termsrv_table.h
index d424a610..06c570c2 100644
--- a/src/bin/termsrv_table.h
+++ b/src/bin/termsrv_table.h
@@ -56,4 +56,9 @@ int termsrv_table_read(const void *table, TermSrvTableKind kind, uint32_t id,
                        uint64_t shown_seq, uint32_t *generation,
                        void **record, uint32_t *capacity, uint32_t *length);
 
+/* The generation of the entry of id for a frame of shown_seq, without
+ * copying its record: 0 when there is none, or the slot kept changing. */
+uint32_t termsrv_table_generation_get(const void *table, TermSrvTableKind kind,
+                                      uint32_t id, uint64_t shown_seq);
+
 #endif
diff --git a/src/bin/termtymux.c b/src/bin/termtymux.c
index 9d7c3a96..98e9b830 100644
--- a/src/bin/termtymux.c
+++ b/src/bin/termtymux.c
@@ -548,6 +548,76 @@ static const BacklogViewSource _backlog_source =
    _backlog_map_request
 };
 
+/* What a slot keeps of the link a record holds while cells count it */
+#define LINK_REFS_HELD (1u << 30)
+
+static void
+_link_slot_clear(Term_Link *link)
+{
+   eina_stringshare_del(link->key);
+   link->key = NULL;
+   eina_stringshare_del(link->url);
+   link->url = ""
+}
+
+/* A record is "key NUL url NUL", with an empty key for none. */
+static Eina_Bool
+_link_record_parse(const char *record, uint32_t length,
+                   const char **url, uint32_t *key_len, uint32_t *url_len)
+{
+   const char *key_end;
+
+   if (length < 2 || record[length - 1] != '\0')
+     return EINA_FALSE;
+   key_end = memchr(record, '\0', length);
+   if (key_end == record + length - 1)
+     return EINA_FALSE;
+   *key_len = key_end - record;
+   *url = "" + 1;
+   *url_len = length - *key_len - 2;
+   return !memchr(*url, '\0', *url_len);
+}
+
+/* Refreshes hl.links[id] when the table's entry for it changed since the
+ * last read, and empties it when the table has none for the frame on show. */
+static void
+_link_resolve(void *data, Termpty *ty, uint16_t id)
+{
+   TermTymux *ts = data;
+   Term_Link *link = ty->hl.links + id;
+   const char *url;
+   uint32_t generation, length, key_len, url_len;
+   int res;
+
+   if (!ts->link_generations)
+     {
+        ts->link_generations = calloc(TERMSRV_TABLE_LINKS, sizeof(uint32_t));
+        if (!ts->link_generations)
+          return;
+     }
+   generation = termsrv_table_generation_get(TERMSRV_SHM_TABLE(ts->shm),
+                                             TERMSRV_TABLE_LINK, id,
+                                             ts->shown_seq);
+   if (generation && (generation == ts->link_generations[id]))
+     return;
+   res = generation ? termsrv_table_read(TERMSRV_SHM_TABLE(ts->shm),
+                                         TERMSRV_TABLE_LINK, id,
+                                         ts->shown_seq, &generation,
+                                         &ts->link_record,
+                                         &ts->link_record_cap, &length) : 0;
+   _link_slot_clear(link);
+   ts->link_generations[id] = 0;
+   if (res != 1)
+     return;
+   ts->link_generations[id] = generation;
+   if (!_link_record_parse(ts->link_record, length, &url, &key_len, &url_len))
+     return;
+   if (key_len)
+     link->key = eina_stringshare_add_length(ts->link_record, key_len);
+   link->url = "" url_len);
+   link->refcount = LINK_REFS_HELD;
+}
+
 /* The daemon holds the pages [first_id, first_id + count), the last one
  * being the head. */
 static void
@@ -793,6 +863,9 @@ _msg_handle(TermTymux *ts, int type, void *payload, uint32_t size, int fd)
                termtymux_frame_apply(ty, &frame, ts->frame_cells))
              {
                 termtymux_modes_apply(ty, notify);
+                /* the links are as the first_page_id the notify came with
+                 * says: a newer frame may already show ids reused since */
+                ts->shown_seq = MIN(frame.seq, notify->write_seq);
                 changed = EINA_TRUE;
              }
            if (changed && ty->cb.change.func)
@@ -961,6 +1034,14 @@ termtymux_new(const char *name, int cols, int rows, Config *config,
         return NULL;
      }
 
+   if (!termsrv_shm_fd_valid(shm_fd))
+     {
+        ERR("termtymux: tymuxd for '%s' speaks another protocol version",
+            name);
+        close(shm_fd);
+        close(sock);
+        return NULL;
+     }
    shm = mmap(NULL, TERMSRV_SHM_TOTAL_SIZE, PROT_READ, MAP_SHARED, shm_fd, 0);
    close(shm_fd);
    if (shm == MAP_FAILED)
@@ -1014,6 +1095,8 @@ termtymux_new(const char *name, int cols, int rows, Config *config,
    ts->shm = shm;
    ts->shadow_pty = ty;
    ty->backlog_view = ts->view;
+   ty->resolver.link = _link_resolve;
+   ty->resolver.data = ""
    ts->shell_pid = (attached.shell_pid > 0) ? (pid_t)attached.shell_pid : -1;
 
    termpty_write_hook_set(ty, _write_hook, ts);
@@ -1069,6 +1152,8 @@ termtymux_free(TermTymux *ts)
    backlog_view_free(ts->view);
    termsrv_reader_clear(&ts->reader);
    free(ts->frame_cells);
+   free(ts->link_generations);
+   free(ts->link_record);
    eina_binbuf_free(ts->chord_out);
    eina_stringshare_del(ts->name);
    if (ts->shadow_pty) termpty_free(ts->shadow_pty);
@@ -1412,6 +1497,145 @@ tytest_termtymux_frame_apply_shrink_grow(void)
    return 0;
 }
 
+/* Test: the resolver follows the table: a record is read once per
+ * generation, a record that does not parse leaves the link empty, and the
+ * frame on show decides whether an id has a target. */
+int
+tytest_termtymux_link_resolve(void)
+{
+   static const char good[] = "k\0https://example.org/";
+   static const char no_key[] = "\0https://example.org/n";
+   static const char one_nul[] = "https://example.org/";
+   static const char inner_nul[] = "k\0https://ex\0ample";
+   static const char unterminated[] = "k\0https://example.org/";
+   TermSrvShmHeader *shm = calloc(1, TERMSRV_SHM_TOTAL_SIZE);
+   TermSrvTableWriter *writer;
+   Termpty *ty = _tt_test_pty_new(4, 4);
+   TermTymux ts = { .shm = shm };
+   Term_Link *link;
+   const char *pinned;
+
+   assert(shm && ty);
+   writer = termsrv_table_writer_new(TERMSRV_SHM_TABLE(shm));
+   assert(writer);
+   ty->resolver.link = _link_resolve;
+   ty->resolver.data = ""
+   ts.shown_seq = 2;
+
+   assert(termsrv_table_publish(writer, TERMSRV_TABLE_LINK, 1, good,
+                                sizeof(good), 4));
+   assert(term_link_get(ty, 1) == NULL);
+   ts.shown_seq = 4;
+   link = term_link_get(ty, 1);
+   assert(link && !strcmp(link->key, "k"));
+   assert(!strcmp(link->url, "https://example.org/"));
+   assert(link == term_link_get(ty, 1));
+
+   assert(termsrv_table_generation_get(TERMSRV_SHM_TABLE(shm),
+                                        TERMSRV_TABLE_LINK, 1, 2) == 0);
+   assert(termsrv_table_generation_get(TERMSRV_SHM_TABLE(shm),
+                                        TERMSRV_TABLE_LINK, 1, 4) != 0);
+   /* what the user was shown is held: the id gets another target */
+   pinned = eina_stringshare_ref(link->url);
+   assert(term_link_has_url(link, pinned));
+   assert(termsrv_table_publish(writer, TERMSRV_TABLE_LINK, 1, no_key,
+                                sizeof(no_key), 4));
+   link = term_link_get(ty, 1);
+   assert(link && !term_link_has_url(link, pinned));
+   assert(!term_link_has_url(NULL, pinned) && !term_link_has_url(link, NULL));
+   assert(term_link_activation_ok(pinned, pinned));
+   assert(!term_link_activation_ok(pinned, NULL));
+   assert(!term_link_activation_ok(NULL, pinned));
+   assert(!term_link_activation_ok(pinned, link->url));
+   assert(term_link_hover_keep(5, 5, EINA_TRUE, EINA_FALSE));
+   assert(!term_link_hover_keep(5, 5, EINA_FALSE, EINA_FALSE));
+   assert(term_link_hover_keep(5, 5, EINA_FALSE, EINA_TRUE));
+   assert(!term_link_hover_keep(5, 6, EINA_TRUE, EINA_TRUE));
+   eina_stringshare_del(pinned);
+   assert(termsrv_table_publish(writer, TERMSRV_TABLE_LINK, 1, no_key,
+                                sizeof(no_key), 4));
+   link = term_link_get(ty, 1);
+   assert(link && !link->key);
+   assert(!strcmp(link->url, "https://example.org/n"));
+   assert(term_link_eq(ty, link, 1));
+
+   assert(termsrv_table_publish(writer, TERMSRV_TABLE_LINK, 2, one_nul,
+                                sizeof(one_nul), 4));
+   assert(term_link_get(ty, 2) == NULL);
+   assert(termsrv_table_publish(writer, TERMSRV_TABLE_LINK, 2, inner_nul,
+                                sizeof(inner_nul), 4));
+   assert(term_link_get(ty, 2) == NULL);
+   assert(termsrv_table_publish(writer, TERMSRV_TABLE_LINK, 2, unterminated,
+                                sizeof(unterminated) - 1, 4));
+   assert(term_link_get(ty, 2) == NULL);
+   assert(termsrv_table_publish(writer, TERMSRV_TABLE_LINK, 2, "", 0, 4));
+   assert(term_link_get(ty, 2) == NULL);
+
+   termsrv_table_unpublish(writer, TERMSRV_TABLE_LINK, 1);
+   assert(term_link_get(ty, 1) == NULL);
+   assert(term_link_get(ty, 0) == NULL);
+
+   ty->resolver.link = NULL;
+   termpty_free(ty);
+   free(ts.link_generations);
+   free(ts.link_record);
+   termsrv_table_writer_free(writer);
+   free(shm);
+   return 0;
+}
+
+/* Test: a frame newer than its notify does not let a link reused since show:
+ * the notify carries the first_page_id the links are checked against. */
+int
+tytest_termtymux_link_notify_epoch(void)
+{
+   static const char url[] = "\0https://example.org/new";
+   TermSrvShmHeader *shm = calloc(1, TERMSRV_SHM_TOTAL_SIZE);
+   TermSrvTableWriter *writer;
+   Termpty *ty = _tt_test_pty_new(4, 4);
+   TermTymux ts = { .shm = shm, .shadow_pty = ty };
+   TermSrvMsgNotify notify = { 0 };
+   Term_Link *link;
+
+   assert(shm && ty);
+   writer = termsrv_table_writer_new(TERMSRV_SHM_TABLE(shm));
+   assert(writer);
+   ty->resolver.link = _link_resolve;
+   ty->resolver.data = ""
+   shm->cols = 4;
+   shm->rows = 4;
+   termsrv_shm_write_begin(shm);
+   assert(termsrv_shm_write_end(shm) == 2);
+   /* the link is published for the frame after the next one: 4 */
+   assert(termsrv_table_publish(writer, TERMSRV_TABLE_LINK, 1, url,
+                                sizeof(url), 4));
+   termsrv_shm_write_begin(shm);
+   assert(termsrv_shm_write_end(shm) == 4);
+
+   /* the notify of frame 2 arrives with frame 4 already in memory */
+   notify.write_seq = 2;
+   assert(!_msg_handle(&ts, TSRV_MSG_NOTIFY, &notify,
+                       offsetof(TermSrvMsgNotify, reserved), -1));
+   assert(ts.shown_seq == 2);
+   assert(term_link_get(ty, 1) == NULL);
+
+   notify.write_seq = 4;
+   assert(!_msg_handle(&ts, TSRV_MSG_NOTIFY, &notify,
+                       offsetof(TermSrvMsgNotify, reserved), -1));
+   assert(ts.shown_seq == 4);
+   link = term_link_get(ty, 1);
+   assert(link && !strcmp(link->url, "https://example.org/new"));
+
+   ty->resolver.link = NULL;
+   termpty_free(ty);
+   free(ts.frame_cells);
+   free(ts.link_generations);
+   free(ts.link_record);
+   termsrv_table_writer_free(writer);
+   free(shm);
+   return 0;
+}
+
 /* Test: termtymux_frame_read() grows the buffer to the frame, starting from
  * none, and keeps it when the frame fits. */
 int
diff --git a/src/bin/termtymux.h b/src/bin/termtymux.h
index cc732dfa..e4b61b94 100644
--- a/src/bin/termtymux.h
+++ b/src/bin/termtymux.h
@@ -60,6 +60,10 @@ struct _TermTymux
    int               last_cols, last_rows;
    BacklogView      *view;        /* the scrollback of the shadow pty */
    uint32_t          backlog_first_id; /* the daemon's oldest page */
+   uint64_t          shown_seq;   /* write_seq of the frame on show */
+   uint32_t         *link_generations; /* per link id, when it was read */
+   void             *link_record;  /* scratch buffer for the table reads */
+   uint32_t          link_record_cap;
 };
 
 /* Resize ty's screen buffers to frame->cols x frame->rows if they differ,
diff --git a/src/bin/tymux.c b/src/bin/tymux.c
index 1bae31b8..120d67b5 100644
--- a/src/bin/tymux.c
+++ b/src/bin/tymux.c
@@ -673,6 +673,12 @@ _proxy_run(int sock, const char *nonce, const char *typed, size_t typed_len)
      }
    timeout.tv_sec = 0;
    setsockopt(sock, SOL_SOCKET, SO_RCVTIMEO, &timeout, sizeof(timeout));
+   if (!termsrv_shm_fd_valid(shm_fd))
+     {
+        fprintf(stderr, "tymux: tymuxd speaks another protocol version\n");
+        close(shm_fd);
+        return 1;
+     }
    shm = mmap(NULL, TERMSRV_SHM_TOTAL_SIZE, PROT_READ, MAP_SHARED, shm_fd, 0);
    close(shm_fd);
    if (shm == MAP_FAILED)
diff --git a/src/bin/tytest.c b/src/bin/tytest.c
index 556262fc..5bdab70c 100644
--- a/src/bin/tytest.c
+++ b/src/bin/tytest.c
@@ -285,6 +285,9 @@ static struct {
        { "termtymux_frame_apply_resize", tytest_termtymux_frame_apply_resize},
        { "termtymux_frame_apply_shrink_grow", tytest_termtymux_frame_apply_shrink_grow},
        { "termtymux_frame_read_grow", tytest_termtymux_frame_read_grow},
+       { "termsrv_shm_fd_valid", tytest_termsrv_shm_fd_valid},
+       { "termtymux_link_resolve", tytest_termtymux_link_resolve},
+       { "termtymux_link_notify_epoch", tytest_termtymux_link_notify_epoch},
        { "termtymux_frame_apply_invalid", tytest_termtymux_frame_apply_invalid},
        { "termtymux_modes_apply", tytest_termtymux_modes_apply},
        { "termtymux_input_chunks_send", tytest_termtymux_input_chunks_send},
@@ -337,6 +340,7 @@ static const struct {
        { "tymux_live_pages_read_only", tytest_tymux_live_pages_read_only},
        { "tymux_live_focus_restores", tytest_tymux_live_focus_restores},
        { "tymux_live_resume_size", tytest_tymux_live_resume_size},
+       { "tymux_live_links", tytest_tymux_live_links},
 #endif
        { NULL, NULL},
 };
diff --git a/src/bin/tytest_tymux.c b/src/bin/tytest_tymux.c
index b8e1f64a..d7753d5a 100644
--- a/src/bin/tytest_tymux.c
+++ b/src/bin/tytest_tymux.c
@@ -2431,3 +2431,188 @@ tytest_tymux_live_resume_size(void)
 {
    return tytest_tymux_live_run(_live_resume_size_body);
 }
+
+#define LINK_A "https://example.org/a"
+#define LINK_B "https://example.org/b"
+#define LONG_LINKS 4300
+#define LINKS_STR_(X) #X
+#define LINKS_STR(X) LINKS_STR_(X)
+
+static const Term_Link *
+_cell_link(Termpty *ty, int x, int y)
+{
+   const Termcell *cell = termpty_cell_get(ty, y, x);
+
+   return cell ? term_link_get(ty, cell->att.link_id) : NULL;
+}
+
+static Eina_Bool
+_screen_link_find(Termpty *ty, const char *url, int *x_ret, int *y_ret)
+{
+   int x, y;
+
+   for (y = 0; y < ty->h; y++)
+     for (x = 0; x < ty->w; x++)
+       {
+          const Term_Link *link = _cell_link(ty, x, y);
+
+          if (link && !strcmp(link->url, url))
+            {
+               *x_ret = x;
+               *y_ret = y;
+               return EINA_TRUE;
+            }
+       }
+   return EINA_FALSE;
+}
+
+/* The backlog entry that has a cell linked to url, 0 for none */
+static int
+_backlog_link_find(Termpty *ty, const char *url)
+{
+   int n = _backlog_entries(ty), y;
+   unsigned int i;
+
+   for (y = 1; y <= n; y++)
+     {
+        const Termsave *save;
+
+        _backlog_entry_show(ty, y);
+        save = _backlog_row(ty, y);
+        for (i = 0; save->cells && i < save->w; i++)
+          {
+             const Term_Link *link = term_link_get(ty,
+                                                   save->cells[i].att.link_id);
+
+             if (link && !strcmp(link->url, url))
+               return y;
+          }
+     }
+   return 0;
+}
+
+static Eina_Bool
+_screen_text_find(Termpty *ty, const char *text, int *x_ret, int *y_ret)
+{
+   size_t len = strlen(text), i;
+   int x, y;
+
+   for (y = 0; y < ty->h; y++)
+     for (x = 0; x + (int)len <= ty->w; x++)
+       {
+          for (i = 0; i < len; i++)
+            if (termpty_cell_get(ty, y, x + i)->codepoint !=
+                (Eina_Unicode)text[i])
+              break;
+          if (i == len)
+            {
+               *x_ret = x;
+               *y_ret = y;
+               return EINA_TRUE;
+            }
+       }
+   return EINA_FALSE;
+}
+
+static Eina_Bool
+_links_screen_done(void *data)
+{
+   int x, y;
+
+   return _screen_link_find(data, LINK_A, &x, &y);
+}
+
+static Eina_Bool
+_links_backlog_done(void *data)
+{
+   return _backlog_link_find(data, LINK_B) > 0;
+}
+
+typedef struct
+{
+   Termpty *ty;
+   uint16_t id;
+} Link_Id;
+
+static Eina_Bool
+_link_gone(void *data)
+{
+   Link_Id *link = data;
+
+   return term_link_get(link->ty, link->id) == NULL;
+}
+
+static Eina_Bool
+_long_done(void *data)
+{
+   int x, y;
+
+   return _screen_text_find(data, "LONG", &x, &y);
+}
+
+static int
+_live_links_body(void)
+{
+   TermTymux *ts, *ts2;
+   Termpty *ty, *ty2;
+   Link_Id stale;
+   int x, y;
+
+   assert(tytest_tymux_start(SESSION, 80, 24, &ts, &ty));
+   termtymux_resize(ts, 80, SCREEN_ROWS);
+   assert(tytest_tymux_wait(_screen_rows_done, ty, 5.0));
+   assert(tytest_tymux_wait(_prompt_done, ty, 5.0));
+
+   assert(tytest_tymux_type(ts, ty,
+      "printf '\\033]8;;" LINK_B "\\033\\\\LINKB\\033]8;;\\033\\\\\\n'; "
+      "seq 1 30\n"));
+   assert(tytest_tymux_wait(_prompt_done, ty, 5.0));
+   assert(tytest_tymux_type(ts, ty,
+      "printf '\\033]8;;" LINK_A "\\033\\\\LINKA\\033]8;;\\033\\\\\\n'\n"));
+   assert(tytest_tymux_wait(_links_screen_done, ty, 5.0));
+   assert(tytest_tymux_wait(_links_backlog_done, ty, 5.0));
+
+   assert(_screen_link_find(ty, LINK_A, &x, &y));
+   assert(!strcmp(_cell_link(ty, x, y)->url, LINK_A));
+   assert(_backlog_link_find(ty, LINK_B) > 0);
+   termtymux_free(ts);
+   assert(tytest_tymux_start(SESSION, 80, 24, &ts2, &ty2));
+   /* a frame to show, as a terminal that resizes on attach asks for */
+   termtymux_resize(ts2, 80, SCREEN_ROWS);
+   assert(tytest_tymux_wait(_links_screen_done, ty2, 5.0));
+   assert(_screen_link_find(ty2, LINK_A, &x, &y));
+   assert(!strcmp(_cell_link(ty2, x, y)->url, LINK_A));
+   assert(tytest_tymux_wait(_links_backlog_done, ty2, 5.0));
+
+   stale.ty = ty2;
+   stale.id = termpty_cell_get(ty2, y, x)->att.link_id;
+   assert(stale.id);
+   assert(tytest_tymux_wait(_prompt_done, ty2, 5.0));
+   assert(tytest_tymux_type(ts2, ty2, "printf '\\033c'\n"));
+   assert(tytest_tymux_wait(_link_gone, &stale, 5.0));
+
+   /* a record over the table's room: the text shows, the link is inert.
+    * LO''NG: the echo of the command must not spell the word. */
+   assert(tytest_tymux_wait(_prompt_done, ty2, 5.0));
+   assert(tytest_tymux_type(ts2, ty2,
+      "U=$(printf '\\342\\202\\254%.0s' $(seq 1 4000))\n"));
+   assert(tytest_tymux_wait(_prompt_done, ty2, 5.0));
+   assert(tytest_tymux_type(ts2, ty2,
+      "i=0; while [ $i -lt " LINKS_STR(LONG_LINKS) " ]; do "
+      "printf '\\033]8;;%s%s\\033\\\\x\\033]8;;\\033\\\\' \"$U\" $i; "
+      "i=$((i+1)); done; "
+      "printf '\\033]8;;%s\\033\\\\%s\\033]8;;\\033\\\\\\n' \"$U\" LO''NG\n"));
+   assert(tytest_tymux_wait(_long_done, ty2, 60.0));
+   assert(_screen_text_find(ty2, "LONG", &x, &y));
+   assert(termpty_cell_get(ty2, y, x)->att.link_id);
+   assert(_cell_link(ty2, x, y) == NULL);
+
+   tytest_tymux_stop(ts2);
+   return 0;
+}
+
+int
+tytest_tymux_live_links(void)
+{
+   return tytest_tymux_live_run(_live_links_body);
+}
diff --git a/src/bin/tytest_tymux.h b/src/bin/tytest_tymux.h
index 3668586a..0dd88574 100644
--- a/src/bin/tytest_tymux.h
+++ b/src/bin/tytest_tymux.h
@@ -60,5 +60,6 @@ int tytest_tymux_live_paste(void);
 int tytest_tymux_live_pages_read_only(void);
 int tytest_tymux_live_focus_restores(void);
 int tytest_tymux_live_resume_size(void);
+int tytest_tymux_live_links(void);
 
 #endif
diff --git a/src/bin/unit_tests.h b/src/bin/unit_tests.h
index d1b5af9d..a0aa99ac 100644
--- a/src/bin/unit_tests.h
+++ b/src/bin/unit_tests.h
@@ -225,6 +225,9 @@ int tytest_termtymux_frame_apply_same_size(void);
 int tytest_termtymux_frame_apply_resize(void);
 int tytest_termtymux_frame_apply_shrink_grow(void);
 int tytest_termtymux_frame_read_grow(void);
+int tytest_termsrv_shm_fd_valid(void);
+int tytest_termtymux_link_resolve(void);
+int tytest_termtymux_link_notify_epoch(void);
 int tytest_termtymux_frame_apply_invalid(void);
 int tytest_termtymux_modes_apply(void);
 int tytest_termtymux_input_chunks_send(void);
diff --git a/tests/meson.build b/tests/meson.build
index 13d71c80..6ae2cfd9 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -110,6 +110,12 @@ if tests
                 'tymux_live_pages_read_only', 'tymux_live_resume_size'],
          depends: [tymuxd],
          timeout: 120)
+    # Sends tens of MiB of links through a session: apart, for its time.
+    test('tymux-live-links',
+         tytest,
+         args: ['tymux_live_links'],
+         depends: [tymuxd],
+         timeout: 120)
     # Waits for the daemon to find its session quiet: apart, so that it
     # runs alongside the other live tests.
     test('tymux-live-quiet',

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

Reply via email to