close_surface
Close terminal or browser panes in a multiplexer workspace to manage agent workspaces and free resources.
Instructions
Close a surface (terminal or browser pane)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| surface | Yes | Target surface ref | |
| workspace | No | Target workspace ref |
Implementation Reference
- src/server.ts:491-506 (registration)The close_surface tool is registered in src/server.ts, where it invokes client.closeSurface.
// 9. close_surface server.tool( "close_surface", "Close a surface (terminal or browser pane)", { surface: z.string().describe("Target surface ref"), workspace: z.string().optional().describe("Target workspace ref"), }, async (args) => { try { await client.closeSurface(args.surface, { workspace: args.workspace, }); return ok({ surface: args.surface, applied: "close_surface" }); } catch (e) { return err(e); - src/cmux-client.ts:347-354 (handler)The actual implementation of closing a surface, which executes a cmux command.
async closeSurface( surface: string, opts?: { workspace?: string }, ): Promise<void> { const args = ["close-surface", "--surface", surface]; if (opts?.workspace) args.push("--workspace", opts.workspace); await this.run(args); }