feat(terminal): tmux pane-buffer primitives and session/render reliability

Mode-agnostic terminal foundation extracted from the downstream branch:
- formatPaneSnapshot: SGR/grapheme-aware tmux pane capture + active-pane
  resolution, with OSC/CSI redraw suppression and the buffer-load owner-token
  race fix on the terminal fetch path
- socket-correct tmux lifecycle: dedicated -L socket and /tmp launch cwd in
  createSession (restores the FUSE/getcwd hardening from #110), and a
  socket-aware re-attach window-size query (avoids the 120x40 flicker)
- inline-rename: commit/cancel state handling clears _activeRename and skips
  the API call on cancel
- selectSession: restored detached-window raise short-circuit

The codex-specific xterm snapshot/replay, the vendored serialize addon, and
the synchronous live pane-capture on the request path are intentionally
excluded: they depend on a 'codex' SessionMode that doesn't exist on master
and are deferred to COD-34 (which introduces that mode). The capture
primitives remain exported for COD-34 to build on.

Co-Authored-By: Saqeb Akhter <saqeb.akhter@gmail.com>
This commit is contained in:
Aamer Akhter
2026-06-09 15:39:03 -04:00
co-authored by Saqeb Akhter
parent 2952256d65
commit 0569f68b86
11 changed files with 840 additions and 66 deletions
+37
View File
@@ -233,6 +233,7 @@ body {
display: flex;
align-items: center;
gap: 0.35rem;
position: relative;
padding: 0.35rem 0.6rem;
background: transparent;
border: 1px solid transparent;
@@ -265,6 +266,40 @@ body {
outline: none !important;
}
.session-tab.tab-loading::after {
content: "";
position: absolute;
left: 8px;
right: 8px;
bottom: -2px;
height: 2px;
border-radius: 999px;
background: linear-gradient(90deg, transparent, rgba(96, 165, 250, 0.95), transparent);
animation: tab-load-sweep 0.9s linear infinite;
pointer-events: none;
}
.tab-load-spinner {
width: 10px;
height: 10px;
border: 2px solid rgba(96, 165, 250, 0.3);
border-top-color: rgba(96, 165, 250, 0.95);
border-radius: 50%;
flex: 0 0 10px;
animation: tab-load-spin 0.7s linear infinite;
}
@keyframes tab-load-spin {
to { transform: rotate(360deg); }
}
@keyframes tab-load-sweep {
0% { transform: translateX(-45%); opacity: 0.35; }
50% { opacity: 1; }
100% { transform: translateX(45%); opacity: 0.35; }
}
/* Tab switch feedback: bright green glow on the newly-active tab */
.session-tab.tab-glow {
animation: tab-glow 0.35s ease-out;
@@ -2070,6 +2105,8 @@ body.solo-mode .btn-lifecycle-log {
will-change: contents;
}
.terminal-container .xterm {
width: 100%;
min-width: 0;
height: 100%;
padding: 0;
}