R with shiny: interpreter release for shiny examples

Hi,

Using Rgui.exe, after submitting the lines below:

library(shiny)
runExample()
runExample('01_hello')

How is it possible to release the R interpreter without having to type ESC?

In other words, I'm looking for something similar to session$onSessionEnded, so that when the browser tab is closed, the R interpreter is released to receive new instructions.

Is there any possibility?
I consider using ESC an abnormal way to kill a process.

Best,

I noticed that the runExample function from the shiny package is working fine, in a suitably friendly way, only in RStudio's internal viewer.

shiny is a package that can be used by various flavors of R and with the use of GUIs or IDEs other than RStudio. Isn't it correct that the runExample function has an argument (for example, CloseOnSessionEnded=TRUE) to terminate the process as soon as the user's browser tabsheet is closed or a key is typed while the browser has focus?

no, you can do ?runExample and see the documented arguments.
also args(runExample)