attach_console

Function attach_console 

Source
pub fn attach_console()
Expand description

Connect to parent stdio if disconnected.

In a CLI app this does nothing, in a GUI app (windows_subsystem = “windows”) attaches to console.

Note that the Windows console returns immediately when it spawns "windows" executables, so any output will not appear to be from your app and nothing stops the user from spawning another app causing text from your app to mix with other streams. This is bas but it is what VSCode does, see build_cli_com_proxy for how to implement a more polished solution.