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 471ea67b47e20c50ecac40e0afa8f1c832cf4487
Author: [email protected] <[email protected]>
AuthorDate: Thu May 14 18:58:10 2026 -0600

    feat(tymux): client stores daemon shell pid from ATTACHED
    
    The ATTACHED message now carries the daemon-side shell pid. The client
    extracts this in termtymux_attach() and stores it in TermTymux::shell_pid
    for use by downstream code (Task 4 will wire it into termio_cwd_get).
    
    test_termsrv.c is updated only to accommodate the new termsrv helper
    function signatures (adding shell_pid parameter); the round-trip test
    behavior remains unchanged, continuing to exercise fd-passing only.
---
 src/bin/termtymux.c      | 5 ++++-
 src/bin/termtymux.h      | 1 +
 src/tests/test_termsrv.c | 6 ++++--
 3 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/src/bin/termtymux.c b/src/bin/termtymux.c
index eb44ec9b..bca8e05f 100644
--- a/src/bin/termtymux.c
+++ b/src/bin/termtymux.c
@@ -942,6 +942,7 @@ termtymux_attach(const char *tymux_name,
    uint32_t          backlog_buf_count   = 0;
    uint32_t          backlog_max_lines   = 0;
    uint32_t          oldest_buf_id       = 0;
+   int32_t           shell_pid           = -1;
    TermShmHeader    *shm  = MAP_FAILED;
    TermTymux      *ts   = NULL;
    Termpty          *ty   = NULL;
@@ -1012,7 +1013,8 @@ termtymux_attach(const char *tymux_name,
                              &srv_cols, &srv_rows,
                              &backlog_buf_count,
                              &backlog_max_lines,
-                             &oldest_buf_id) < 0)
+                             &oldest_buf_id,
+                             &shell_pid) < 0)
      {
         ERR("termtymux: recv ATTACHED failed");
         goto fail;
@@ -1067,6 +1069,7 @@ termtymux_attach(const char *tymux_name,
    ts->oldest_buf_id          = oldest_buf_id;
    ts->last_backlog_buf_count = backlog_buf_count;
    ts->pending_fetch_id       = -1;
+   ts->shell_pid              = (shell_pid > 0) ? (pid_t)shell_pid : -1;
 
    /* Build the backlog tracking array.
     *
diff --git a/src/bin/termtymux.h b/src/bin/termtymux.h
index 7bcc160d..df0dcfb8 100644
--- a/src/bin/termtymux.h
+++ b/src/bin/termtymux.h
@@ -28,6 +28,7 @@ struct _TermTymux {
    Termpty       *shadow_pty;
    uint64_t       last_seq;
    Eina_Stringshare *launch_cwd;  /* outer shell's cwd at switch-in time, or NULL */
+   pid_t             shell_pid;   /* daemon-side shell pid, or -1                 */
 
    Ecore_Fd_Handler *handler;
 
diff --git a/src/tests/test_termsrv.c b/src/tests/test_termsrv.c
index dde4a527..f4ded287 100644
--- a/src/tests/test_termsrv.c
+++ b/src/tests/test_termsrv.c
@@ -80,16 +80,18 @@ test_fd_passing(void)
     int pipefd[2];
     assert(pipe(pipefd) == 0);
 
-    assert(termsrv_send_attached(sv[0], pipefd[0], -1, 132, 43, 0, 0, 0) == 0);
+    assert(termsrv_send_attached(sv[0], pipefd[0], -1, 132, 43, 0, 0, 0, -1) == 0);
 
     int shm_fd = -1, backlog_fd = -1;
     uint32_t cols = 0, rows = 0;
     uint32_t backlog_buf_count = 0, backlog_max_lines = 0, oldest_buf_id = 0;
+    int32_t shell_pid_out = -1;
     assert(termsrv_recv_attached(sv[1], &shm_fd, &backlog_fd,
                                  &cols, &rows,
                                  &backlog_buf_count,
                                  &backlog_max_lines,
-                                 &oldest_buf_id) == 0);
+                                 &oldest_buf_id,
+                                 &shell_pid_out) == 0);
     assert(shm_fd >= 0 && shm_fd != pipefd[0]);  /* received a dup */
     assert(backlog_fd == -1);  /* no backlog fd sent */
     assert(cols == 132 && rows == 43);

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

Reply via email to