Skip to content

Commit 4d35dfa

Browse files
authored
Never open console window for subprocess (#74)
1 parent 2d62877 commit 4d35dfa

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Rubjerg.Graphviz/GraphvizCommand.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ public static (byte[] stdout, string stderr) Exec(Graph input, string format = "
6464
process.StartInfo.RedirectStandardOutput = true;
6565
process.StartInfo.RedirectStandardInput = true;
6666
process.StartInfo.RedirectStandardError = true;
67+
// In some situations starting a new process also starts a new console window, which is distracting and causes slowdown.
68+
// This flag prevents this from happening.
69+
process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
6770

6871
StringBuilder stderr = new StringBuilder();
6972
process.ErrorDataReceived += (_, e) => stderr.AppendLine(e.Data);

0 commit comments

Comments
 (0)