How to set a fixed port (e.g., localhost:9999) for Quarto Preview (Ctrl+Shift+K) in Positron? #7904
-
Hi everyone, I'm a new Positron user, having recently switched from Vim. I'm frequently using the Quarto preview feature, triggered by My issue is that whenever there's an error in my Quarto document, after I fix the error and re-trigger the preview, it often launches on a new, different port. I rely on having the preview consistently on the same port (e.g., localhost:9999) because I often keep it open in a browser tab for testing and debugging. Is there a way to configure Positron so that using the Any guidance on how to achieve this would be greatly appreciated! Thanks in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Have you tried specifying preview options for your project, like this: https://quarto.org/docs/reference/projects/options.html#preview It seems like some folks may be having problems with this feature: |
Beta Was this translation helpful? Give feedback.
-
Indeed, my first thought was that is not a Positron issue, but a VSCode/Positron Quarto Extension issue, however I could not found solution for this reading the docs, seems I can't edit the Quarto tasks (by Quarto extension) into Positron. :( The project configs did not worked here. The task under # very first line of log
quarto preview /home/e-ruiz/path/to/quarto/prokect/src/index.qmd --no-browser --no-watch-inputs
. . .
# this is the end of log
metadata
pagetitle: My project
document-css: false
link-citations: true
date-format: long
lang: en
page-layout: custom
preview:
host: localhost
port: 9999
browse: false
theme: cosmo
Output created: build/index.html
Preparing to preview
Watching files for changes
Browse at http://localhost:3154/
GET: / So I understand that the quarto preview command is ignoring those lines into Than I make a new task into Positron to run ✅ Any way, this workaround solved the problem. I hope this journal can help more people. Thank you @juliasilge your links helps me a lot to understand the real problem. |
Beta Was this translation helpful? Give feedback.
-
In the last post my config was wrong. ❌ It will not work: project:
type: website
output-dir: build
preview:
host: localhost
port: 9999
browser: false
. . . ✅ It works! Double check yml identation: project:
type: website
output-dir: build
preview:
host: localhost
port: 9999
browser: false
. . . After review configs |
Beta Was this translation helpful? Give feedback.
Have you tried specifying preview options for your project, like this:
https://quarto.org/docs/reference/projects/options.html#preview
It seems like some folks may be having problems with this feature: