Using (MBS) Shell Alternatives interactively?

So I have my own helper (worker) class which I am currently redesigning. It’s basically based on a console app using a thread to get stdin data, react to it and loop around app.doeventing (throttled on macOS by DelayMBS additionally), waiting for a “quit” command until it cancels. That used to work nicely within a Xojo shell.

That works nicely with ShellMBS too on macOS. Which brings the benefits of having a separate input handle for shell errors and the ability to terminate the shell without having to figure out the process id (or shoot the helper just by its name, which can cause troubles in case more than once instance is running). So far, so great.

This will not work for me on Windows. I can connect to the helper, send initialisation data and will receive answers, but only for about a second or so until the helper quits. With an exit code -1073741819 and no further information on why it does so. Needless to say it runs perfectly in console mode.
I tried WindowsProcessMBS too, which gives the same result.
A Xojo Shell has a TimeOut property which can be set to -1 to avoid Windows timeout. Looks like this could be the cause. But how to change?

Is it possible to use ShellMBS, WindowsProcessMBS or a different shell replacement interactively this way?

Does the helper start at all?
Like could it write a message to DebugView?

Yes, it runs for a short time. I can send a few commands and receive back some, but just for about a second. No error, no exception in the helper. The helper just quits without further notice.
You mean ShellMBS is expected to work exactly like on macOS? No timeout, interactivity possible?

Thank you, Christian. After a lot of trial and error I found it‘s not the shell. It is Björn’s FileSystemWatcher that does not want me to subclass it in code on Windows. The subclass is crashing in its constructor without further notice.
Think I’ll have to write another thread here :wink:

1 Like