Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: tmux 3.4+ compatibility - "Failed to create terminal" on Linux/WSL2#6

Open
FadulSikderUTA wants to merge 1 commit intoTheAgentContextLab:main from
FadulSikderUTA:fix/tmux-3.4-split-window-compatibility
Open

fix: tmux 3.4+ compatibility - "Failed to create terminal" on Linux/WSL2 #6
FadulSikderUTA wants to merge 1 commit intoTheAgentContextLab:main from
FadulSikderUTA:fix/tmux-3.4-split-window-compatibility

Conversation

@FadulSikderUTA
Copy link

@FadulSikderUTA FadulSikderUTA commented Feb 9, 2026
edited
Loading

Summary

Fixes the "Failed to create terminal" error when clicking the + button in the Aline Dashboard on systems running tmux >= 3.4 (Ubuntu 24.04, WSL2, Fedora 40+, Arch Linux, etc.).

Relates to #4.

Root Cause

tmux 3.4 deprecated the -p (percentage) flag for split-window. The existing code uses -p 50 which silently fails with a "size missing" error on tmux 3.4+. The replacement is -l 50% (the -l flag with a % suffix).

This causes a cascade failure:

  1. bootstrap_dashboard_into_tmux()split-window -h -p 50 fails → right pane never created
  2. ensure_right_pane() retries every 5 seconds → same split-window -p failure → same "size missing" error
  3. create_inner_window() → returns None because right pane doesn't exist → "Failed to create terminal" toast

Two additional issues compound the problem on Linux:

  • subprocess.run() for tmux attach uses capture_output=True, which prevents tmux from connecting to a real TTY (works on macOS due to different PTY handling)
  • ensure_right_pane() uses _run_tmux() (no socket flag) instead of _run_outer_tmux() (explicit -L aline_dash), causing commands to target the wrong tmux server

Changes

All changes are in src/realign/dashboard/tmux_manager.py (patch file included at patches/tmux-3.4-split-window-fix.patch):

# Location Change Reason
1 bootstrap_dashboard_into_tmux() L512, L519 new-session -dnew-session -d -x 200 -y 50 Provide default dimensions for detached sessions so split-window has a size to work with
2 bootstrap_dashboard_into_tmux() L611-612 -p 50-l 50% tmux 3.4 compat: replace deprecated -p with -l N%
3 bootstrap_dashboard_into_tmux() L664-665 Remove text=True, capture_output=True Allow tmux attach to connect to a real TTY on Linux
4 ensure_right_pane() L847 _run_tmux()_run_outer_tmux() Use explicit -L aline_dash socket for list-panes
5 ensure_right_pane() L866 _run_tmux()_run_outer_tmux() Use explicit -L aline_dash socket for split-window
6 ensure_right_pane() L870-871 -p N-l N% tmux 3.4 compat: replace deprecated -p with -l N%

Environment Tested

  • OS: Ubuntu 24.04 LTS on WSL2 (Windows 11)
  • tmux: 3.4 (tmux -Vtmux 3.4)
  • Python: 3.12
  • aline-ai: 0.8.0 (installed via uv tool install aline-ai)

How to Verify

# Check tmux version (issue affects 3.4+)
tmux -V
# Quick test: the -p flag fails, -l works
tmux new-session -d -s test_compat -x 200 -y 50
tmux split-window -h -p 50 -t test_compat # FAILS: "size missing"
tmux split-window -h -l 50% -t test_compat # WORKS
tmux kill-session -t test_compat

Test Plan

  • Verified fix resolves "Failed to create terminal" on WSL2 Ubuntu 24.04 with tmux 3.4
  • Dashboard bootstraps correctly into tmux with side-by-side layout
  • Terminal creation via + button works after fix
  • Verify backward compatibility with tmux 3.3 and earlier (the -l N% syntax is supported since tmux 3.1)

Fixes "Failed to create terminal" error on systems with tmux >= 3.4.
Root cause: tmux 3.4 deprecated the -p (percentage) flag for split-window,
causing "size missing" errors. Also fixes capture_output preventing tmux
attach from connecting to a real TTY, and ensures explicit socket usage
in ensure_right_pane().
Changes to src/realign/dashboard/tmux_manager.py:
1. Replace -p N with -l N% for split-window (tmux 3.4 compat)
2. Add -x 200 -y 50 to new-session -d for default dimensions
3. Remove capture_output=True from tmux attach subprocess
4. Use _run_outer_tmux instead of _run_tmux in ensure_right_pane
Closes TheAgentContextLab#4 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

Comments

AltStyle によって変換されたページ (->オリジナル) /