From c4776753f1ec0aafbdc34d1524a8548e50307523 Mon Sep 17 00:00:00 2001 From: omuretsu <84951833+Snarling@users.noreply.github.com> Date: Mon, 24 Apr 2023 13:05:50 -0400 Subject: [PATCH] Fix quoted section detection --- src/Terminal/Parser.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Terminal/Parser.ts b/src/Terminal/Parser.ts index d900674f2..f069cf96d 100644 --- a/src/Terminal/Parser.ts +++ b/src/Terminal/Parser.ts @@ -22,7 +22,7 @@ export function splitCommands(commandString: string): string[] { /** Split commands string while also applying aliases */ export function parseCommands(commands: string): string[] { // Remove any unquoted whitespace longer than length 1 - commands = commands.replace(/(?:"[^"]+"|'[^']+'|\s{2,})+?/g, (match) => (match.startsWith(" ") ? " " : match)); + commands = commands.replace(/(?:"[^"]*"|'[^']*'|\s{2,})+?/g, (match) => (match.startsWith(" ") ? " " : match)); // Split the commands, apply aliases once, then split again and filter out empty strings. const commandsArr = splitCommands(commands).map(substituteAliases).flatMap(splitCommands).filter(Boolean); return commandsArr;