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 bbd6e83ee41970efdd0b46e2cdd75b743ca66fcd
Author: [email protected] <[email protected]>
AuthorDate: Mon May 4 21:38:12 2026 -0600

    feat(tymux): receive CWD in native client; bump proxy type cap
    
    The native client (termtymux) now stashes the daemon's CWD broadcast
    in a new Eina_Stringshare *last_cwd field; empty/oversized payloads
    clear it, while malloc failures preserve the stale value. The field
    is cleaned up in termtymux_free. The CLI proxy bumps its receive-cap
    from > 11 to > 14 to accept CWD (14) and incidentally fixes the
    already-armed PAUSE (12) and RESUME (13) handlers that were being
    silently rejected by the too-tight cap. No user-visible behaviour
    yet — last_cwd will be consumed by the upcoming auto-respawn commit
    to spawn the shell at the right directory.
    
    Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
---
 src/bin/termtymux.c | 25 +++++++++++++++++++++++++
 src/bin/termtymux.h |  1 +
 src/bin/tymux.c     |  3 ++-
 3 files changed, 28 insertions(+), 1 deletion(-)

diff --git a/src/bin/termtymux.c b/src/bin/termtymux.c
index cca22ea8..78498b30 100644
--- a/src/bin/termtymux.c
+++ b/src/bin/termtymux.c
@@ -706,6 +706,29 @@ _cb_tymux_data(void *data, Ecore_Fd_Handler *handler EINA_UNUSED)
           ts->cb_bell.func(ts->cb_bell.data);
         break;
 
+      case TSRV_MSG_CWD:
+        {
+           char *path = NULL;
+           if (payload && size > 0 && size < (1u << 16))
+             {
+                path = malloc(size + 1);
+                if (path)
+                  {
+                     memcpy(path, payload, size);
+                     path[size] = '\0';
+                     eina_stringshare_replace(&ts->last_cwd, path);
+                     free(path);
+                  }
+                /* malloc failure: keep stale value rather than clear it */
+             }
+           else
+             {
+                /* Empty payload = "no cwd available"; clear any stale value. */
+                eina_stringshare_replace(&ts->last_cwd, NULL);
+             }
+        }
+        break;
+
       case TSRV_MSG_EXIT:
         if (recv_fd >= 0) { close(recv_fd); recv_fd = -1; }
         if (ts->cb_exit.func)
@@ -1256,6 +1279,8 @@ termtymux_free(TermTymux *ts)
         ts->backlog_bufs = NULL;
      }
 
+   eina_stringshare_replace(&ts->last_cwd, NULL);
+
    free(ts);
 }
 
diff --git a/src/bin/termtymux.h b/src/bin/termtymux.h
index 70b7a18d..e0e74089 100644
--- a/src/bin/termtymux.h
+++ b/src/bin/termtymux.h
@@ -27,6 +27,7 @@ struct _TermTymux {
    size_t         shm_size;
    Termpty       *shadow_pty;
    uint64_t       last_seq;
+   Eina_Stringshare *last_cwd;  /* most recent cwd reported by daemon, or NULL */
 
    Ecore_Fd_Handler *handler;
 
diff --git a/src/bin/tymux.c b/src/bin/tymux.c
index 15783dc2..08ea4d6d 100644
--- a/src/bin/tymux.c
+++ b/src/bin/tymux.c
@@ -104,6 +104,7 @@ typedef enum {
    _TSRV_MSG_BACKLOG_BUF     = 11,
    _TSRV_MSG_PAUSE           = 12,
    _TSRV_MSG_RESUME          = 13,
+   _TSRV_MSG_CWD             = 14,
 } _TsrvMsgType;
 
 typedef struct {
@@ -288,7 +289,7 @@ _proto_recv(int fd, void **payload_out, uint32_t *size_out)
           return -1;
      }
 
-   if (hdr.type == 0 || hdr.type > 11) return -1;
+   if (hdr.type == 0 || hdr.type > 14) return -1;
    if (hdr.size > (1u << 20)) return -1;
 
    if (hdr.size > 0)

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

Reply via email to