Skip to content

fix: Replace all non-alphanumeric characters in encodeProjectPath#307

Merged
benbrandt merged 1 commit intozed-industries:mainfrom
RAIT-09:fix/encode-project-path-replace-all-non-alnum
Feb 16, 2026
Merged

fix: Replace all non-alphanumeric characters in encodeProjectPath#307
benbrandt merged 1 commit intozed-industries:mainfrom
RAIT-09:fix/encode-project-path-replace-all-non-alnum

Conversation

@RAIT-09
Copy link
Contributor

@RAIT-09 RAIT-09 commented Feb 12, 2026

This PR fixes encodeProjectPath to replace all non-alphanumeric characters with -, matching how Claude Code actually encodes project paths.

The previous implementation only replaced path separators (/ on Unix, \ on Windows), so characters like _, non-ASCII characters (e.g. CJK), and other non-alphanumeric characters were left as-is. This caused a mismatch with the paths encoded by Claude Code, resulting in session lookups failing with "Session not found" for directories containing such characters.

The fix also removes the Windows-specific code path, as the simple regex [^a-zA-Z0-9] correctly handles all platforms.

Related to #300

Copy link
Member

@benbrandt benbrandt left a comment

Choose a reason for hiding this comment

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

thanks!

@benbrandt benbrandt merged commit 4d232da into zed-industries:main Feb 16, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants