Shell Process Getting Orphaned

I have an interactive shell in windows running a third party console app. When I close the shell, the process for the console app is still hanging around in Windows. It is not destroyed when the shell gets destructed. Xojo even sees this in the debugger and won’t release the debugger until I go into task manager and kill the process.

Normally in a normal DOS shell, I can send a ctrl-C to the console app to cause it to exit. However, I can’t seem to make that work in Xojo. I set canonical to true for the shell (I’ve had it set to false too - it doesn’t matter) and send chr(03) which is ctrl-C. Doesn’t kill the process.

How can I force a shell’s process to terminate?

Thanks,

Jon

how are you sending the ctrl-C?

If you are doing it with two different SHELL commands that is the reason it does not work.

Each invocation of SHELL creates a new environment (as if a new user logged on)

So you have a errant program running in SHELL #1… but SHELL #2 knows nothing about it.

How are you closing the Shell? Are you literally calling sh.Close, or are you just nil’ing the reference? Are you setting Canonical before calling Execute?