1 2 3 4 5 6 7
pub fn attach_console() { #[cfg(target_os = "windows")] unsafe { use windows::Win32::System::Console::{ATTACH_PARENT_PROCESS, AttachConsole}; let _ = AttachConsole(ATTACH_PARENT_PROCESS); }; }