Skip to content

VSCode Extension: Preview opens wrong file when started from subdirectory in Cursor IDE #891

@michaelaye

Description

@michaelaye

Bug Description

When opening a .qmd file in a subdirectory and triggering Quarto preview in Cursor IDE, the preview renders a different file from the project root instead of the opened file.

Steps to Reproduce

  1. Have a Quarto project with subdirectories containing .qmd files:
    project/
    ├── template.qmd
    ├── english/
    │   └── template.qmd
    └── german/
        └── template.qmd
    
  2. Open english/template.qmd in Cursor IDE
  3. Trigger Quarto preview (Cmd+Shift+K or preview button)
  4. Observe that project/template.qmd is previewed instead of english/template.qmd

Expected Behavior

Preview should render the currently opened file (english/template.qmd)

Actual Behavior

Preview renders the root template.qmd file instead, ignoring which file is actually open in the editor

Environment

  • Cursor IDE version: 2.3.41 (fork of VS Code)
  • Quarto extension version: 1.128.0
  • Quarto CLI version: 1.8.26
  • OS: macOS 26.2 (Sequoia)

Workaround

Running quarto preview template.qmd from command line in the subdirectory works correctly, so this appears to be an IDE extension issue rather than a Quarto CLI bug.

Additional Context

  • The issue occurs consistently regardless of which subdirectory file is opened
  • The preview always defaults to the root template.qmd file
  • This makes it impossible to preview subdirectory-specific templates from within Cursor IDE
  • Cursor IDE is based on VS Code, so this may affect VS Code as well

Related Issues

Example Repository

Can be reproduced with: https://github.com/michaelaye/fub-letter

Metadata

Metadata

Assignees

No one assigned

    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