Platform: GTK 3.24.43 on FreeBSD 14.1-RELEASE-p5 GENERIC amd64
SciTE returns the wrong exit code for executed commands. Here is how to reproduce:
- Open SciTE and create a shell script named "test.sh" with the following contents:
test $1 = 5 && exit 1; sh $0 $(($1 + 1))
- From the output window execute
sh test.sh 1
- Expected exit code is 1 but will get 0.
- Edit the shell script to exit with code 2 and repeat step 2. Expected exit code is 2 but will get 1, that is, the previous expected exit code.
- Edit the shell script to exit with code 3 and repeat step 2. Expected exit code is 3 but will get 2, that is, the previous expected exit code.
Note: Sometimes the depth count only needs to be 2 for the code to be wrong but 5 is what always fails for me so try adjusting the count upwards if you should get a correct exit code.
SciTE on GTK is reporting the status value it received in a callback attached to the process with
g_child_watch_addafter passing the status value throughWEXITSTATUS. There may be some issue with how Unix handles this status value in some situations.The code converting the status into text is in
SciTEGTK::ContinueExecuteingtk/SciTEGTK.cxxso you could try debugging from that point.