Specific to Mac -- simple reproducible example:
Sys.sleep(60)
print("output")
The help page for Sys.sleep() says that it should check for interrupts, but it doesn't seem to respect any form thereof, not ctrl-c, not Esc, not the stop button. You can use a ctrl-c interrupt running the script from the terminal, but that kills the entire script.
I'd like to have a set delay interval that I can still interrupt, at which point the script will continue (so, "output" would still print even if 60s had not yet elapsed). Is there a (hopefully not too resource-heavy) way to do this?
More generally, is there any way to interrupt a Sys.sleep call on a Mac when you're not in the terminal, regardless of what happens afterwards?
Relevant resources that still don't seem to address this:
https://cran.r-project.org/bin/macosx/RMacOSX-FAQ.html#How-can-I-interrupt-lengthy-operations-or-output_003f <-- Apparently can inject an interrupt from the terminal? But this is clunky and certainly doesn't get at the main goal.