From 44e3c382489dad87c6474e8fdff75fa92818b73c Mon Sep 17 00:00:00 2001 From: warren Date: Mon, 6 Apr 2026 17:35:45 -0400 Subject: [PATCH] fix: doctor gives copy-pasteable statusLine fix with actual discovered path When the status-line helper is found but Claude settings are misconfigured, the fix suggestion now shows the real path (e.g. /c/Users/Warren/...) instead of a placeholder. Always suggests the .sh variant even if only .ps1 was found, since Claude Code runs statusLine through bash. Co-Authored-By: Claude Opus 4.6 (1M context) --- cmd/doctor.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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")