Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to get out of session$attach() #281

Closed
venpopov opened this issue Apr 15, 2024 · 5 comments
Closed

how to get out of session$attach() #281

venpopov opened this issue Apr 15, 2024 · 5 comments

Comments

@venpopov
Copy link

I ran this code:

library(callr)
sess <- r_session$new()
sess$attach()

which opened an interactive console within the external session. I tested a bit, and typed q() to exist it, which I guess was a mistake, as now my console is completely non-responsive:

> sess$attach()
RS 1018860 > ls()
character(0)
RS 1018860 > a = 1
RS 1018860 > ls()
[1] "a"
RS 1018860 > 
RS 1018860 > q
function (save = "default", status = 0, runLast = TRUE) 
.Internal(quit(save, status, runLast))
<bytecode: 0x55b1affd2158>
<environment: namespace:base>
RS 1018860 > q()
fsdf
1
exit
q

Two questions:

  • How do you get out of a console from a session you attached (in general)?
  • In this case, after having typed q() and my console is unresponsive, what can I do to get back to my original session and console? I am currently running a few background jobs in this Rstudio session, so if I restart the session I will loose the jobs (they've been running for 40ish hours...)
@gaborcsardi
Copy link
Member

How do you get out of a console from a session you attached (in general)?

Press CTRL+C, or the stop button in RStudio.

In this case, after having typed q() and my console is unresponsive, what can I do to get back to my original session and console? I am currently running a few background jobs in this Rstudio session, so if I restart the session I will loose the jobs (they've been running for 40ish hours...)

Press CTRL+C, or the stop button in RStudio.

@venpopov
Copy link
Author

venpopov commented Apr 15, 2024 via email

@venpopov
Copy link
Author

If it's relevant, this is in rstudioserver via a browser

@gaborcsardi
Copy link
Member

Try pressing ESC while the console is active. How do you usually interrupt a command?

@venpopov
Copy link
Author

ESC worked, thank you! I usually interrupt with ctrl+c, and didn't occur to me to try esc when that failed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants