Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

VS Code extension: `quarto preview` fails when the file path contains parentheses (path not shell-quoted)

オープン 初心者向け
#1,194 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@Bondrewd-K がすでに取り組んでいます。

2026年10月14日 から。

  • #1197 @Bondrewd-K による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
78/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
powershell, typescript, vscode
領域
devtools

調査の方向性

apps/vscode/src/core/terminal.ts から始めます。ここで terminalCommand() が対象を shQuote() でラップしています。次に shQuote() を packages/core/src/strings.ts で読みます。この関数は値に空白が含まれる場合にのみダブルクォートで囲みます。括弧を含み空白を含まないパスを渡して再現し、生成されるコマンド文字列を確認してください。完了条件は、そのようなパスがクォートされること、空白やその他のメタ文字を含むパスも引き続き動作すること、そして括弧のケースを単体テストで検証することです。

索引モデルが issue の本文から書いたものです。

説明

bug vscode

Bug
Previewing a file whose path contains parentheses but no spaces
(e.g. C:\...\Article(md)\doc.qmd) makes the extension emit:

quarto preview C:/.../Article(md)/doc.qmd --no-browser --no-watch-inputs

PowerShell parses (md) as a subexpression — md is the mkdir alias — so
the terminal stalls at:

cmdlet mkdir at command pipeline position 1
Supply values for the following parameters:
Path[0]:

Repro

  1. Windows, integrated terminal = PowerShell.
  2. Open a doc under a parens-containing, space-free directory.
  3. Quarto: Preview → hangs at the Path[0]: prompt, preview never starts.

Expected
Quote the path:

quarto preview "C:/.../Article(md)/doc.qmd" --no-browser --no-watch-inputs

Root cause

  • preview.ts builds the command via terminalCommand("preview", ctx, target);
    sendTerminalCommand() joins it with spaces straight into the terminal.
  • terminalCommand() (apps/vscode/src/core/terminal.ts) wraps the target in
    shQuote().
  • shQuote() (packages/core/src/strings.ts) only double-quotes on whitespace
    (/\s/). Parentheses — and other metacharacters like &, ;, $ —
    without whitespace pass through unquoted. Broken in PowerShell; equally
    broken in bash, where bare parens are a syntax error.

Suggested fix
Quote when the value contains any shell metacharacter, or simply always
double-quote the path.

Workaround
Set the workspace default terminal to Command Prompt, or invoke quarto
manually with a quoted path.

主要言語
TypeScript
スター
652
フォーク
64
平均マージ
8時間 45分
マージ済み PR(30日)
36

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

quarto-dev/quarto のほかの issue

quarto-dev/quarto の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。