get_current_tmux_info
Retrieve active tmux session details to enable macOS notifications tied to specific sessions, enhancing workflow focus and productivity.
Instructions
Get current tmux session information
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/notifier.ts:388-416 (handler)Core implementation of getCurrentTmuxInfo: runs tmux display-message commands to fetch current session name, window index, and pane index.async getCurrentTmuxInfo(): Promise<TmuxInfo | null> { try { const session = ( await this.runCommand('tmux', [ 'display-message', '-p', '#{session_name}', ]) ).trim() const window = ( await this.runCommand('tmux', [ 'display-message', '-p', '#{window_index}', ]) ).trim() const pane = ( await this.runCommand('tmux', [ 'display-message', '-p', '#{pane_index}', ]) ).trim() return { session, window, pane } } catch (_error) { return null } }
- src/index.ts:191-211 (registration)MCP server handler for the 'get_current_tmux_info' tool call, delegates to notifier.getCurrentTmuxInfo() and formats response.case 'get_current_tmux_info': { const info = await notifier.getCurrentTmuxInfo() if (info) { return { content: [ { type: 'text', text: `Current tmux location:\n- Session: ${info.session}\n- Window: ${info.window}\n- Pane: ${info.pane}`, }, ], } } return { content: [ { type: 'text', text: 'Not in a tmux session', }, ], } }
- src/index.ts:92-98 (registration)Tool registration in listTools response: defines name, description, and empty input schema.name: 'get_current_tmux_info', description: 'Get current tmux session information', inputSchema: { type: 'object', properties: {}, }, },
- src/notifier.ts:16-19 (schema)Type definition for TmuxInfo returned by getCurrentTmuxInfo.session: string window: string pane: string }