File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -237,6 +237,13 @@ mod prepare {
237237 } else {
238238 Command :: new ( prep. command )
239239 } ;
240+ // We never want to have terminals pop-up on Windows if this runs from a GUI application.
241+ #[ cfg( windows) ]
242+ {
243+ use std:: os:: windows:: process:: CommandExt ;
244+ const CREATE_NO_WINDOW : u32 = 0x08000000 ;
245+ cmd. creation_flags ( CREATE_NO_WINDOW ) ;
246+ }
240247 cmd. stdin ( prep. stdin )
241248 . stdout ( prep. stdout )
242249 . stderr ( prep. stderr )
@@ -401,6 +408,8 @@ pub mod shebang {
401408/// - `stdout` is captured for consumption by the caller
402409/// - `stderr` is inherited to allow the command to provide context to the user
403410///
411+ /// On Windows, terminal Windows will be suppressed automatically.
412+ ///
404413/// ### Warning
405414///
406415/// When using this method, be sure that the invoked program doesn't rely on the current working dir and/or
You can’t perform that action at this time.
0 commit comments