In some cases (such as shiny::runGist on the Mac) the IDE can get into a state where the server is busy but the client doesn't think it is, so there's no way to interrupt. This logic will send server interrupt on Escape keydown in some cases where it's currently just sending a null console event. I've tested with shiny::runGist, Sys.sleep, and scan() and it's worked well in all 3 cases.
Some edits based on the desktop file QA check on gentoo
…y activate when appropriate