Unsaved editor comes back after "Don't Save" when switching between Windows and macOS browsers
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 新手友好度
- 68/100
- Issue 類型
- 缺陷
- 描述清晰度
- 基本清楚
- 活躍度
- 活躍
- 技術堆疊
- typescript
- 領域
- devtools
研究方向
Start in src/vs/workbench/services/workingCopy/common/workingCopyBackupService.ts, especially hashPath and the backup deletion flow. Reproduce the Windows-to-macOS browser sequence and compare fsPath with resource.path for the untitled editor. Done means choosing "Don't Save" removes the existing backup and the editor does not return after reload or restart.
由索引模型根據 Issue 內容生成。
描述
Is there an existing issue for this?
- I have searched the existing issues
OS/Web Information
- Web Browser: Chrome (Windows user agent), Edge 153 (macOS user agent)
- Local OS: Windows, macOS
- Remote OS: Ubuntu 24.04
- Remote Architecture: amd64
code-server --version: 4.117.0 ddeb0a3de0321412c0633dffa85d35770005ae0f with Code 1.117.0
Steps to Reproduce
- From a Windows browser, run this in the terminal (the file doesn't exist):
/app/code-server/lib/vscode/bin/remote-cli/code-server --reuse-window /home/user/project/notes.txt. An untitled editor opens, and a backup is written toUser/Backups/<workspace>/untitled/-dd15b27. - Close the browser tab.
- Open code-server from a macOS browser. The editor is restored.
- Close it and pick "Don't Save".
- Reload. It's back, and
untitled/-dd15b27is still there.
Expected
The editor stays closed and the backup is deleted.
Actual
macOS tries to delete untitled/142ac6d3, which doesn't exist. The Windows backup stays, so the editor reopens on every load, even after restarting code-server. Closing it from Windows works.
Logs
None.
Screenshot/Video
No response
Does this bug reproduce in native VS Code?
This cannot be tested in native VS Code
Does this bug reproduce in VS Code web?
I did not test VS Code web
Does this bug reproduce in GitHub Codespaces?
I did not test GitHub Codespaces
Are you accessing code-server over a secure context?
- I am using a secure context.
Notes
The backup file name is a hash of fsPath (hashPath in src/vs/workbench/services/workingCopy/common/workingCopyBackupService.ts). In the browser, fsPath uses backslashes on Windows and forward slashes everywhere else, so the same file gets a different backup name depending on the client:
\home\user\project\notes.txthashes to-dd15b27/home/user/project/notes.txthashes to142ac6d3
Hashing resource.path for untitled files would fix it, though backups already written with backslash names would still need cleaning up. It's still like this on VS Code main, and none of the patches in 4.139.1 touch it.
- 主要語言
- TypeScript
- 星號
- 79.5k
- 分支
- 6.9k
- 平均合併
- 2 天 13 小時
- 30 天內合併 PR
- 41
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
coder/code-server 的其他 Issue
-
enhancement
難度 5/5 一週以上 新手友好度 35/100
coder/code-server#7976 · 2 則留言 ·
維護者通常 1 天內回覆
-
enhancement
難度 5/5 一週以上 新手友好度 35/100
coder/code-server#7962 · 3 則留言 ·
維護者通常 1 天內回覆
-
bug needs-investigation
難度 4/5 3-5 天 新手友好度 55/100
coder/code-server#7955 · 1 則留言 ·
維護者通常 1 天內回覆
-
enhancement
難度 5/5 一週以上 新手友好度 42/100
coder/code-server#7948 · 1 則留言 · 2 個 reaction ·
維護者通常 1 天內回覆
-
bug code-server needs-investigation
難度 4/5 3-5 天 新手友好度 48/100
coder/code-server#7938 · 3 則留言 · 2 個 reaction ·
維護者通常 1 天內回覆
查看 coder/code-server 的全部 Issue
相似的 Issue
-
難度 1/5 1 小時以內 新手友好度 78/100
lichess-org/api#678 ·
-
難度 2/5 1-3 小時 新手友好度 84/100
PostHog/posthog.com#20628 ·
維護者通常 1 天內回覆
-
bug status:Needs Triage
難度 1/5 1 小時以內 新手友好度 92/100
jupyterlab/jupyterlab#19964 ·
維護者通常 1 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 78/100
agentscope-ai/QwenPaw#8064 · 1 則留言 ·
維護者通常 1 天內回覆
-
area: notebooks-jupyter bug theme: new notebook frontend
難度 2/5 1-3 小時 新手友好度 88/100
posit-dev/positron#16347 · 1 則留言 ·
維護者通常 1 天內回覆