From a08a80d83a9dbcc50d2927ba63ccca4c926933a9 Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Mon, 3 Sep 2018 21:28:00 +0530 Subject: [PATCH] wrap: Redirect git's stdin to DEVNULL Otherwise, git fiddles with the cmd.exe console's color behaviour and disables it, which causes it to stop interpreting ANSI color codes outputted by meson for colored output. Effectively, as soon as any subproject is initialized, cmd.exe goes nice coloured output to ugly raw ANSI codes. --- mesonbuild/wrap/wrap.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mesonbuild/wrap/wrap.py b/mesonbuild/wrap/wrap.py index 54a928e25..6c4be4c25 100644 --- a/mesonbuild/wrap/wrap.py +++ b/mesonbuild/wrap/wrap.py @@ -40,7 +40,7 @@ def build_ssl_context(): return ctx def quiet_git(cmd, workingdir): - pc = subprocess.Popen(['git', '-C', workingdir] + cmd, + pc = subprocess.Popen(['git', '-C', workingdir] + cmd, stdin=subprocess.DEVNULL, stdout=subprocess.PIPE, stderr=subprocess.PIPE) out, err = pc.communicate() if pc.returncode != 0: