From 81cd0a113b8da1485c2f892c9dd9edb541f139ad Mon Sep 17 00:00:00 2001 From: regnat Date: Fri, 14 Jan 2022 13:41:45 +0100 Subject: [PATCH] Start the pager early-enough in `nix why-depends` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `nix why-depends` is piping its output into a pager by default. However the pager was only started after the first path is printed, causing it to be excluded from the pager output. (Actually the pager was started *inside* the recursive function that was printing the dependency chain, so a new instance was started at each level. It’s a little miracle that it worked at all). Fix #5911 --- src/nix/why-depends.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nix/why-depends.cc b/src/nix/why-depends.cc index e27f56ef5..dd43bd1c3 100644 --- a/src/nix/why-depends.cc +++ b/src/nix/why-depends.cc @@ -239,7 +239,6 @@ struct CmdWhyDepends : SourceExprCommand visitPath(pathS); - RunPager pager; for (auto & ref : refs) { std::string hash(ref.second->path.hashPart()); @@ -259,6 +258,7 @@ struct CmdWhyDepends : SourceExprCommand } }; + RunPager pager; try { printNode(graph.at(packagePath), "", ""); } catch (BailOut & ) { }