From bbd10d6e62c535dbb0efa6347b96967943b61a44 Mon Sep 17 00:00:00 2001 From: warren Date: Mon, 6 Apr 2026 17:18:21 -0400 Subject: [PATCH] fix: doctor searches %LOCALAPPDATA%\ctask\bin first for status-line helper Adds the canonical install location as the primary search path on Windows, before falling back to GOPATH/bin. Updates the Claude config guidance message to reference the new path. Co-Authored-By: Claude Opus 4.6 (1M context) --- cmd/doctor.go | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/cmd/doctor.go b/cmd/doctor.go index 4b52f3a..63fd0fb 100644 --- a/cmd/doctor.go +++ b/cmd/doctor.go @@ -61,12 +61,11 @@ func runDoctor(cmd *cobra.Command, args []string) error { } // Check 3: Status line helper exists - // The canonical location is next to the ctask binary in GOPATH/bin, - // or on Unix in ~/.local/bin. We check both the bash and powershell variants. + // Canonical location: %LOCALAPPDATA%\ctask\bin on Windows, ~/.local/bin on Unix. + // Also checks GOPATH/bin as a fallback for older installs. statusLineFound := false statusLinePath := "" - // Determine expected locations based on platform var searchPaths []string home, _ := os.UserHomeDir() gopath := os.Getenv("GOPATH") @@ -76,10 +75,14 @@ func runDoctor(cmd *cobra.Command, args []string) error { gopathBin := filepath.Join(gopath, "bin") if runtime.GOOS == "windows" { - searchPaths = []string{ - filepath.Join(gopathBin, "ctask-statusline.sh"), - filepath.Join(gopathBin, "ctask-statusline.ps1"), + localAppData := os.Getenv("LOCALAPPDATA") + if localAppData != "" { + ctaskBin := filepath.Join(localAppData, "ctask", "bin") + searchPaths = append(searchPaths, filepath.Join(ctaskBin, "ctask-statusline.sh")) + searchPaths = append(searchPaths, filepath.Join(ctaskBin, "ctask-statusline.ps1")) } + searchPaths = append(searchPaths, filepath.Join(gopathBin, "ctask-statusline.sh")) + searchPaths = append(searchPaths, filepath.Join(gopathBin, "ctask-statusline.ps1")) } else { searchPaths = []string{ filepath.Join(home, ".local", "bin", "ctask-statusline.sh"), @@ -130,7 +133,7 @@ func runDoctor(cmd *cobra.Command, args []string) error { fmt.Printf(" [FAIL] Claude Code status line not configured or misconfigured\n") fmt.Printf(" Fix: add to %s:\n", claudeSettingsPath) if runtime.GOOS == "windows" { - fmt.Printf(" \"statusLine\": {\"type\": \"command\", \"command\": \"bash /c/Users//go/bin/ctask-statusline.sh\"}\n") + 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") }