diff --git a/cmd/doctor.go b/cmd/doctor.go index 63fd0fb..15cdfbf 100644 --- a/cmd/doctor.go +++ b/cmd/doctor.go @@ -7,6 +7,7 @@ import ( "os/exec" "path/filepath" "runtime" + "strings" "github.com/spf13/cobra" "github.com/warrenronsiek/ctask/internal/config" @@ -132,7 +133,17 @@ func runDoctor(cmd *cobra.Command, args []string) error { if !statusLineConfigured { fmt.Printf(" [FAIL] Claude Code status line not configured or misconfigured\n") fmt.Printf(" Fix: add to %s:\n", claudeSettingsPath) - if runtime.GOOS == "windows" { + if statusLineFound { + // Derive the .sh path from whatever was found (could be .ps1 fallback). + // Claude Code always needs the bash variant. + shPath := strings.TrimSuffix(statusLinePath, filepath.Ext(statusLinePath)) + ".sh" + bashPath := filepath.ToSlash(shPath) + // Convert Windows drive letter for Git Bash: C:\... -> /c/... + if len(bashPath) >= 2 && bashPath[1] == ':' { + bashPath = "/" + strings.ToLower(string(bashPath[0])) + bashPath[2:] + } + fmt.Printf(" \"statusLine\": {\"type\": \"command\", \"command\": \"bash %s\"}\n", bashPath) + } else if runtime.GOOS == "windows" { fmt.Printf(" \"statusLine\": {\"type\": \"command\", \"command\": \"bash /c/Users//AppData/Local/ctask/bin/ctask-statusline.sh\"}\n") } else { fmt.Printf(" \"statusLine\": {\"type\": \"command\", \"command\": \"bash ~/.local/bin/ctask-statusline.sh\"}\n")