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 16389c33e74bac11856e4bc349fce35be091ea17
Author: [email protected] <[email protected]>
AuthorDate: Mon Mar 23 21:55:26 2026 -0600
feat(tymux): add PAUSE/RESUME message types and attach mode enum
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
---
src/bin/termsrv.c | 4 ++--
src/bin/termsrv.h | 21 +++++++++++++++++++++
2 files changed, 23 insertions(+), 2 deletions(-)
diff --git a/src/bin/termsrv.c b/src/bin/termsrv.c
index 9180b35d..60cdae34 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)..BACKLOG_BUF(11). Checking type first prevents a malloc
+ * ATTACH(1)..RESUME(13). Checking type first prevents a malloc
* that would otherwise leak on the error path. */
- if (hdr.type == 0 || hdr.type > 11) return -1;
+ if (hdr.type == 0 || hdr.type > 13) 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
diff --git a/src/bin/termsrv.h b/src/bin/termsrv.h
index 41050d3c..85c866a8 100644
--- a/src/bin/termsrv.h
+++ b/src/bin/termsrv.h
@@ -93,8 +93,17 @@ typedef enum {
TSRV_MSG_EXIT = 9, /* server → client: tymux ended, exit code */
TSRV_MSG_BACKLOG_BUF_REQ = 10, /* client → server: request backlog buffer fd */
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 */
} TermSrvMsgType;
+/* Attach mode — first byte of ATTACH payload */
+typedef enum {
+ TSRV_ATTACH_HIJACK = 0, /* default: become PRIMARY, pause existing */
+ TSRV_ATTACH_SHARED = 1, /* shared INPUT, no hijack */
+ TSRV_ATTACH_READONLY = 2, /* receive NOTIFY only, INPUT dropped */
+} TermSrvAttachMode;
+
/* Every message starts with this 8-byte header */
typedef struct {
uint32_t type; /* TermSrvMsgType */
@@ -116,6 +125,18 @@ typedef struct {
uint32_t rows;
} TermSrvMsgResize;
+/* PAUSE payload — sent to client being paused */
+typedef struct {
+ uint32_t cols; /* hijacker's terminal width */
+ uint32_t rows; /* hijacker's terminal height */
+} TermSrvMsgPause;
+
+/* RESUME payload — sent to client being restored */
+typedef struct {
+ uint32_t cols; /* current terminal width at restore */
+ uint32_t rows; /* current terminal height at restore */
+} TermSrvMsgResume;
+
/* NOTIFY payload */
typedef struct {
uint64_t write_seq; /* screen shm sequence */
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.