zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
47.09k stars 2.71k forks source link

Windows client renames files with backslashes during remote development #16522

Open claire-west opened 4 weeks ago

claire-west commented 4 weeks ago

Check for existing issues

Describe the bug / provide steps to reproduce it

While connecting to a headless Zed instance remotely from Windows, occasionally when expanding a directory for the first time, or when I drag a file in the project panel (is there a way to disable this?), the file(s) will be renamed, replacing all forward slashes (/) in the path with double-backslashes (\).

For example, one time after connecting to the remote project and expanding the docker folder, it immediately renamed the file in that directory like this:

git status
On branch master
Your branch is up to date with 'origin/master'.

Changes not staged for commit:
  (use "git add/rm <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        deleted:    docker/Dockerfile

Untracked files:
  (use "git add <file>..." to include in what will be committed)
        "docker\\Dockerfile"

The same thing happens if I drag-and-drop a file in the project panel. This happens by accident on Windows every once in a while because sometimes clicking a file starts a drag action even though the mouse has been released. Normally not a big issue, but if I'm clicking to open multiple files it's easy to unintentionally rearrange the files in the project, which causes them to be renamed.

This is relatively simple to resolve manually, but it is somewhat tedious:

  1. Rename the files via command line
  2. Close Zed on Windows (it does not detect the changed files automatically, and there doesn't seem to be any way to manually re-sync with the server)
  3. Open Zed on Windows
  4. Remove the remote project from the list and re-add it (simply reconnecting is not sufficient, the renamed files will be unopenable)

Unfortunately, this means that it is currently not possible to reorganize project files, create files, or rename things when using remote development on Windows without taking these actions on the server and fully restarting the Windows Zed client.


I understand that remote development is not yet supported on Windows, but I've been using it because my files are all in the WSL file system, and launching Zed from WSL doesn't utilize my GPU (there seem to be multiple other issues about GPU selection). My mostly-working alternative is to run headless Zed in WSL and connect to it from a foreground instance on the Windows side.

Currently, my choices of setup for my Windows machine, while having the files in the WSL file system, include:

  1. WSL with no GPU (stutter and startup dialog, but probably still the best option for now)
  2. Remote development (occasionally having to correct the filesystem and restart Zed)
  3. Loading the network directory as the project (\\wsl.localhost\Ubuntu\git\whatever, slow, does not detect Git status).

Environment

Windows (foreground client)

Zed: v0.147.0 (Zed Preview) edit: I have also compiled the latest 0.149.3 Preview with the same results OS: Windows 10.0.22631 Memory: 63.7 GiB Architecture: x86_64 GPU: Intel(R) Iris(R) Xe Graphics || Intel Corporation || Intel driver

WSL (Ubuntu, headless server, started in foreground to copy the system info)

Zed: v0.149.0 (Zed Preview) edit: I have also updated to latest 0.149.3 Preview with the same results OS: Linux X11 ubuntu 22.04 Memory: 31.2 GiB Architecture: x86_64 GPU: llvmpipe (LLVM 15.0.7, 256 bits) || llvmpipe || Mesa 24.1.5 - kisak-mesa PPA (LLVM 15.0.7)

If applicable, add mockups / screenshots to help explain present your vision of the feature

No response

If applicable, attach your Zed.log file to this issue.

Zed.log

Caused by:
    Invalid gzip header
[2024-08-20T09:45:19-04:00 ERROR extension] failed to load monokai extension.toml

Caused by:
    No such file or directory (os error 2)
[2024-08-20T09:45:42-04:00 ERROR extension] failed to iterate over archive

Caused by:
    Invalid gzip header
[2024-08-20T09:45:43-04:00 ERROR extension] failed to load monokai extension.toml

Caused by:
    No such file or directory (os error 2)
[2024-08-20T09:48:13-04:00 ERROR extension] failed to iterate over archive

Caused by:
    Invalid gzip header
[2024-08-20T09:48:13-04:00 ERROR extension] failed to load monokai extension.toml

Caused by:
    No such file or directory (os error 2)
[2024-08-20T09:48:19-04:00 ERROR worktree] ignoring event "/git/------/docker/Dockerfile" outside of root path "/home/claire/git/------"
[2024-08-20T09:48:19-04:00 ERROR worktree] ignoring event "/git/------/docker/cfg\\Dockerfile" outside of root path "/home/claire/git/------"
[2024-08-20T09:48:21-04:00 ERROR worktree] ignoring event "/git/------/docker/cfg\\Dockerfile" outside of root path "/home/claire/git/------"
[2024-08-20T09:48:21-04:00 ERROR worktree] ignoring event "/git/------/docker\\Dockerfile" outside of root path "/home/claire/git/------"
[2024-08-20T09:49:44-04:00 ERROR extension] failed to iterate over archive

Caused by:
    Invalid gzip header
[2024-08-20T09:49:45-04:00 ERROR extension] failed to load monokai extension.toml

Caused by:
    No such file or directory (os error 2)
supersketchy commented 1 week ago

Can confirm on Ubuntu and Arch remote on Windows 11.