@@ -597,6 +597,11 @@ func defaultProcessNames(provider, command string) []string {
597597 if provider == "claude" {
598598 return []string {"node" }
599599 }
600+ if provider == "opencode" {
601+ // OpenCode runs as Node.js process, need both for IsAgentRunning detection.
602+ // tmux pane_current_command may show "node" or "opencode" depending on how invoked.
603+ return []string {"opencode" , "node" }
604+ }
600605 if command != "" {
601606 return []string {filepath .Base (command )}
602607 }
@@ -605,7 +610,8 @@ func defaultProcessNames(provider, command string) []string {
605610
606611func defaultReadyPromptPrefix (provider string ) string {
607612 if provider == "claude" {
608- return "> "
613+ // Claude Code uses ❯ (U+276F) as the prompt character
614+ return "❯ "
609615 }
610616 return ""
611617}
@@ -617,6 +623,12 @@ func defaultReadyDelayMs(provider string) int {
617623 if provider == "codex" {
618624 return 3000
619625 }
626+ if provider == "opencode" {
627+ // OpenCode requires delay-based detection because its TUI uses
628+ // box-drawing characters (┃) that break prompt prefix matching.
629+ // 8000ms provides reliable startup detection across models.
630+ return 8000
631+ }
620632 return 0
621633}
622634
@@ -632,9 +644,15 @@ func defaultInstructionsFile(provider string) string {
632644
633645// quoteForShell quotes a string for safe shell usage.
634646func quoteForShell (s string ) string {
635- // Simple quoting: wrap in double quotes, escape internal quotes
647+ // Wrap in double quotes, escaping characters that are special in double-quoted strings:
648+ // - backslash (escape character)
649+ // - double quote (string delimiter)
650+ // - backtick (command substitution)
651+ // - dollar sign (variable expansion)
636652 escaped := strings .ReplaceAll (s , `\` , `\\` )
637653 escaped = strings .ReplaceAll (escaped , `"` , `\"` )
654+ escaped = strings .ReplaceAll (escaped , "`" , "\\ `" )
655+ escaped = strings .ReplaceAll (escaped , "$" , `\$` )
638656 return `"` + escaped + `"`
639657}
640658
0 commit comments