Skip to content

Use grouped tmux sessions for independent window navigation#21

Open
flipbit03 wants to merge 2 commits intomainfrom
feat/20-use-grouped-tmux-sessions-for-independen
Open

Use grouped tmux sessions for independent window navigation#21
flipbit03 wants to merge 2 commits intomainfrom
feat/20-use-grouped-tmux-sessions-for-independen

Conversation

@flipbit03
Copy link
Copy Markdown
Owner

Summary

  • Replace tmux attach-session with tmux new-session -t when reattaching to an existing session, creating a grouped session that shares windows but allows each terminal to independently select the active window
  • Add destroy-unattached option so grouped sessions are automatically cleaned up when the terminal disconnects

Closes #20

Test plan

  • Open forestui in terminal A — creates the tmux session as usual
  • Open forestui in terminal B — should create a grouped session (not just attach)
  • Switch tmux windows in terminal B — terminal A should stay on its current window
  • Close terminal B — the grouped session should be destroyed, but the original session (terminal A) persists

Replace `tmux attach-session` with `tmux new-session -t` when
reattaching to an existing session. This creates a grouped session
that shares windows but allows each terminal to independently select
the active window. The `destroy-unattached` option ensures grouped
sessions are cleaned up when the terminal disconnects.
The semicolon command separator in os.execvp doesn't work reliably with
tmux. Instead, create the grouped session detached with a PID-based
unique name, set destroy-unattached on it, then attach.
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.

Use grouped tmux sessions for independent window navigation across terminals

1 participant