Node-based terminal manager for AI coding agents — tmux-backed terminals and parallel agent sessions as draggable nodes on an infinite pan/zoom canvas. macOS, Linux, and a browser Server Edition.
TypeScript adhdagent-orchestrationai-agentscanvasclaude-codecodexcoding-agentsdeveloper-toolselectrongeminilinuxmacosmultiplexeropencodeparallel-agentsterminalterminal-emulatorterminal-multiplexertmuxworkspace-manager
feat(ipc): pty.captureHistory on desktop + server bridge
enesef9e6363fdf1
diff --git a/src/core/pty-manager-platform.test.ts b/src/core/pty-manager-platform.test.tsindex 676fb3702..3500d56fa 100644--- a/src/core/pty-manager-platform.test.ts+++ b/src/core/pty-manager-platform.test.ts@@ -22,7 +22,8 @@ describe('PtyManager platform registration', () => {IPC.ptyKill,IPC.ptyDestroy,IPC.ptySendText,- IPC.ptyReadScrollback+ IPC.ptyReadScrollback,+ IPC.ptyCaptureHistory]) {expect(fake.handlers[ch] ?? fake.listeners[ch], ch).toBeDefined()}diff --git a/src/core/pty-manager.ts b/src/core/pty-manager.tsindex 29576b6db..dcb65b6c1 100644--- a/src/core/pty-manager.ts+++ b/src/core/pty-manager.ts@@ -375,6 +375,7 @@ export class PtyManager {platform().handle(IPC.ptyReadScrollback, (persistKey: string) =>readScrollback(persistKey))+ platform().handle(IPC.ptyCaptureHistory, (persistKey: string) => this.captureHistory(persistKey))platform().handle(IPC.ptySendText, (persistKey: string, text: string) =>this.sendText(persistKey, text))diff --git a/src/preload/index.ts b/src/preload/index.tsindex af7791bb1..a43a9033f 100644--- a/src/preload/index.ts+++ b/src/preload/index.ts@@ -53,6 +53,7 @@ const api: NodeTerminalApi = {ipcRenderer.invoke(IPC.ptyGenerateGroupName, memberKeys, cwd),capture: (persistKey, full) => ipcRenderer.invoke(IPC.ptyCapture, persistKey, full),readScrollback: (persistKey) => ipcRenderer.invoke(IPC.ptyReadScrollback, persistKey),+ captureHistory: (persistKey) => ipcRenderer.invoke(IPC.ptyCaptureHistory, persistKey),sendText: (persistKey, text) => ipcRenderer.invoke(IPC.ptySendText, persistKey, text),readSessionName: (sessionId, accountId) =>ipcRenderer.invoke(IPC.ptyReadSessionName, sessionId, accountId),diff --git a/src/renderer/bridge/ws-bridge.ts b/src/renderer/bridge/ws-bridge.tsindex 152c4e4e3..3ff3a4a52 100644--- a/src/renderer/bridge/ws-bridge.ts+++ b/src/renderer/bridge/ws-bridge.ts@@ -169,6 +169,8 @@ function buildRealApi(client: RpcClient): Pick<NodeTerminalApi, 'pty' | 'workspaclient.request(IPC.ptyCapture, persistKey, full).catch(() => '') as Promise<string>,readScrollback: (persistKey) =>client.request(IPC.ptyReadScrollback, persistKey) as Promise<string>,+ captureHistory: (persistKey: string) =>+ client.request(IPC.ptyCaptureHistory, persistKey).catch(() => '') as Promise<string>,sendText: (persistKey, text) =>client.request(IPC.ptySendText, persistKey, text) as Promise<boolean>,// No server handler — the session-name poll degrades to no adopted name.diff --git a/src/shared/ipc.ts b/src/shared/ipc.tsindex 8629d9c4e..8d0834f14 100644--- a/src/shared/ipc.ts+++ b/src/shared/ipc.ts@@ -11,6 +11,7 @@ export const IPC = {ptyGenerateGroupName: 'pty:generate-group-name',ptyCapture: 'pty:capture',ptyReadScrollback: 'pty:read-scrollback',+ ptyCaptureHistory: 'pty:capture-history',ptySendText: 'pty:send-text',ptyReadSessionName: 'pty:read-session-name',claudeReadTranscript: 'claude:read-transcript',diff --git a/src/shared/types.ts b/src/shared/types.tsindex c80d80ddb..706554cfe 100644--- a/src/shared/types.ts+++ b/src/shared/types.ts@@ -218,6 +218,9 @@ export interface PtyApi {capture(persistKey: string, full?: boolean): Promise<string>/** Read the persisted scrollback snapshot for a node (for cold-restart replay). '' if none. */readScrollback(persistKey: string): Promise<string>+ /** tmux scrollback above the visible screen, for hydrating a fresh emulator on a warm+ * reattach (the emulator owns scrolling now; tmux only redraws the visible screen). '' if none. */+ captureHistory(persistKey: string): Promise<string>/** Send literal text + Enter into a session (e.g. a slash command). Returns false if unavailable. */sendText(persistKey: string, text: string): Promise<boolean>/** The agent session's display name (`/rename` name, else auto name) read from its transcript,