Overview
Termy can run in tmux mode, where it acts as a tmux client with a native UI for:- Multiple panes within a single window
- Session persistence and management
- Detach/attach workflow
- Window and pane navigation
Tmux integration is available on macOS and Linux. It is not supported on Windows.
Configuration
Tmux integration is configured through thetermy_config_core settings:
Enabling Tmux Mode
Settmux_enabled: true in your configuration to launch Termy with tmux integration.
Persistence Options
Termy supports different tmux persistence modes:- Session Persistence: Tmux sessions survive app restarts
- Detach on Quit: Sessions can be detached rather than killed
Pane Management
Splitting Panes
Termy provides commands for creating tmux splits:SplitPaneVertical- Split the current pane vertically (creates a pane to the right)SplitPaneHorizontal- Split the current pane horizontally (creates a pane below)
- Vertical split: Typically bound to a key combination
- Horizontal split: Typically bound to a key combination
Navigation
Move between panes using directional commands:FocusPaneLeft- Move focus to the pane on the leftFocusPaneRight- Move focus to the pane on the rightFocusPaneUp- Move focus to the pane aboveFocusPaneDown- Move focus to the pane belowFocusPaneNext- Cycle to the next paneFocusPanePrevious- Cycle to the previous pane
Resizing
Adjust pane sizes with resize commands:ResizePaneLeft- Decrease widthResizePaneRight- Increase widthResizePaneUp- Decrease heightResizePaneDown- Increase height
Zoom
Toggle pane zoom to maximize a single pane:Session Management
Termy provides a dedicated session manager accessible via the command palette:- Viewing active tmux sessions
- Creating new sessions
- Attaching to existing sessions
- Switching between sessions
Session Lifecycle
When tmux mode is enabled:- Launch: Termy connects to or creates a tmux session
- Runtime: All tabs and panes are managed by tmux
- Detach: Sessions can be detached without killing processes
- Reattach: Sessions persist and can be reattached later
Implementation Details
Termy’s tmux integration is implemented in several crates:Terminal UI Client
Location:crates/terminal_ui/src/tmux/
client.rs- Tmux client implementationcontrol/- Tmux control mode protocol parsersession.rs- Session managementsnapshot.rs- State snapshot handling
View Integration
Location:src/terminal_view/runtime/tmux/
mod.rs- Tmux runtime state managementevents.rs- Event handling from tmuxactions.rs- User actions (split, focus, resize)snapshot.rs- Synchronizing tmux state with UI
Control Mode Protocol
Termy uses tmux’s control mode (tmux -CC) to communicate:
Active Pane Border
When tmux mode is active, Termy can display a border around the focused pane:Pane Focus Strength
Termy supports dimming inactive panes to highlight the active one:Commands Reference
All tmux-related commands fromsrc/commands.rs:
| Command | Description | Menu Location |
|---|---|---|
ManageTmuxSessions | Open session manager | File > Tmux Sessions |
SplitPaneVertical | Split pane right | File > Split Pane Vertical |
SplitPaneHorizontal | Split pane down | File > Split Pane Horizontal |
ClosePane | Close current pane | - |
FocusPaneLeft | Focus left pane | - |
FocusPaneRight | Focus right pane | - |
FocusPaneUp | Focus upper pane | - |
FocusPaneDown | Focus lower pane | - |
FocusPaneNext | Focus next pane | File > Focus Next Pane |
FocusPanePrevious | Focus previous pane | - |
ResizePaneLeft | Resize left | - |
ResizePaneRight | Resize right | - |
ResizePaneUp | Resize up | - |
ResizePaneDown | Resize down | - |
TogglePaneZoom | Toggle zoom | View > Toggle Pane Zoom |
Best Practices
Session Naming
Use descriptive session names to organize your workflows:Persistence Strategy
Enable tmux persistence to preserve sessions across:- App restarts
- System reboots (with tmux-resurrect plugin)
- Network disconnections (when using tmux over SSH)
Pane Layout
Plan your pane layout based on your workflow:- Development: Editor | Terminal | Logs
- Monitoring: Logs | Metrics | Shell
- Operations: Multiple SSH sessions in split panes
Troubleshooting
Tmux Not Found
If Termy can’t find tmux:- Install tmux:
brew install tmux(macOS) orapt install tmux(Linux) - Verify tmux is in PATH:
which tmux - Configure custom tmux binary path if needed
Pane Rendering Issues
If panes appear degraded or out of sync:- Termy will show a warning: “tmux pane restore degraded for N pane(s)”
- This typically occurs during rapid pane creation/destruction
- The UI will automatically resync on the next tmux event
Session Conflicts
If you have session attachment conflicts:- Detach other clients:
tmux detach-client -a - Use unique session names
- Check for zombie tmux processes
Related
- Configuration - Configure tmux settings
- Keyboard Shortcuts - Pane navigation keybindings