Skip to content

quarto_preview_stop fails to stop preview server #304

Closed

Description

@jabenninghoff

Running quarto_preview_stop() fails to stop the running Quarto preview server, at least on macOS with RStudio.

Steps to Reproduce

  1. In RStudio, create a new Quarto Website project
  2. Run quarto::quarto_preview()
  3. 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

Activity

  1. self-assigned this
    on Sep 10, 2026
  2. cderv commented on Sep 10, 2026

    @cderv
    Member

    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.

  3. cderv commented on Sep 10, 2026

    @cderv
    Member

    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.

  4. jabenninghoff commented on Sep 10, 2026

    @jabenninghoff
    Author

    Thanks! I tested the dev version and quarto_preview_stop() is now working!

  5. cderv commented on Sep 11, 2026

    @cderv
    Member

    Cool. Thank you for the report. I would'nt have found that without you report. Really appreciat it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions