如何让弧度控制台停止监听渲染输出?

huangapple go评论67阅读模式
英文:

how to make the radian console stop listening to rendered output?

问题

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 separate 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 key presses, tried to look up radian wiki and FAQ, looked for buttons in VSCode.

英文:

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.

答案1

得分: 2

以下是您要翻译的内容:

默认是 ctrl + c。然而,如果您想更改它,您可以将以下内容添加到您的 keybindings.json 文件中:

{
    "key": "Cmd+c",
    "command": "workbench.action.terminal.sendSequence",
    "args": {
        "text": "\u0003"
    },
    "when": "terminalFocus || (editorTextFocus && !editorHasSelection)"
}

注意:

  1. Cmd+ 部分来自文档。我没有使用Mac,所以我没有测试过,但类似的命令在Windows上有效。
  2. "\u0003"END OF TEXT的转义序列,用于发送中断到终端
  3. when 子句确保只有在您位于终端中或在编辑器中没有选择文本时才发送中断。这是为了避免在复制和粘贴时发送中断。您可以根据需要更改 when 子句或添加其他条件 - 在when子句上下文文档中了解更多信息。
英文:

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:

  1. The 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.
  2. "\u0003" is an escape sequence for END OF TEXT that sends an interrupt to the terminal.
  3. The 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.

huangapple
  • 本文由 发表于 2023年4月19日 15:08:42
  • 转载请务必保留本文链接:https://go.coder-hub.com/76051641.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定