kill-pane
Terminate a specific tmux pane by its ID to remove unused terminal windows and manage session resources.
Instructions
Kill a tmux pane by ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| paneId | Yes | ID of the tmux pane to kill |
Implementation Reference
- src/index.ts:293-311 (handler)The handler function for the "kill-pane" MCP tool. It takes a paneId parameter, calls the tmux.killPane helper, and returns a success or error message.async ({ paneId }) => { try { await tmux.killPane(paneId); return { content: [{ type: "text", text: `Pane ${paneId} has been killed` }] }; } catch (error) { return { content: [{ type: "text", text: `Error killing pane: ${error}` }], isError: true }; } }
- src/index.ts:290-292 (schema)Input schema for the "kill-pane" tool using Zod to validate the paneId parameter.{ paneId: z.string().describe("ID of the tmux pane to kill") },
- src/index.ts:287-312 (registration)Registration of the "kill-pane" tool with the MCP server, including name, description, input schema, and handler function.server.tool( "kill-pane", "Kill a tmux pane by ID", { paneId: z.string().describe("ID of the tmux pane to kill") }, async ({ paneId }) => { try { await tmux.killPane(paneId); return { content: [{ type: "text", text: `Pane ${paneId} has been killed` }] }; } catch (error) { return { content: [{ type: "text", text: `Error killing pane: ${error}` }], isError: true }; } } );
- src/tmux.ts:193-195 (helper)Helper function tmux.killPane that executes the actual tmux 'kill-pane' command using executeTmux.export async function killPane(paneId: string): Promise<void> { await executeTmux(`kill-pane -t '${paneId}'`); }