fix(tui): suppress preflight stdout output in TUI mode to prevent scrambled display
- Add silentMode field to restore Engine struct - Set silentMode=true in NewSilent() constructor for TUI mode - Skip fmt.Println output in printPreflightSummary when in silent mode - Log summary instead of printing to stdout in TUI mode - Fixes scrambled output during cluster restore preflight checks
This commit is contained in:
@@ -542,7 +542,20 @@ func (e *Engine) calculateRecommendedParallel(result *PreflightResult) int {
|
||||
}
|
||||
|
||||
// printPreflightSummary prints a nice summary of all checks
|
||||
// In silent mode (TUI), this is skipped and results are logged instead
|
||||
func (e *Engine) printPreflightSummary(result *PreflightResult) {
|
||||
// In TUI/silent mode, don't print to stdout - it causes scrambled output
|
||||
if e.silentMode {
|
||||
// Log summary instead for debugging
|
||||
e.log.Info("Preflight checks complete",
|
||||
"can_proceed", result.CanProceed,
|
||||
"warnings", len(result.Warnings),
|
||||
"errors", len(result.Errors),
|
||||
"total_blobs", result.Archive.TotalBlobCount,
|
||||
"recommended_locks", result.Archive.RecommendedLockBoost)
|
||||
return
|
||||
}
|
||||
|
||||
fmt.Println()
|
||||
fmt.Println(strings.Repeat("─", 60))
|
||||
fmt.Println(" PREFLIGHT CHECKS")
|
||||
|
||||
Reference in New Issue
Block a user