You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The wrapper re-run used os.execvp to replace the process, which only has
POSIX semantics; on Windows os.exec* spawns a new process and exits the
caller, so the exit code and stdout/stderr don't propagate. Keep execvp
on POSIX (clean, no extra process) and on Windows spawn the command,
wait, and forward its exit code. The subprocess tests, and their wrapper
scripts, use spawn-and-wait too, so they no longer skip on Windows.
Also document how running through a wrapper differs on Linux/macOS vs.
Windows, and why.
Copy file name to clipboardExpand all lines: docs/03_reference/wrapper.md
+9Lines changed: 9 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -66,6 +66,15 @@ As noted above, a `wrapper` in your selected profile already applies in the edit
66
66
67
67
This wraps tests you run or debug from the Test Explorer and takes precedence over the profile's `wrapper`. It is an **IDE-only override** — it has no effect on the command line.
68
68
69
+
## How it runs on Linux/macOS vs. Windows
70
+
71
+
The wrapper contract is the same everywhere, but RobotCode hands the run to the wrapper differently depending on the operating system, and the resulting process tree differs:
72
+
73
+
-**Linux / macOS** — RobotCode **replaces itself** with the wrapper command (a POSIX `exec`). No extra process is left behind: the wrapper inherits RobotCode's process ID, stdio and signals directly. A shell wrapper can end with `exec "$@"` to replace itself with the run in turn, so signals and the exit code flow through on their own.
74
+
-**Windows** — Windows has no way to replace a running process the way POSIX `exec` does. So RobotCode **starts the wrapper as a child process, waits for it, and forwards its exit code**. One extra RobotCode process stays in the tree just to wait. There is no `exec` here — a PowerShell wrapper simply runs the command as a child (`& $Command[0] …`) and waits, exactly as the example below does.
75
+
76
+
Either way the rules you write the script against don't change: run the command in the **foreground**, pass **stdio** through, and **propagate the exit code**.
77
+
69
78
## Writing your own wrapper script
70
79
71
80
A wrapper is just a command. RobotCode runs it with the arguments you configured first, and then appends the actual `robotcode` command line that has to run:
0 commit comments