From 3abf0dca2d3d5ff82cd6f568e0b6b1a369f8432c Mon Sep 17 00:00:00 2001 From: Alex Meddin Date: Sat, 11 Mar 2023 13:47:15 -0800 Subject: [PATCH] fix: capture subshells as single token --- src/actions.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/actions.js b/src/actions.js index c0845df..3bd90d8 100644 --- a/src/actions.js +++ b/src/actions.js @@ -92,7 +92,8 @@ export async function command(prompt) { } function getCommandList(command) { - const regex = /"[^"]+"|\S+/g; + // Capture tokens + const regex = /\$\([^)]+\)|"[^"]+"|\S+/g; const cmds = command.match(regex); // Enumerate env vars