Unsaved files on a disconnected connection cannot be saved and prevent successful reconnection

Open
#10,799 2 comments 0 reactions 1 assignee View on GitHub

@aeschli is already working on this.

Since Mar 19, 2025.

Assessment

This issue has not been assessed yet.

Description

bug wsl
  • VSCode Version: 1.98.2
  • Local OS Version: Windows_NT x64 10.0.19045
  • Remote OS Version: Ubuntu 20.04.6 LTS
  • Remote Extension/Connection Type: WSL

Essentially identical to the closed issue here: https://github.com/microsoft/vscode-remote-release/issues/8969, except with WSL rather than SSH.
However, the consequences are much more severe in this case because the file can not even be saved locally (to the Windows file system) as a workaround.

Steps to Reproduce:

  1. Open VS Code on windows and connect to WSL
  2. Open a file stored on the WSL system, make some edits, do not save
  3. Open PowerShell and run wsl --shutdown
  4. Restart WSL with wsl
  5. Observe that you are unable to reconnect to WSL (unless all VS Code windows have been closed)
  6. Observe that you are unable to Save / SaveAs the unsaved file to the windows filesystem (unexpected) or to the WSL filesystem (expected due to the connection issue)

This is especially problematic if you have many unsaved files open, or for files such as IPython Notebooks where you can't simply copy/paste the content elsewhere while you shut down VS Code and reconnect.

Dominant language
Dockerfile
Stars
4.2k
Forks
470
Avg merge
1d 1h
Merged PRs (30d)
1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/vscode-remote-release

All issues in microsoft/vscode-remote-release

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.