mirror of https://github.com/microsoft/vscode.git
Improve regex pattern to handle whitespace in environment variable parsing
Co-authored-by: Tyriar <2193314+Tyriar@users.noreply.github.com>
This commit is contained in:
parent
34e7cb0c16
commit
77955c95a7
|
@ -112,7 +112,8 @@ export class CommandLineAutoApprover extends Disposable {
|
|||
|
||||
// For bash/sh/bourne shell and unknown shells (fallback to bourne shell syntax)
|
||||
// Handle environment variable assignments like: VAR=value VAR2=value command
|
||||
const envVarPattern = /^([A-Za-z_][A-Za-z0-9_]*=(?:[^\s'"]|'[^']*'|"[^"]*")*\s+)+/;
|
||||
// This regex matches one or more environment variable assignments at the start
|
||||
const envVarPattern = /^(\s*[A-Za-z_][A-Za-z0-9_]*=(?:[^\s'"]|'[^']*'|"[^"]*")*\s+)+/;
|
||||
const match = trimmedCommand.match(envVarPattern);
|
||||
|
||||
if (match) {
|
||||
|
|
Loading…
Reference in New Issue