Fix: Disable stdout progress in TUI mode to prevent display breaking

This commit is contained in:
2025-11-07 10:50:45 +00:00
parent e002d3f8f9
commit 07ab4109ec
4 changed files with 17 additions and 2 deletions

View File

@ -40,6 +40,21 @@ func New(cfg *config.Config, log logger.Logger, db database.Database) *Engine {
}
}
// NewSilent creates a new restore engine with no stdout progress (for TUI mode)
func NewSilent(cfg *config.Config, log logger.Logger, db database.Database) *Engine {
progressIndicator := progress.NewNullIndicator()
detailedReporter := progress.NewDetailedReporter(progressIndicator, &loggerAdapter{logger: log})
return &Engine{
cfg: cfg,
log: log,
db: db,
progress: progressIndicator,
detailedReporter: detailedReporter,
dryRun: false,
}
}
// NewWithProgress creates a restore engine with custom progress indicator
func NewWithProgress(cfg *config.Config, log logger.Logger, db database.Database, progressIndicator progress.Indicator, dryRun bool) *Engine {
if progressIndicator == nil {

View File

@ -103,8 +103,8 @@ func executeRestoreWithTUIProgress(cfg *config.Config, log logger.Logger, archiv
}
defer dbClient.Close()
// Create restore engine
engine := restore.New(cfg, log, dbClient)
// Create restore engine with silent progress (no stdout interference with TUI)
engine := restore.NewSilent(cfg, log, dbClient)
// Execute restore based on type
var restoreErr error