Skip to content

Commit c78ec3f

Browse files
committed
Fix recognising commands incorrectly
1 parent 67a9206 commit c78ec3f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

assets/ts/terminal/helpers.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,12 @@ export function getCommandFromInput(input: string): {
4949
} {
5050
if (input === "") return { command: undefined, args: [] };
5151

52-
const command: Command | undefined = Terminal.commands.find((command: Command) =>
53-
input.startsWith(command.name),
52+
const splitInput = input.split(" ");
53+
54+
const command: Command | undefined = Terminal.commands.find(
55+
(command: Command) => splitInput[0].toLowerCase() === command.name.toLowerCase(),
5456
);
55-
const args = input.split(" ").slice(1) || [];
57+
const args = splitInput.slice(1) || [];
5658

5759
return { command, args };
5860
}

0 commit comments

Comments
 (0)