@devries-cameron20 / t3code Mirror · read-only / commits / b91ea5443c
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 08:30 UTC

fix(shared): keep Unicode whitespace in launch argument values (#38193)

Co-authored-by: Simone <185146821+Lucenx9@users.noreply.github.com> Co-authored-by: Julius Marminge <julius0216@outlook.com>

Simone committed Nov 17, 2026 at 17:16 UTC b91ea5443c2a597899432c99be3d9b4a48058e09
2 files changed +10 -1
packages/shared/src/cliArgs.test.ts
+9
@@ -35,6 +35,15 @@ describe("tokenizeCliArgs", () => {
35 "--verbose",
36 ]);
37 }
38 +
39 + for (const whitespace of ["\u00a0", "\u2003", "\u2028", "\u2029"]) {
40 + const path = `/tmp/project${whitespace}name`;
41 + expect(tokenizeCliArgs(`--add-dir ${path} --verbose`)).toEqual([
42 + "--add-dir",
43 + path,
44 + "--verbose",
45 + ]);
46 + }
47 });
48
49 it("ignores unescaped surrounding whitespace", () => {
packages/shared/src/cliArgs.ts
+1 -1
@@ -43,7 +43,7 @@ export function tokenizeCliArgs(args?: string): ReadonlyArray<string> {
43 if (char === "'" || char === '"') {
44 quote = char;
45 quoted = true;
46 - } else if (/\s/.test(char)) {
46 + } else if (/[ \t\n\r\f\v]/.test(char)) {
47 if (current || quoted) {
48 tokens.push(current);
49 current = "";