diff options
author | Alexander Bantyev <balsoft@balsoft.ru> | 2021-11-26 17:38:46 +0300 |
---|---|---|
committer | Alexander Bantyev <balsoft@balsoft.ru> | 2021-12-06 16:51:55 +0300 |
commit | 0a2fa2d68460eca946c91b72cd264725e5cda7db (patch) | |
tree | 75b89d7f5d549a501be198e3829e48d5fce7d067 /src/libmain/shared.hh | |
parent | d1aaa7ef71713b6693ad3ddf8704ce62bab82095 (diff) |
RunPager: restore stdout upon pager exit
Before this change, stdout was closed after the pager exits. This is
fine for non-interactive commands where we want to exit right after
the pager exits anyways, but for interactive things (e.g. nix repl)
this breaks the output after we quit the pager.
Keep the initial stdout fd as part of RunPager, and restore it in
RunPager::~RunPager using dup2.
Diffstat (limited to 'src/libmain/shared.hh')
-rw-r--r-- | src/libmain/shared.hh | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/libmain/shared.hh b/src/libmain/shared.hh index 05277d90a..ed012959b 100644 --- a/src/libmain/shared.hh +++ b/src/libmain/shared.hh @@ -88,6 +88,7 @@ public: private: Pid pid; + int stdout; }; extern volatile ::sig_atomic_t blockInt; |