From 2afdf1ed660d0592bf488fa1be68fe0666716421 Mon Sep 17 00:00:00 2001 From: Alois Wohlschlager Date: Wed, 18 Sep 2024 19:25:25 +0200 Subject: path-info: wipe the progress bar before printing The legitimate output of `nix path-info` may visually interfere with the progress bar, by appending to stale progress output before the latter has been erased. Conveniently, all expensive operations (evaluation or building) have already been performed before, so we can simply wipe the progress bar at this point to fix the issue. Fixes: https://git.lix.systems/lix-project/lix/issues/343 Change-Id: Id9a807a5c882295b3e6fbf841f9c15dc96f67f6e --- src/nix/path-info.cc | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/nix/path-info.cc b/src/nix/path-info.cc index b14eef467..05578ea53 100644 --- a/src/nix/path-info.cc +++ b/src/nix/path-info.cc @@ -82,6 +82,10 @@ struct CmdPathInfo : StorePathsCommand, MixJSON void run(ref store, StorePaths && storePaths) override { + // Wipe the progress bar to prevent interference with the output. + // It's not needed any more because expensive evaluation or builds are already done here. + logger->pause(); + size_t pathLen = 0; for (auto & storePath : storePaths) pathLen = std::max(pathLen, store->printStorePath(storePath).size()); -- cgit v1.2.3