I use the radian console in VSCode.
To replicate my problem, run:
learnr::run_tutorial("Hello", package = "learnr")
The tutorial (which is basically a shiny app) pops up in a viewer and the output of the console is this:
Loading required package: shiny
Listening on http://127.0.0.1:7513
Browsing http://127.0.0.1:7513
All of this is perfectly fine, but:
The usual radian console r$>
prompt disappears and I do not know how to get it back. Each time I have to close the current console and open a fresh instance.
I know that when rendering tutorials in RStudio, a "Job Output" Tab is opened in a seperate console, and i can stop the running Job (e.g. listening to the active shiny app) with a button.
How can I get back to interactive mode from "listening to job output mode"?
I tried different keypresses, tried to look up radian
wiki and FAQ, looked for buttons in VSCode.
The default is ctrl + c
. However, if you want to change it, you can add the following to your keybindings.json:
{
"key": "Cmd+c",
"command": "workbench.action.terminal.sendSequence",
"args": {
"text": "\u0003"
},
"when": "terminalFocus || (editorTextFocus && !editorHasSelection)"
},
Notes:
Cmd+
bit is from the docs. I don't have a Mac so I haven't tested it, but a similar command works on Windows."\u0003"
is an escape sequence for END OF TEXT that sends an interrupt to the terminal.when
clauses ensure the interrupt is sent only when you're in the terminal, or in the editor and do not have text selected. This is to avoid sending an interrupt when you're copy and pasting. You may wish to change the when
clauses or add others - see more in the when clause contexts docs.