Skip to content

Add live tool output console for the Linux GUI#998

Open
gmipf wants to merge 1 commit into
SabreTools:masterfrom
gmipf:pr/4-linux-dump-console
Open

Add live tool output console for the Linux GUI#998
gmipf wants to merge 1 commit into
SabreTools:masterfrom
gmipf:pr/4-linux-dump-console

Conversation

@gmipf

@gmipf gmipf commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

What

On Linux the dumping tools (redumper, DiscImageCreator, Aaru) run without a console window of their own, so their live progress output was not visible anywhere in the GUI. This adds an in-app Program Output window that streams the tool's stdout/stderr live while it runs.

Scope: Linux only, for now

The console is wired up only on Linux. On Windows, macOS, the WPF GUI and the CLI nothing changes — the output sink stays null, so the original UseShellExecute launch path is used exactly as before. I kept this conservative for the first cut; if you're happy with the approach, a natural follow-up would be to unify it across all platforms (and drop the separate CMD window on Windows). Happy to discuss.

How it works

  • MPF.ExecutionContextsBaseExecutionContext gains an optional Action<string>? OutputReceived. When set, the tool is started with RedirectStandardOutput/Error and read raw (char-level, carriage-return aware) on two background threads, so \r progress redraws don't flood the log. When null (every current caller), the launch path is unchanged. Kept net20-safe (no Channels/async) for the multi-targeted projects.
  • MPF.FrontendDumpEnvironment.ToolOutputReceived forwards the stream. A minimal IToolOutputConsole seam (Open / Append / NotifyToolExited) lets a frontend present the output without the frontend layer taking a UI dependency. New GuiSettings.ToolConsoleAutoClose option, round-tripped through OptionsLoader.
  • MPF.AvaloniaToolOutputWindow renders the stream in a virtualized, terminal-style view (fixed-height rows, \r/\n line discipline, copy / select-all). Shown modeless and owned beside the main window, so the main window and its Stop button stay fully responsive. An "auto-close when the program exits" checkbox (default on) is persisted to the config.

Localization

New user-facing strings added to Strings.xaml and Strings.de.xaml.

Testing

  • Full solution builds clean across all target frameworks (net20 → net10.0): 0 warnings, 0 errors.
  • MPF.ExecutionContexts.Test (615) and MPF.Frontend.Test (529) pass with 0 failures on net8.0/net9.0/net10.0.
  • Manually verified on Fedora KDE (Avalonia, .NET 10) with real redumper and DiscImageCreator dumps of a PhotoCD disc: live output streams correctly, the window stays responsive, Stop works, and the auto-close preference persists across restarts.

Prepared with AI assistance (Claude Opus 4.8) and reviewed before submission.

On Linux the dumping tools (redumper/DiscImageCreator/Aaru) have no console
window of their own, so their live progress was invisible in the GUI. This
adds an opt-in output console, wired only on Linux for now; Windows, macOS,
the WPF GUI and the CLI keep their existing behaviour byte-for-byte (the
output sink is null, so the original UseShellExecute path is unchanged).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant