Is there an existing issue for this?
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 ddeb0a3 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 to User/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/-dd15b27 is 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
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?
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.txt hashes to -dd15b27
/home/user/project/notes.txt hashes to 142ac6d3
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.
Is there an existing issue for this?
OS/Web Information
code-server --version: 4.117.0 ddeb0a3 with Code 1.117.0Steps to Reproduce
/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.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
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?
Notes
The backup file name is a hash of
fsPath(hashPathinsrc/vs/workbench/services/workingCopy/common/workingCopyBackupService.ts). In the browser,fsPathuses 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 to142ac6d3Hashing
resource.pathfor 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.