diff options
| author | Adam <[email protected]> | 2026-01-22 10:37:13 -0600 |
|---|---|---|
| committer | Adam <[email protected]> | 2026-01-22 10:37:13 -0600 |
| commit | a96f3d153b192a29bb199c5c5073860db36d8851 (patch) | |
| tree | 070a13717fcae643fd596ded6a3e69e30b2980e8 /packages/app/src | |
| parent | 31f3a508dc3cec8dcc7ea05fbff1f1ed6b316f6d (diff) | |
| download | opencode-a96f3d153b192a29bb199c5c5073860db36d8851.tar.gz opencode-a96f3d153b192a29bb199c5c5073860db36d8851.zip | |
Revert "fix: handle special characters in paths and git snapshot reading logic(#9804) (#9807)"
This reverts commit cf6ad4c40789beef8a0f2a07f12964fd5fdd2b09.
Diffstat (limited to 'packages/app/src')
| -rw-r--r-- | packages/app/src/context/file.tsx | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/packages/app/src/context/file.tsx b/packages/app/src/context/file.tsx index d7630509a..5ea499387 100644 --- a/packages/app/src/context/file.tsx +++ b/packages/app/src/context/file.tsx @@ -195,20 +195,7 @@ export const { use: useFile, provider: FileProvider } = createSimpleContext({ const root = directory() const prefix = root.endsWith("/") ? root : root + "/" - let path = input - - // Only strip protocol and decode if it's a file URI - if (path.startsWith("file://")) { - const raw = stripQueryAndHash(stripFileProtocol(path)) - try { - // Attempt to treat as a standard URI - path = decodeURIComponent(raw) - } catch { - // Fallback for legacy paths that might contain invalid URI sequences (e.g. "100%") - // In this case, we treat the path as raw, but still strip the protocol - path = raw - } - } + let path = stripQueryAndHash(stripFileProtocol(input)) if (path.startsWith(prefix)) { path = path.slice(prefix.length) @@ -231,8 +218,7 @@ export const { use: useFile, provider: FileProvider } = createSimpleContext({ function tab(input: string) { const path = normalize(input) - const encoded = path.split("/").map(encodeURIComponent).join("/") - return `file://${encoded}` + return `file://${path}` } function pathFromTab(tabValue: string) { |
