VS Code extension: `quarto preview` fails when the file path contains parentheses (path not shell-quoted)
维护者通常 1 天内回复
评估
- 难度
- 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
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
- Windows, integrated terminal = PowerShell.
- Open a doc under a parens-containing, space-free directory.
- 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.tsbuilds the command viaterminalCommand("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
- 星标
- 655
- 派生
- 64
- 平均合并
- 20 小时 53 分钟
- 30 天内合并 PR
- 46
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
quarto-dev/quarto 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 84/100
quarto-dev/quarto#1139 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 1/5 1-3 小时 新手友好度 90/100
quarto-dev/quarto#1138 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 88/100
quarto-dev/quarto#1137 ·
维护者通常 1 天内回复
-
Add dependabot?可能重新可做 关联的 PR 已关闭且未合并。 未关闭
难度 2/5 1-3 小时 新手友好度 68/100
quarto-dev/quarto#1135 ·
维护者通常 1 天内回复
-
vscode
难度 2/5 1-3 小时 新手友好度 72/100
quarto-dev/quarto#934 · 1 条评论 · 2 个 reaction ·
维护者通常 1 天内回复
查看 quarto-dev/quarto 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
braintrustdata/braintrust-sdk-javascript#2659 ·
维护者通常 1 天内回复
-
body-parser 2.3.0 in the published ai-dial-chat-bff image is vulnerable (CVE-2026-111181, HIGH)可能已有人在做 @illya-havsiyevych 今天认领。 未关闭bug
难度 1/5 1-3 小时 新手友好度 87/100
epam/ai-dial-chat#9566 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 83/100
维护者通常 1 天内回复
-
はさみアイコンを修正する未关闭bug
难度 1/5 1 小时以内 新手友好度 68/100
-
area: core
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复