This is an automated email from the git hooks/post-receive script.
git pushed a commit to reference refs/pull/36/head
in repository terminology.
View the commit online.
commit 1455830ebe8a36f2183484123b4488ffd51376c7
Author: [email protected] <[email protected]>
AuthorDate: Thu May 14 18:50:34 2026 -0600
feat(tymux): add shell_pid field to ATTACHED message
The tymux protocol's ATTACHED message now carries the shell_pid from
the daemon side, allowing clients to resolve the actual shell process
running inside the tymux session. This is required for upcoming work
to determine the working directory of spawned terminals.
This is a breaking wire format change, but acceptable since the
protocol has not yet shipped.
---
src/bin/termsrv.c | 8 ++++++--
src/bin/termsrv.h | 7 +++++--
2 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/src/bin/termsrv.c b/src/bin/termsrv.c
index 42fd6ac8..87232e80 100644
--- a/src/bin/termsrv.c
+++ b/src/bin/termsrv.c
@@ -193,7 +193,8 @@ termsrv_send_attached(int sock_fd, int shm_fd, int backlog_fd,
uint32_t cols, uint32_t rows,
uint32_t backlog_buf_count,
uint32_t backlog_max_lines,
- uint32_t oldest_buf_id)
+ uint32_t oldest_buf_id,
+ int32_t shell_pid)
{
TermSrvMsgHdr hdr = { .type = TSRV_MSG_ATTACHED,
.size = sizeof(TermSrvMsgAttached) };
@@ -203,6 +204,7 @@ termsrv_send_attached(int sock_fd, int shm_fd, int backlog_fd,
.backlog_buf_count = backlog_buf_count,
.backlog_max_lines = backlog_max_lines,
.oldest_buf_id = oldest_buf_id,
+ .shell_pid = shell_pid,
};
int nfds = (backlog_fd >= 0) ? 2 : 1;
@@ -236,7 +238,8 @@ termsrv_recv_attached(int sock_fd, int *shm_fd_out, int *backlog_fd_out,
uint32_t *cols_out, uint32_t *rows_out,
uint32_t *backlog_buf_count_out,
uint32_t *backlog_max_lines_out,
- uint32_t *oldest_buf_id_out)
+ uint32_t *oldest_buf_id_out,
+ int32_t *shell_pid_out)
{
TermSrvMsgHdr hdr;
TermSrvMsgAttached pl;
@@ -276,6 +279,7 @@ termsrv_recv_attached(int sock_fd, int *shm_fd_out, int *backlog_fd_out,
*backlog_buf_count_out = pl.backlog_buf_count;
*backlog_max_lines_out = pl.backlog_max_lines;
*oldest_buf_id_out = pl.oldest_buf_id;
+ *shell_pid_out = pl.shell_pid;
return 0;
}
diff --git a/src/bin/termsrv.h b/src/bin/termsrv.h
index 086a2b17..027f18e5 100644
--- a/src/bin/termsrv.h
+++ b/src/bin/termsrv.h
@@ -117,6 +117,7 @@ typedef struct {
uint32_t backlog_buf_count; /* backlog buffers available */
uint32_t backlog_max_lines; /* lines per buffer */
uint32_t oldest_buf_id; /* first valid buffer index */
+ int32_t shell_pid; /* daemon-side shell pid, or -1 */
} TermSrvMsgAttached;
/* RESIZE payload */
@@ -236,7 +237,8 @@ int termsrv_send_attached(int sock_fd, int shm_fd, int backlog_fd,
uint32_t cols, uint32_t rows,
uint32_t backlog_buf_count,
uint32_t backlog_max_lines,
- uint32_t oldest_buf_id);
+ uint32_t oldest_buf_id,
+ int32_t shell_pid);
/* Receive ATTACHED and extract the shm fd (and optional backlog fd).
* *backlog_fd_out is set to -1 if no backlog fd was sent.
@@ -245,7 +247,8 @@ int termsrv_recv_attached(int sock_fd, int *shm_fd_out, int *backlog_fd_out,
uint32_t *cols_out, uint32_t *rows_out,
uint32_t *backlog_buf_count_out,
uint32_t *backlog_max_lines_out,
- uint32_t *oldest_buf_id_out);
+ uint32_t *oldest_buf_id_out,
+ int32_t *shell_pid_out);
/* Send BACKLOG_BUF with the buffer memfd via SCM_RIGHTS.
* Returns 0/-1. */
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.