File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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} ) ;
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ const Osc52MaxRawLength = 128 * 1024; // includes selector + base64 + whitespace
2525// See aiprompts/wave-osc-16162.md for full documentation
2626export type ShellIntegrationStatus = "ready" | "running-command" ;
2727
28- const ClaudeCodeRegex = / (?: ^ | \/ ) c l a u d e \b / ;
28+ const ClaudeCodeRegex = / ^ c l a u d e \b / ;
2929
3030type Osc16162Command =
3131 | { command : "A" ; data : Record < string , never > }
You can’t perform that action at this time.
0 commit comments