You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
File paths with special characters (#) or non-ASCII characters fail to load in Diff/Review view #9804
There are two related issues regarding how file paths are handled in the application, causing issues when files contain special characters (like #) or non-ASCII characters (like Chinese).
Frontend Path Truncation: In packages/app, file paths are processed as URLs. If a filename contains a # (e.g., feature#1.ts), stripQueryAndHash incorrectly interprets the part after # as a URL fragment and removes it. This results in the application looking for a truncated filename (e.g., feature) which does not exist.
Backend Git Path Parsing: In packages/opencode, the git diff and git show commands output filenames with non-ASCII or special characters in a quoted, octal-escaped format (e.g., "\344\270\255\226\207.ts"). The current snapshot logic does not decode these paths, leading to ENOENT errors when trying to retrieve file content or diffs.
Plugins
No response
OpenCode version
v1.1.28
Steps to reproduce
Initialize the project and start the dev server.
Create a file with a # in the name, e.g., styles/main#v2.css.
Create a file with Chinese characters, e.g., docs/说明.md.
Stage or commit these files.
Open the Session Review or Diff View pane.
Click on the files to view the diff.
Expected behavior: The diff should load and display the file content correctly. Actual behavior:
For styles/main#v2.css: The file might fail to open, or show empty content, because the request path is truncated to styles/main.
For docs/说明.md: The diff shows empty "Before" and "After" content because the backend failed to resolve the escaped path "\344\270...".
These issues describe the same root cause: improper handling of special characters and non-ASCII characters in file paths, affecting both the frontend (CSS selector escaping, URL fragment handling) and backend (git path parsing).
Feel free to ignore if these don't address your specific case.
Activity
github-actions commentedon Jan 21, 2026
This issue might be a duplicate of existing issues. Please check:
These issues describe the same root cause: improper handling of special characters and non-ASCII characters in file paths, affecting both the frontend (CSS selector escaping, URL fragment handling) and backend (git path parsing).
Feel free to ignore if these don't address your specific case.
fix: handle special characters in paths and git snapshot reading logic(…
Revert "fix: handle special characters in paths and git snapshot read…
fix: properly encode file URLs with special characters (anomalyco#11790)
fix: properly encode file URLs with special characters (anomalyco#11790)
fix: handle special characters in paths and git snapshot reading logic(…
Revert "fix: handle special characters in paths and git snapshot read…
fix: handle special characters in paths and git snapshot reading logic(…
Revert "fix: handle special characters in paths and git snapshot read…
fix: handle special characters in paths and git snapshot reading logi…
Revert "fix: handle special characters in paths and git snapshot read…