<p></p>
<p dir="auto">I committed a 'fix' in r12173 but didn't close this issue. I don't know whether anyone continued to suffer this issue (I think both Kiefkrack and Ravancloak switched to Windows). However, looking back at it, I can't see how the 'fix' can possibly be correct. <code class="notranslate">spawn_and_wait</code> calls <code class="notranslate">system()</code> to run <code class="notranslate">Terminal_wrapper.sh</code> to run <code class="notranslate">osascript</code> which runs a script which starts <code class="notranslate">dummyscript###.sh</code>. Each of those are synchronous (excepting waiting for <code class="notranslate">dummyscript</code> to finish), but the fix assumes that they aren't. But if they aren't then there's a much bigger problem: <code class="notranslate">spawn_and_wait</code> would return before the program has finished.</p>
<p dir="auto">Writing thoughts here because I can't test on a Mac on the moment, so I'm not going to replace the code.</p>
<p dir="auto">Looking at <code class="notranslate">Terminal_wrapper.sh</code>:</p>
<pre class="notranslate"><code class="notranslate">tell application "Terminal"
    activate
    set mytab to do script "'$@'"
    delay 0.5
    repeat while mytab is busy
        delay 1
    end repeat
    close window 1
end tell
</code></pre>
<p dir="auto"><code class="notranslate">activate</code> opens the program but doesn't wait for it (which seems to be a common source of problems). Maybe <code class="notranslate">mytab is busy</code> is false while Terminal/bash are still starting (because the tab doesn't exist yet), and take longer than 0.5s to start, and so the <code class="notranslate">do script</code> and <code class="notranslate">close window 1</code> commands are only acted on by Terminal after <code class="notranslate">osascript</code> has finished.</p>
<p dir="auto">Looking at that error message, another possible issue is that the path to <code class="notranslate">dummyscript389.sh</code> is relative from the wrong current directory? However then this error should presumably always happen.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/ohrrpgce/ohrrpgce/issues/1145#issuecomment-1224997661">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AMWGWZRMLIQBR4D3GVURB5DV2VO5NANCNFSM4PZQM45Q">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AMWGWZR2AEDJAI5BPRRNVV3V2VO5NA5CNFSM4PZQM452YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOJEB7WHI.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><ohrrpgce/ohrrpgce/issues/1145/1224997661</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/ohrrpgce/ohrrpgce/issues/1145#issuecomment-1224997661",
"url": "https://github.com/ohrrpgce/ohrrpgce/issues/1145#issuecomment-1224997661",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>