Undo/revert fails for files with non-ASCII filenames on Windows #7321

Open
opened 2026-02-16 18:06:49 -05:00 by yindo · 1 comment
Owner

Originally created by @yimingll on GitHub (Jan 23, 2026).

Originally assigned to: @rekram1-node on GitHub.

Description

On Windows, the /undo command fails to revert files with non-ASCII characters in their filenames (e.g., Chinese, Japanese, Korean).

Steps to Reproduce

  1. Create a project with a file named with non-ASCII characters (e.g., 公共函数.cpp)
  2. Make changes to the file using opencode
  3. Run /undo

Expected Behavior

The file should be reverted to its previous state.

Actual Behavior

  • Files with ASCII names are reverted correctly
  • Files with non-ASCII names are NOT reverted (fail silently)

Root Cause

Bun's dollar template literal on Windows incorrectly handles variable interpolation, causing git commands to fail for non-ASCII paths.

Environment

  • OS: Windows 11
  • opencode version: 1.1.34

Workaround

Set global git config:

git config --global core.quotepath false

Related

  • PR #9844 provides a fix
Originally created by @yimingll on GitHub (Jan 23, 2026). Originally assigned to: @rekram1-node on GitHub. ## Description On Windows, the `/undo` command fails to revert files with non-ASCII characters in their filenames (e.g., Chinese, Japanese, Korean). ## Steps to Reproduce 1. Create a project with a file named with non-ASCII characters (e.g., `公共函数.cpp`) 2. Make changes to the file using opencode 3. Run `/undo` ## Expected Behavior The file should be reverted to its previous state. ## Actual Behavior - Files with ASCII names are reverted correctly - Files with non-ASCII names are NOT reverted (fail silently) ## Root Cause Bun's dollar template literal on Windows incorrectly handles variable interpolation, causing git commands to fail for non-ASCII paths. ## Environment - OS: Windows 11 - opencode version: 1.1.34 ## Workaround Set global git config: ```bash git config --global core.quotepath false ``` ## Related - PR #9844 provides a fix
yindo added the windows label 2026-02-16 18:06:49 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 23, 2026):

This issue might be a duplicate of existing issues. Please check:

  • #4704: /undo and /timeline undo does not revert file edits (Windows 11 file revert issue)
  • #9804: File paths with special characters (#) or non-ASCII characters fail to load in Diff/Review view (non-ASCII path handling)
  • #8172: OpenCode 桌面版 不支持读取中文名文件 (Chinese/non-ASCII filename support issue)

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Jan 23, 2026): This issue might be a duplicate of existing issues. Please check: - #4704: /undo and /timeline undo does not revert file edits (Windows 11 file revert issue) - #9804: File paths with special characters (#) or non-ASCII characters fail to load in Diff/Review view (non-ASCII path handling) - #8172: OpenCode 桌面版 不支持读取中文名文件 (Chinese/non-ASCII filename support issue) Feel free to ignore if none of these address your specific case.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#7321