Topic: Close Current File doesn't Kill exe

Jeff,

I have a suggestion for consideration.

When running a program x.exe in SF v2.7 and displaying output in the console, I have sometimes inadvertently hit the "Close Current File" button instead of the "Kill" button to stop the x.exe program.  The result is that the Console tab closes but the program x.exe remains running "invisibly" in the background.  It takes a Ctrl-Alt-Del to remove it from running. Rebuilding the program also doesn't resolve the problem since SF won't rebuild when x.exe is running.

Would it be possible to revise the "close current file" button such that it will also "Kill" a running exe in the background?

Thanks,

Frank

Re: Close Current File doesn't Kill exe

Frank,

I think I agree with your proposal, although I have to think about it.  In the meantime, you can always select "Open Console" from the View menu.  It should give you the ability to kill your program after reopening.

Jeff Armstrong
Approximatrix, LLC

Re: Close Current File doesn't Kill exe

Frank,

I think what I'll do is provide a warning when you attempt to close the console when a child process is running.  That way it doesn't just close by mistake.

Jeff Armstrong
Approximatrix, LLC

Re: Close Current File doesn't Kill exe

Jeff, is it possible for SF to test whether the user's executable is using a program window?
If so then here's a further suggestion:

IF (The executable has opened a Window) THEN
     !the user still has control of the program window, so
     Just do as the user asks and close the console tab
ELSE
     !with no Window open
     Issue a warning, with options for the executable:
     - Leave still running as a background process
     - Exit and close
END IF

---
John

Re: Close Current File doesn't Kill exe

John,

That's along the lines of what I was thinking.  However, it might be tricky to detect if the program itself opened a window.  Not impossible, though, just tricky.

Jeff Armstrong
Approximatrix, LLC

6 (edited by davidb 2013-12-09 09:44:20)

Re: Close Current File doesn't Kill exe

I don't really agree with this suggestion.

It would be much easier just to disable the close button on the console window while the user's program is running.

- This way programs that don't use the console are not affected at all.
- Programs that use the console can only be stopped using the stop button and cannot lose their output by a user's mistake.

You can probably setup an interrupt on the close button, then just return if the user's program is still running, and action the close if it isn't.

--
David

Re: Close Current File doesn't Kill exe

I've come up with some improvements that should satisfy everyone.  I don't really think the warning dialogs or assumed behavior is the correct way to handle things.  Instead, the new version will change the Run toolbar button to a Terminate button once the project's executable starts. 

http://i.imgur.com/sN86x0B.png

Additionally, the button provides a dropdown for a few more options, namely launching using an external console and reopening the console when the program starts.

http://i.imgur.com/G7qemoF.png

If people have some further suggestions, please let me know.

Jeff Armstrong
Approximatrix, LLC