in reply to Win32::Console Question: How to attache a process to console

Why are you using Win32::Spawn?

By default, processes inherit the same console as their parent.

The way to change that default is to create one (or more) consoles prior to creating the process, and supply their handle(s) in the hStdInput, hStdOutput, hStdError elements of the STARTUPINFO structure passed to the CreateProcess().

Alternatively, you could just obtain the console handles associated with the current process, before starting the child process, since it will inherit the console of it's parent.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
RIP an inspiration; A true Folk's Guy