kill-window
Terminate a tmux window by specifying its ID to remove unwanted terminal sessions and manage workspace organization.
Instructions
Kill a tmux window by ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| windowId | Yes | ID of the tmux window to kill |
Implementation Reference
- src/index.ts:259-284 (registration)Registration of the 'kill-window' MCP tool, including schema, description, and inline handler function that delegates to tmux.killWindowserver.tool( "kill-window", "Kill a tmux window by ID", { windowId: z.string().describe("ID of the tmux window to kill") }, async ({ windowId }) => { try { await tmux.killWindow(windowId); return { content: [{ type: "text", text: `Window ${windowId} has been killed` }] }; } catch (error) { return { content: [{ type: "text", text: `Error killing window: ${error}` }], isError: true }; } } );
- src/tmux.ts:186-188 (helper)Helper function killWindow that executes the underlying tmux 'kill-window' command via executeTmuxexport async function killWindow(windowId: string): Promise<void> { await executeTmux(`kill-window -t '${windowId}'`); }
- src/index.ts:265-283 (handler)Inline handler function for the kill-window toolasync ({ windowId }) => { try { await tmux.killWindow(windowId); return { content: [{ type: "text", text: `Window ${windowId} has been killed` }] }; } catch (error) { return { content: [{ type: "text", text: `Error killing window: ${error}` }], isError: true }; } }
- src/index.ts:262-264 (schema)Input schema defining the windowId parameter for the tool{ windowId: z.string().describe("ID of the tmux window to kill") },