When R function hangs due to underlying cpp code a user cannot stop it and the only way is to kill an R process. It is a well known issue and is probably due to a fundamental flaw in R design.
However what is making work in Rstudio really frustrating is that it does not account for this R flaw. For example a user is unable to save files during execution of this hung code. He can only force quit rstudio and lose work or mess it up due to subsequent errors in .user save files. I believe it should be pretty easy to fix so let's discuss how we can implement it.
Also, a user cannot even kill the session with ctrl+shift+f10 when code hangs, which is extremely detrimental for the user. This function to terminate R should work as intended i.e. terminate the process and not wait for it indefinitely.
Any ideas how to address these issues? Maybe there is a way to kill R from within rstudio without losing work I don't know about?