Author: Reid Kleckner
Date: 2019-11-22T11:28:42-08:00
New Revision: e1e7b6f381a9a5640605fdc4a3e78eb01f8fc8b9

URL: 
https://github.com/llvm/llvm-project/commit/e1e7b6f381a9a5640605fdc4a3e78eb01f8fc8b9
DIFF: 
https://github.com/llvm/llvm-project/commit/e1e7b6f381a9a5640605fdc4a3e78eb01f8fc8b9.diff

LOG: [clang-include-fixer] Suppress cmd prompt from Vim on Windows

Copied from the clang-format.py editor integration.

Reviewers: bkramer

Differential Revision: https://reviews.llvm.org/D70518

Added: 
    

Modified: 
    clang-tools-extra/clang-include-fixer/tool/clang-include-fixer.py

Removed: 
    


################################################################################
diff  --git a/clang-tools-extra/clang-include-fixer/tool/clang-include-fixer.py 
b/clang-tools-extra/clang-include-fixer/tool/clang-include-fixer.py
index 4c38f71ef76a..df05101e4fd8 100644
--- a/clang-tools-extra/clang-include-fixer/tool/clang-include-fixer.py
+++ b/clang-tools-extra/clang-include-fixer/tool/clang-include-fixer.py
@@ -85,9 +85,16 @@ def GetUserSelection(message, headers, 
maximum_suggested_headers):
 
 
 def execute(command, text):
+  # Avoid flashing a cmd prompt on Windows.
+  startupinfo = None
+  if sys.platform.startswith('win32'):
+    startupinfo = subprocess.STARTUPINFO()
+    startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
+    startupinfo.wShowWindow = subprocess.SW_HIDE
+
   p = subprocess.Popen(command,
                        stdout=subprocess.PIPE, stderr=subprocess.PIPE,
-                       stdin=subprocess.PIPE)
+                       stdin=subprocess.PIPE, startupinfo=startupinfo)
   return p.communicate(input=text)
 
 


        
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to