How can a Wolframscript be terminated by Ctrl+C without yielding the Interrupt prompt (see e.g. here)? Unfortunately, this self-proclaimed hack causes a segmentation fault in Mathematica 12.3.1 under Linux.
Here is a concrete example where this problem arises and would benefit from a proper solution. Suppose you have a Wolframscript running a server.
#!/usr/bin/env wolframscript
...
SocketListen[{ip, port}, handler];
While[True, Pause[10]];
Pressing Ctrl+C brings up the interrupt prompt. Clearly, the last line of this script - which is supposed to express "wait forever until interrupted" - is also rather ugly.
Can this be properly solved using Tasks? Any suggestions are welcome.
$BatchInputis supposed to do this, but it doesn't appear to if you set it... $\endgroup$$Inspectorto nothing, but that also doesn't seem to have an effect. But per the docs these both seem like they should bypass this menu. $\endgroup$kill -9 <pid>from another shell. $\endgroup$