v1.10: booterm container — xterm.js + tmux + node-pty
This commit is contained in:
@@ -261,4 +261,26 @@ export const api = {
|
||||
sidebar: {
|
||||
get: () => request<SidebarResponse>('/api/sidebar'),
|
||||
},
|
||||
|
||||
// v1.10 booterm: REST control plane for terminal panes. WebSocket attach
|
||||
// lives at /ws/term/sessions/:sid/panes/:pid (handled directly by
|
||||
// TerminalPane). All three endpoints are tolerant of empty bodies on the
|
||||
// POSTs that don't take parameters.
|
||||
terminals: {
|
||||
start: (sessionId: string, paneId: string) =>
|
||||
request<{ tmux_window: string }>(
|
||||
`/api/term/sessions/${sessionId}/panes/${paneId}/start`,
|
||||
{ method: 'POST' },
|
||||
),
|
||||
resize: (sessionId: string, paneId: string, cols: number, rows: number) =>
|
||||
request<{ ok: true }>(
|
||||
`/api/term/sessions/${sessionId}/panes/${paneId}/resize`,
|
||||
{ method: 'POST', body: JSON.stringify({ cols, rows }) },
|
||||
),
|
||||
kill: (sessionId: string, paneId: string) =>
|
||||
request<{ ok: true }>(
|
||||
`/api/term/sessions/${sessionId}/panes/${paneId}/kill`,
|
||||
{ method: 'POST' },
|
||||
),
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user