Skip to content

VS Code Preview not working if path contains special characters #1102

Description

@cbrnr

Bug description

If the path to the .qmd contains special character, e.g., ~/temp/name;with@symbols, Quarto Preview does not work because it doesn't escape the characters.

Steps to reproduce

  1. Create a folder with special characters, e.g., mkdir "name;with@symbols".
  2. Open this folder in VS Code (File → Open Folder) and create a .qmd file. The content doesn't matter, here's a minimal document:
---
title: "Untitled"
format: html
---

Test.
  1. Save the .qmd and run "Quarto: Preview"

Actual behavior

I get an error because the special characters are not escaped:

~/temp/name;with@symbols ❯ quarto preview /Users/clemens/temp/name;with@symbols/Untitled-1.qmd --no-browser --no-watch-inputs
ERROR: /Users/clemens/temp/name not found

Expected behavior

The preview should render successfully even if the path contains special characters. The solution is pretty straightforward, just escape special characters, or even easier, enclose the path argument in double quotes.

~/temp/name;with@symbols ❯ quarto preview "/Users/clemens/temp/name;with@symbols/Untitled-1.qmd" --no-browser --no-watch-inputs

Your environment

  • IDE: VSCode
  • OS: macOS Tahoe 26.6.2
  • Quarto version: 1.10.18

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingvscode

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions