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

git pushed a commit to branch tymux
in repository terminology.

View the commit online.

commit 67ca9edf5c24270c0d1a526f8c90b65b688b9e29
Author: [email protected] <[email protected]>
AuthorDate: Sun Mar 22 10:16:25 2026 -0600

    feat: add backlog_get callback to Termpty for custom scrollback
    
    Add a callback hook to the Termpty struct that allows alternative
    backlog implementations.  When set, termpty_cellrow_get delegates
    negative-y (scrollback) requests to the callback instead of the
    Termsave circular buffer.  This will be used by the tymux shadow
    PTY to read scrollback from shared-memory backlog buffers.
    
    Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
---
 src/bin/termpty.c | 2 ++
 src/bin/termpty.h | 9 +++++++++
 2 files changed, 11 insertions(+)

diff --git a/src/bin/termpty.c b/src/bin/termpty.c
index ae655bee..1ed4b4d2 100644
--- a/src/bin/termpty.c
+++ b/src/bin/termpty.c
@@ -1217,6 +1217,8 @@ _termpty_cellrow_live_get(Termpty *ty, int y_requested, ssize_t *wret)
         *wret = termpty_line_length(cells, ty->w);
         return cells;
      }
+   if (ty->backlog_get.func)
+     return ty->backlog_get.func(ty->backlog_get.data, y_requested, wret);
    if (!ty->back)
      return NULL;
 
diff --git a/src/bin/termpty.h b/src/bin/termpty.h
index f124c01f..7ae50848 100644
--- a/src/bin/termpty.h
+++ b/src/bin/termpty.h
@@ -162,6 +162,15 @@ struct tag_Termpty
       void (*func)(const char *buf, int len, void *data);
       void *data;
    } write_cb;
+   /* Optional callback for backlog access (used by tymux shadow PTY).
+    * When set, termpty_cellrow_get delegates negative-y requests here
+    * instead of the Termsave-based backlog.  The callback must return
+    * a pointer to Termcell data valid until the next call, and set
+    * *wret to the number of cells. Returns NULL if y is out of range. */
+   struct {
+      Termcell *(*func)(void *data, int y, ssize_t *wret);
+      void *data;
+   } backlog_get;
    struct {
       Ecore_Timer *watchdog;
       Termcell   **shadow_rows;     /* size shadow_h, each entry NULL or malloc'd row copy */

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

Reply via email to