-
Notifications
You must be signed in to change notification settings - Fork 64
fix: tmux 3.4+ compatibility - "Failed to create terminal" on Linux/WSL2#6
Open
FadulSikderUTA wants to merge 1 commit intoTheAgentContextLab:main from
Open
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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 forsplit-window. The existing code uses-p 50which silently fails with a"size missing"error on tmux 3.4+. The replacement is-l 50%(the-lflag with a%suffix).This causes a cascade failure:
bootstrap_dashboard_into_tmux()→split-window -h -p 50fails → right pane never createdensure_right_pane()retries every 5 seconds → samesplit-window -pfailure → same "size missing" errorcreate_inner_window()→ returnsNonebecause right pane doesn't exist → "Failed to create terminal" toastTwo additional issues compound the problem on Linux:
subprocess.run()fortmux attachusescapture_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 serverChanges
All changes are in
src/realign/dashboard/tmux_manager.py(patch file included atpatches/tmux-3.4-split-window-fix.patch):bootstrap_dashboard_into_tmux()L512, L519new-session -d→new-session -d -x 200 -y 50bootstrap_dashboard_into_tmux()L611-612-p 50→-l 50%-pwith-l N%bootstrap_dashboard_into_tmux()L664-665text=True, capture_output=Truetmux attachto connect to a real TTY on Linuxensure_right_pane()L847_run_tmux()→_run_outer_tmux()-L aline_dashsocket forlist-panesensure_right_pane()L866_run_tmux()→_run_outer_tmux()-L aline_dashsocket forsplit-windowensure_right_pane()L870-871-p N→-l N%-pwith-l N%Environment Tested
tmux -V→tmux 3.4)uv tool install aline-ai)How to Verify
Test Plan
+button works after fix-l N%syntax is supported since tmux 3.1)