mirror of
https://github.com/mikeyobrien/ralph-orchestrator.git
synced 2026-04-25 07:05:57 +03:00
[PR #160] [MERGED] Fix: TUI display corruption when launched via default command #171
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ralph-orchestrator#171
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?
📋 Pull Request Information
Original PR: https://github.com/mikeyobrien/ralph-orchestrator/pull/160
Author: @cockroach-eater
Created: 2/6/2026
Status: ✅ Merged
Merged: 2/6/2026
Merged by: @mikeyobrien
Base:
main← Head:fix-tui-at-run-without-args📝 Commits (1)
123cc6ffix tui at run without args📊 Changes
2 files changed (+2 additions, -0 deletions)
View changed files
📝
crates/ralph-cli/src/main.rs(+1 -0)📝
crates/ralph-tui/src/app.rs(+1 -0)📄 Description
Bug
When launching Ralph without a subcommand (
ralphinstead ofralph run), the TUI renders with severe visual corruption - log output bleeds into the terminal display, making it unusable until the window is resized.Root Cause
The
tui_enabledflag inmain.rsdetermines whether tracing output is redirected from stdout to a log file. This flag only matchedSome(Commands::Run(...))andSome(Commands::Resume(...)), but the default command (no subcommand) producescli.command = None- which fell through to_ => false.The result: TUI was started by the
Nonearm (which createsRunArgswithno_tui: false), but the tracing subscriber was configured to write to stdout instead of a file. Everytracing::info!()call wrote directly to the terminal, corrupting the alternate screen buffer that ratatui manages.Steps to Reproduce
ralph(no subcommand) in a project with a validralph.ymlExpected Behavior
TUI renders cleanly with header, content pane, and footer. Log output goes to
.ralph/diagnostics/logs/.Actual Behavior
Raw tracing log lines (
2026-... INFO ralph_core::event_loop: ...) render directly on the terminal, overlapping and corrupting the TUI layout. Resizing the window temporarily fixes the display because ratatui forces a full repaint, but the next log line corrupts it again.Fix
crates/ralph-cli/src/main.rs- AddNone => trueto thetui_enabledmatch so the default command (no subcommand) correctly redirects logs to a file:crates/ralph-tui/src/app.rs- Addterminal.clear()after terminal initialization. This is a ratatui best practice that ensures the first frame renders correctly regardless of the alternate screen's initial state.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.