Skip to content

fix: Windows path encoding in encodeProjectPath - #12

Merged
Michaelliv merged 1 commit into
Michaelliv:mainfrom
eoash:main
Feb 26, 2026
Merged

Michaelliv merged 1 commit into
Michaelliv:mainfrom
eoash:main

Conversation

@eoash

@eoash eoash commented Feb 26, 2026

Copy link
Copy Markdown
Contributor

Summary

  • encodeProjectPath function only handled Unix / separators, causing project directory lookup to fail on Windows
  • Windows paths use \ (backslash) and : (drive letter colon) which were not being converted to -
  • On Windows, C:\Users\foo\project was left unchanged instead of becoming C--Users-foo-project

Root Cause

// Before: only replaced forward slashes
encoded := strings.ReplaceAll(absPath, "/", "-")

// After: handles Windows backslash and colon first
encoded := strings.ReplaceAll(absPath, "\\", "-")
encoded = strings.ReplaceAll(encoded, ":", "-")
encoded = strings.ReplaceAll(encoded, "/", "-")

Test plan

  • Run cq doctor on Windows — Encoded: field should show C--Users-... format
  • Run cq in a project directory — should find existing conversations
  • Verify existing macOS/Linux behavior unchanged (forward slash handling order preserved)

🤖 Generated with Claude Code

Replace backslash and colon characters with dash before forward slash,
enabling correct project directory lookup on Windows (C:\Users\... → C--Users-...).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

@Michaelliv Michaelliv left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean fix, merging. The UserHomeDir change will come separately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants