Skip to content

Launch sessions in a tmux split when running inside tmux#226

Open
jongio wants to merge 1 commit into
mainfrom
idea/tmux-split-pane
Open

Launch sessions in a tmux split when running inside tmux#226
jongio wants to merge 1 commit into
mainfrom
idea/tmux-split-pane

Conversation

@jongio

@jongio jongio commented Jul 4, 2026

Copy link
Copy Markdown
Owner

Summary

Makes pane launch mode work inside tmux on macOS and Linux. Previously e (split pane) only did anything in Windows Terminal; a tmux user on mac or Linux got a brand-new terminal window instead of a split.

Behavior

  • When the TMUX environment variable is set, pane launches route through tmux split-window in the current tmux window.
  • Pane direction maps to tmux flags: right/left use -h (pane to the right), down/up use -v (pane below), auto lets tmux choose.
  • The split starts in the session working directory (-c) and runs the resume command in the user's shell.
  • Outside tmux, behavior is unchanged.

Changes

  • internal/platform/shell.go: insideTmux, buildTmuxSplitArgs, and launchTmuxPane helpers; platformLaunchSession routes pane mode to tmux when inside a tmux session.
  • Unit tests cover the direction mapping for each value and the tmux detection.
  • README documents tmux support for pane mode.

Closes #219

Pane launch mode previously only worked in Windows Terminal. When
dispatch runs inside a tmux session (TMUX is set), pane mode now
routes through 'tmux split-window' so macOS and Linux users get a
split in their current tmux window instead of a new terminal.

- Maps pane direction to tmux flags: right/left to -h, down/up to -v.
- Sets the working directory with -c and runs the resume command.
- Falls back to the existing behavior when not inside tmux.

Closes #219

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@jongio jongio self-assigned this Jul 4, 2026
@jongio jongio added the idea Feature idea from the idea pipeline label Jul 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

idea Feature idea from the idea pipeline

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Launch sessions in a tmux split when running inside tmux

1 participant