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 1241a06205fbe5cbfc527ae1b380edd6b23edd84
Author: [email protected] <[email protected]>
AuthorDate: Mon May 4 21:23:41 2026 -0600

    feat(tymux): add TSRV_MSG_CWD wire protocol message type
    
    Establishes the foundation for two upcoming features (native Ctrl+b d detach
    and tymux-session auto-respawn) by adding a new server→client message type
    for shipping the inner-shell cwd path to native clients. Includes validation
    wrapper termsrv_send_cwd() and bumps the protocol type range. Senders and
    receivers are wired in subsequent commits.
    
    Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
---
 src/bin/termsrv.c | 12 ++++++++++--
 src/bin/termsrv.h |  5 +++++
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/src/bin/termsrv.c b/src/bin/termsrv.c
index 60cdae34..6684b8e6 100644
--- a/src/bin/termsrv.c
+++ b/src/bin/termsrv.c
@@ -121,9 +121,9 @@ termsrv_msg_recv(int fd, void **payload_out, uint32_t *size_out, int *fd_out)
       }
 
     /* Reject unknown message types before allocating — valid range is
-     * ATTACH(1)..RESUME(13).  Checking type first prevents a malloc
+     * ATTACH(1)..CWD(14).  Checking type first prevents a malloc
      * that would otherwise leak on the error path. */
-    if (hdr.type == 0 || hdr.type > 13) return -1;
+    if (hdr.type == 0 || hdr.type > 14) return -1;
     if (hdr.size > TERMSRV_MAX_MSG_PAYLOAD) return -1;
 
     /* Now do the real read.  Use recvmsg so that we can extract an optional
@@ -315,4 +315,12 @@ termsrv_send_backlog_buf(int sock_fd, int buf_fd,
 }
 
 
+int
+termsrv_send_cwd(int sock_fd, const char *path, uint32_t len)
+{
+    if (len > TERMSRV_MAX_MSG_PAYLOAD) return -1;
+    return termsrv_msg_send(sock_fd, TSRV_MSG_CWD, path, len);
+}
+
+
 #endif /* HAVE_TYMUX */
diff --git a/src/bin/termsrv.h b/src/bin/termsrv.h
index 85c866a8..25b70183 100644
--- a/src/bin/termsrv.h
+++ b/src/bin/termsrv.h
@@ -95,6 +95,7 @@ typedef enum {
     TSRV_MSG_BACKLOG_BUF     = 11, /* server → client: backlog buffer fd response */
     TSRV_MSG_PAUSE           = 12, /* server → client: you are paused (hijacked) */
     TSRV_MSG_RESUME          = 13, /* server → client: you are restored          */
+    TSRV_MSG_CWD             = 14, /* server → client: inner-shell cwd path     */
 } TermSrvMsgType;
 
 /* Attach mode — first byte of ATTACH payload */
@@ -241,6 +242,10 @@ int termsrv_send_backlog_buf(int sock_fd, int buf_fd,
                              uint32_t buf_id, uint32_t cols,
                              uint32_t num_lines, uint32_t max_lines);
 
+/* Send a CWD message. `path` is a non-NUL-terminated path of `len`
+ * bytes; `len` may be 0 to indicate "no cwd available". Returns 0/-1. */
+int termsrv_send_cwd(int sock_fd, const char *path, uint32_t len);
+
 
 #endif /* HAVE_TYMUX */
 #endif /* TERMINOLOGY_TERMSRV_H_ */

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

Reply via email to