Closed
Description
Running quarto_preview_stop() fails to stop the running Quarto preview server, at least on macOS with RStudio.
Steps to Reproduce
- In RStudio, create a new Quarto Website project
- Run
quarto::quarto_preview() - Run
quarto::quarto_preview_stop()
Expected Behavior
The Quarto preview server should be terminated.
Actual Behavior
The quarto preview server continues to run until R is restarted, as edits are reflected in the viewer and by running ps from the command line:
% ps -ax | grep quarto
12253 ?? 0:00.01 bash /Applications/quarto/bin/quarto preview /Users/jabenninghoff/GitHub/quarto-test --port 4942 --no-browse
12263 ?? 0:01.35 /Applications/quarto/bin/tools/aarch64/deno run --unstable-ffi --unstable-kv --no-config --no-lock --cached-only --allow-all --no-check --v8-flags=--enable-experimental-regexp-engine,--max-old-space-size=8192,--max-heap-size=8192,--stack-trace-limit=100 /Applications/quarto/bin/quarto.js preview /Users/jabenninghoff/GitHub/quarto-test --port 4942 --no-browse
12399 ttys000 0:00.00 grep quarto
After restarting R in RStudio:
% ps -ax | grep quarto
12733 ttys000 0:00.00 grep quarto
Reacted by Christophe Dervieux
Metadata
Metadata
Assignees
Labels
No labels
Activity
cderv commentedon Sep 10, 2026
Thanks for the report and the clear reproduction steps! The preview process information was being stored in a copied list, so
quarto_preview_stop()could not find the running process. PR #305 fixes the shared state and adds a regression test confirming that the preview server releases its port after being stopped.cderv commentedon Sep 10, 2026
Hopefully #305 will solve it. You can install dev version from github or 1.5.1.9003 from https://quarto-dev.r-universe.dev/quarto when built.
Please tell me if this is not working for you.
jabenninghoff commentedon Sep 10, 2026
Thanks! I tested the dev version and
quarto_preview_stop()is now working!cderv commentedon Sep 11, 2026
Cool. Thank you for the report. I would'nt have found that without you report. Really appreciat it!