Skip to content

Commit 0a88565

Browse files
committed
just do prefix match for claude, and update tests
1 parent a909188 commit 0a88565

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

frontend/app/view/term/osc-handlers.test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,18 @@ describe("isClaudeCodeCommand", () => {
66
it("matches direct Claude Code invocations", () => {
77
expect(isClaudeCodeCommand("claude")).toBe(true);
88
expect(isClaudeCodeCommand("claude --dangerously-skip-permissions")).toBe(true);
9-
expect(isClaudeCodeCommand("/usr/local/bin/claude chat")).toBe(true);
109
});
1110

1211
it("matches Claude Code invocations wrapped with env assignments", () => {
1312
expect(isClaudeCodeCommand('ANTHROPIC_API_KEY="test" claude')).toBe(true);
14-
expect(isClaudeCodeCommand("FOO=bar env claude --print")).toBe(true);
13+
expect(isClaudeCodeCommand("env FOO=bar claude --print")).toBe(true);
1514
});
1615

1716
it("ignores other commands", () => {
1817
expect(isClaudeCodeCommand("claudes")).toBe(false);
1918
expect(isClaudeCodeCommand("echo claude")).toBe(false);
19+
expect(isClaudeCodeCommand("ls ~/claude")).toBe(false);
20+
expect(isClaudeCodeCommand("cat /logs/claude")).toBe(false);
2021
expect(isClaudeCodeCommand("")).toBe(false);
2122
});
2223
});

frontend/app/view/term/osc-handlers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const Osc52MaxRawLength = 128 * 1024; // includes selector + base64 + whitespace
2525
// See aiprompts/wave-osc-16162.md for full documentation
2626
export type ShellIntegrationStatus = "ready" | "running-command";
2727

28-
const ClaudeCodeRegex = /(?:^|\/)claude\b/;
28+
const ClaudeCodeRegex = /^claude\b/;
2929

3030
type Osc16162Command =
3131
| { command: "A"; data: Record<string, never> }

0 commit comments

Comments
 (0)