Skip to content

Commit

Permalink
Never open console window for subprocess (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
chtenb authored Jan 20, 2024
1 parent 2d62877 commit 4d35dfa
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Rubjerg.Graphviz/GraphvizCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ public static (byte[] stdout, string stderr) Exec(Graph input, string format = "
process.StartInfo.RedirectStandardOutput = true;
process.StartInfo.RedirectStandardInput = true;
process.StartInfo.RedirectStandardError = true;
// In some situations starting a new process also starts a new console window, which is distracting and causes slowdown.
// This flag prevents this from happening.
process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;

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

0 comments on commit 4d35dfa

Please sign in to comment.