You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
chat.tools.terminal.autoApprove does not work for npm exec -- ... commands #325635
The prompt about pwsh is always shown. It worked for the simple "npx eslint": true though. I think it is a parsing issue with npm exec having double dashes. But strangely, matchCommandLine variant did not work either.
VS Code still displays the "Run pwsh command?" confirmation.
Terminal output:
RunInTerminalTool#CommandLineAutoApproveAnalyzer: Parsed sub-commands via powershell grammar [[]]
RunInTerminalTool#CommandLineAutoApproveAnalyzer: No sub-commands were parsed, auto approval is not allowed [null]
RunInTerminalTool#CommandLineFileWriteAnalyzer: File writes detected [[]]
Because no subcommands are parsed, the configured auto-approval rule is never evaluated.
Expected behavior
The PowerShell parser should recognize npm exec -- tsc ..., allowing it to match the configured prefix rule and run without confirmation.
The same configuration works with equivalent commands starting with npx, such as npx tsc.
Activity
Fix PowerShell parsing for standalone `--` tokens
Fix PowerShell parsing for standalone `--` tokens