Terminal auto-approve ignored for operators inside a colon-attached quoted arg
- Dominant language
- TypeScript
- Stars
- 193k
- Forks
- 42.4k
- PR merge metrics
- PR metrics pending
Description
Type: Bug
### Environment
- VS Code: 1.138.0
- @github/copilot: 1.0.84-4
- @github/copilot-sdk: 1.0.13
- OS: Windows_NT x64 10.0.26200
- Chat terminal shell: pwsh (PowerShell 7)
### Rule
```
"chat.tools.terminal.autoApprove": {
"/^Write-Output .*$/": { "approve": true, "matchCommandLine": true }
}
```
### Repro (Copilot Chat agent mode)
- `Write-Output /Filter:"a|b"` -> prompts (unexpected)
- `Write-Output "a|b"` -> auto-approves (expected)
### Expected
Both match the `matchCommandLine` approve rule and the pipe is inside quotes, so
both should auto-approve.
### Actual
The command auto-approves only when a shell operator ( `|` `&` `;` `( )` `&&` `||` `{ }` )
is NOT inside a colon-attached quoted value (the `switch:"..."` form). The same
operator in a space-separated quoted argument auto-approves fine, so the quoted
`token:"..."` boundary appears to be mis-parsed and the operator is treated as
real shell syntax, overriding the approve rule.
### Impact
Filter arguments like `/TestCaseFilter:"(FullyQualifiedName~A|...~B)&Category!=C"`
can never be auto-approved.
Contributor guide
Assessment
This issue has not been assessed yet.