other platforms.
On Windows, VSCode gets launched as a child process, which kills the
editor when Factor exits. This is not what we want. Add an overridable
option to launch editors as child processes, which should get repated
when Factor quits.
The confusion comes from ``run-detached`` which itself just
waits until the child process returns (as opposed to "detaching" a child
process from the parent process, which is called +new-group+ or
+new-session+ instead).
HOOK: editor-detached? editor-class ( -- ? )
M: object editor-detached? t ;
+HOOK: editor-is-child? editor-class ( -- ? )
+M: object editor-is-child? f ;
+
: run-and-wait-for-editor ( command -- )
<process>
swap >>command
editor-detached? >>detached
+ editor-is-child? [ +new-group+ >>group ] unless
run-process
300 milliseconds sleep
dup status>> { 0 f } member?