Allow a script to kill itself without run permissions #8299
Labels
cli
related to cli/ dir
permissions
related to --allow-* flags
suggestion
suggestions for new features (yet to be agreed)
If this has already been discussed in another issue I'm sorry, I haven't found one.
I'am working on cliffy and we are trying to improve the sigint handling of the prompt module, if a user hit's
ctrl+c
. The problem is, deno doesn't trigger the sigint signal automaticly, because we need to enable the raw mode withDeno.setRaw
.Currently, the prompt module just exits if the user hit's
ctrl+c
by callingDeno.exit
. But instead of just exiting the programm, we want to use theDeno.kill
method to rise a sigint, so it's possible to run some cleanup operations if the user hit'sctrl+c
.But currently it's not possible to rise a signal without the
--allow-run
permissions flag. And i don't want the prompt module to depend on the--allow-run
flag.One option to improve this could be to allow a script to kill itself without the
--allow-run
flag. This could be done by checking the pid of the running script. If the pid passed toDeno.kill
matches the pid of the running script, the--allow-run
flag is not required.The text was updated successfully, but these errors were encountered: