Skip to content

fix: open the requested tmux session instead of the session picker - #70

Merged
LukeGus merged 4 commits into
Termix-SSH:dev-1.4.1from
Li-Lee:fix/tmux-tab-direct-attach
Nov 16, 2026
Merged

LukeGus merged 4 commits into
Termix-SSH:dev-1.4.1from
Li-Lee:fix/tmux-tab-direct-attach

Conversation

@Li-Lee

@Li-Lee Li-Lee commented Nov 10, 2026

Copy link
Copy Markdown

Problem

In Tmux Monitor, the "attach in a terminal tab" button (the triangle on a session row) should open that session. On a host with Auto tmux on and more than one tmux session, the new tab shows the "TMUX SESSIONS" picker instead, and the session that was asked for is forgotten. Picking it by hand works.

Cause

terminal.open puts the session in tab.data.tmuxSession. TerminalTabContent (and TerminalApp, for the ?view=terminal&tmuxSession= browser tab) turn that into executeCommand (tmux attach-session -t '=<name>') only. In the backend's connect handler, Auto tmux is checked before post-shell commands: with several sessions it sends tmux_sessions_available and returns without calling runPostShellCommands, so executeCommand is never typed.

With Auto tmux off, or with a single session, the problem does not show.

Fix

Both components now also pass the session as tmuxAttachSession, the direct-attach request that Tmux Monitor's inline view already uses. The backend takes its existing tmux_direct_attach branch and attaches without asking. executeCommand is kept, so a backend without the tmux service behaves as before.

No backend change.

Testing

  • Seen on SSH Terminal 1.3.0 with Termix 26.11.0 and Tmux Monitor 1.1.0, in the web UI and the macOS desktop app, on hosts with Auto tmux on and 2 to 6 sessions.
  • Applied the same change to the built frontend.js of 1.3.0 in both places: the button now opens the chosen session directly, and a plain new terminal on the same host still shows the picker.
  • Added tests for both components (the prop is set for a named session, and not set for an ordinary tab or an invalid restored value). I could not run the suite locally, so CI is the first run of them.
  • No CHANGELOG entry: main has no section for the next version yet. Happy to add one where you want it.

🤖 Generated with Claude Code

LukeGus and others added 3 commits November 10, 2026 15:07
A terminal tab opened for a named tmux session passed it only as a command to
type after login. With Auto tmux on and more than one session on the host, the
backend sends the session list for the picker and never types that command, so
the requested session was dropped. The tab now also asks for a direct attach
(tmuxAttachSession); the command stays as the fallback for a backend without
the tmux service.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@termix-triage-bot

termix-triage-bot Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

AI review | Looks safe to merge

The change passes a tmux session name as a direct-attach prop to the terminal component so it bypasses the session picker when Auto tmux is enabled. It includes matching frontend tests and contains no security risks or rule violations.

Reviewed 581e9b2. AI can be wrong, a maintainer still decides. Comment /termix review to run it again.

@LukeGus
LukeGus changed the base branch from main to dev-1.4.1 November 16, 2026 23:18

@LukeGus LukeGus left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@LukeGus
LukeGus merged commit 0c06321 into Termix-SSH:dev-1.4.1 Nov 16, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants