From 685161fc3157026b7cb03e36eb8787b00103fe92 Mon Sep 17 00:00:00 2001 From: ZyX Date: Wed, 25 Jun 2014 21:05:58 +0400 Subject: [PATCH] Incorporate Windows hack found by @kovidgoyal Ref #36 Fixes #498 --- powerline/lib/shell.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/powerline/lib/shell.py b/powerline/lib/shell.py index a0077fc0..ea777770 100644 --- a/powerline/lib/shell.py +++ b/powerline/lib/shell.py @@ -4,6 +4,14 @@ from __future__ import absolute_import, unicode_literals, division, print_functi from subprocess import Popen, PIPE from locale import getlocale, getdefaultlocale, LC_MESSAGES +from functools import partial +import sys + + +if sys.platform.startswith('win32'): + # Prevent windows from launching consoles when calling commands + # http://msdn.microsoft.com/en-us/library/windows/desktop/ms684863(v=vs.85).aspx + Popen = partial(Popen, creationflags=0x08000000) def _get_shell_encoding():