Skip to main content
Glama

tmux_split_window

Split tmux terminal windows horizontally or vertically to create new panes for parallel command execution and terminal automation.

Instructions

Split the current window in a tmux session horizontally or vertically to create a new pane.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
session_nameYesName of the tmux session
verticalNoIf true, split vertically (side by side). If false, split horizontally (top and bottom). Default: false

Implementation Reference

  • Handler function that splits the tmux window horizontally or vertically based on the vertical parameter using tmux split-window command.
    async splitWindow(args) {
      const { session_name, vertical = false } = args;
    
      try {
        let cmd = `tmux split-window -t "${session_name}"`;
    
        if (vertical) {
          cmd += " -h"; // horizontal split creates vertical panes (side by side)
        }
    
        await execAsync(cmd);
    
        return {
          content: [
            {
              type: "text",
              text: `Split window in session ${session_name} (${
                vertical ? "vertically" : "horizontally"
              })`,
            },
          ],
        };
      } catch (error) {
        throw new Error(`Failed to split window: ${error.message}`);
      }
    }
  • Input schema defining parameters for the tmux_split_window tool: session_name (required string), vertical (optional boolean).
    inputSchema: {
      type: "object",
      properties: {
        session_name: {
          type: "string",
          description: "Name of the tmux session",
        },
        vertical: {
          type: "boolean",
          description:
            "If true, split vertically (side by side). If false, split horizontally (top and bottom). Default: false",
        },
      },
      required: ["session_name"],
    },
  • src/index.js:129-148 (registration)
    Tool registration in the ListTools response, including name, description, and input schema.
    {
      name: "tmux_split_window",
      description:
        "Split the current window in a tmux session horizontally or vertically to create a new pane.",
      inputSchema: {
        type: "object",
        properties: {
          session_name: {
            type: "string",
            description: "Name of the tmux session",
          },
          vertical: {
            type: "boolean",
            description:
              "If true, split vertically (side by side). If false, split horizontally (top and bottom). Default: false",
          },
        },
        required: ["session_name"],
      },
    },
  • src/index.js:201-202 (registration)
    Dispatch case in the CallToolRequestHandler switch statement that routes to the splitWindow handler.
    case "tmux_split_window":
      return await this.splitWindow(args);

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/MediocreTriumph/tmux-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server