quarto-dev / quarto-vscode

Quarto extension for VS Code
https://marketplace.visualstudio.com/items?itemName=quarto.quarto
MIT License
112 stars 11 forks source link

Render at background #96

Closed albert-ying closed 2 years ago

albert-ying commented 2 years ago

Currently running render quarto opens the terminal panel and runs the command. It would be better if there was an option to run it at the background (like knit in vscode-R extension)

jjallaire commented 2 years ago

See previous discussion of this here: https://github.com/quarto-dev/quarto-vscode/issues/87

albert-ying commented 2 years ago

Ok, this is reasonable. However, it is still very intrusive as each time of rendering the terminal panel pops up (especially when I enable render on save, which also cause loss of focus of editor on save)

In vscode-R, there is a feature that allows the terminal panel not to pop up when the command is executed; maybe the can be implemented here as an option? https://github.com/REditorSupport/vscode-R/issues/510

jjallaire commented 2 years ago

I'm surprised about the render-on-save behavior (as I can't repro that and we definitely have code intended to preserve editor focus). Are you editing a qmd or a notebook?

The reason we bring the pane forward is to show progress/feedback/errors. I think the right solution here is that we stop doing that entirely and just show progress/feedback/errors directly in the preview window (so then we would still use a Terminal in VS Code but the only time it would ever auto-activate is during the initial render).

albert-ying commented 2 years ago

I'm surprised about the render-on-save behavior (as I can't repro that and we definitely have code intended to preserve editor focus).

It's qmd. I noticed that the focus is lost only when the terminal is initiating (and .bashrc is loading, which took 3 sec in my case). And the focus is back after this time.

we bring the pane forward is to show progress/feedback/errors

Yeah, this is reasonable. But it can be optional (even default), people can always manually toggle the terminal to check.

I think the right solution here is that we stop doing that entirely and just show progress/feedback/errors directly in the preview window

My main problem with current behavior is that I use to render on save as a way to live preview as I'm writing, and there is no space left on the screen for the terminal. And I would have to manually close the terminal on each save. Anything that could save me from this would be really appreciated!

jjallaire commented 2 years ago

I think you can get the behavior you want right now by manually executing quarto preview in the VS Code terminal (that will have render-on-save behavior by default and will not be in any way synced with the Quarto render/save cycle). You might actually need to turn off the VS Code "Render on Save" for Quarto so it doesn't interfere.

jjallaire commented 2 years ago

Hi there, we've made a change to the extension to only bring the terminal forward on the initial render. Subsequent renders (via save or otherwise) will show subtle progress in the status bar but will not bring the terminal format. Note that if an error occurs the terminal is however brought forward. This is available in the latest release of the extension (v1.49.0)