UNPKG

worktree-tool

Version:

A command-line tool for managing Git worktrees with integrated tmux/shell session management

91 lines 3.13 kB
/** * Sanitize name for tmux compatibility * Replace spaces with hyphens and remove special characters */ export declare const sanitizeTmuxName: (name: string) => string; /** * Sanitize a window name for tmux - allows spaces and colons */ export declare const sanitizeTmuxWindowName: (name: string) => string; /** * Check if we're currently inside a tmux session */ export declare function isInsideTmux(): boolean; /** * Check if we're in a proper terminal that can attach to tmux */ export declare function canAttachToTmux(): boolean; /** * Get the current tmux session name if inside tmux */ export declare function getCurrentTmuxSession(): Promise<string | null>; /** * Check if tmux is available on the system */ export declare function isTmuxAvailable(): Promise<boolean>; /** * Check if a tmux session exists */ export declare function tmuxSessionExists(sessionName: string): Promise<boolean>; /** * Create a tmux session */ export declare function createTmuxSession(sessionName: string, startDirectory?: string): Promise<void>; /** * Get the number of windows in a tmux session */ export declare function getTmuxWindowCount(sessionName: string): Promise<number>; /** * Rename a tmux window */ export declare function renameTmuxWindow(sessionName: string, windowIndex: number, newName: string): Promise<void>; /** * Send keys to change directory in a tmux window */ export declare function tmuxSendKeys(sessionName: string, windowIndex: number, command: string): Promise<void>; /** * Create a tmux window in an existing session */ export declare function createTmuxWindow(sessionName: string, windowName: string, directory: string): Promise<void>; /** * Create a tmux window with a command that runs immediately */ export declare function createTmuxWindowWithCommand(sessionName: string, windowName: string, directory: string, command: string): Promise<void>; /** * Create a tmux session with an initial window running a command */ export declare function createTmuxSessionWithWindow(sessionName: string, windowName: string, windowDirectory: string, command: string): Promise<void>; /** * Switch to a tmux window */ export declare function switchToTmuxWindow(sessionName: string, windowName: string): Promise<void>; /** * Attach to a tmux session, optionally switching to a specific window */ export declare function attachToTmuxSession(sessionName: string, windowName?: string): Promise<void>; /** * List all tmux sessions */ export declare function listTmuxSessions(): Promise<string[]>; /** * Kill a tmux session */ export declare function killTmuxSession(sessionName: string): Promise<void>; /** * TmuxManager class for managing tmux operations */ export declare class TmuxManager { /** * Create a new tmux window */ createWindow(name: string, directory: string): Promise<void>; /** * Send keys to a tmux window */ sendKeys(windowName: string, command: string, enter?: boolean): Promise<void>; /** * Execute a command (placeholder for compatibility) */ execute(args: string[]): Promise<void>; } //# sourceMappingURL=tmux.d.ts.map