mirror of
https://github.com/mikeyobrien/ralph-orchestrator.git
synced 2026-04-25 23:25:57 +03:00
[GH-ISSUE #99] fix(tui): TUI hangs on startup due to signal handler deadlock (macOS) #42
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ralph-orchestrator#42
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @memyselfandm on GitHub (Jan 23, 2026).
Original GitHub issue: https://github.com/mikeyobrien/ralph-orchestrator/issues/99
Summary
Ralph hangs silently on startup when TUI is enabled (default behavior), but works correctly with
--no-tuiflag. This regression was introduced in v2.2.1.Environment
Reproduction
Expected Behavior
TUI should initialize and display the Ralph header, iteration info, and begin orchestration.
Actual Behavior
Root Cause
Deadlock between tokio signal handlers and crossterm TUI initialization on macOS.
Problematic sequence in
crates/ralph-cli/src/loop_runner.rs:ctrl_c(),SIGTERM, andSIGHUPsignal handlingtui.run().awaitcrates/ralph-tui/src/app.rs:114-131):enable_raw_mode()EventStream::new()On macOS, when tokio signal handlers are already registered and crossterm tries to enable raw mode or create an EventStream, a deadlock occurs.
Introduced By
Refactor in commit
f0af5d6(PR #97) which modularizedloop_runner.rschanged the signal setup order/TUI initialization sequence.Proposed Fix
Move signal handler registration to AFTER TUI initialization completes (after the 100ms sleep at line 253).
This ensures:
Workaround
Use
--no-tuiflag until fix is available: