Skip to content

Renaming a file to the same name with different casing on a WSL #3117

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ktnlvr opened this issue Apr 27, 2025 · 1 comment
Open

Renaming a file to the same name with different casing on a WSL #3117

ktnlvr opened this issue Apr 27, 2025 · 1 comment
Labels
bug Something isn't working OS Windows WSL specific to windows WSL OS Windows specific to windows PR please nvim-tree team does not have the bandwidth to implement; a PR will be gratefully appreciated

Comments

@ktnlvr
Copy link

ktnlvr commented Apr 27, 2025

Description

When renaming a file that is on windows into its version with a different casing the NvimTree raises an error and refuses the rename. For instance, renaming A.txt -> a.txt is impossible, unless done via another unoccupied name A.txt -> tmp.txt -> a.txt.

Neovim version

NVIM v0.10.2
Build type: Release
LuaJIT 2.1.1713484068

Operating system and version

Debian 12, Linux 5.15.167.4-microsoft-standard-WSL2

Windows variant

WSL

nvim-tree version

5bea2b3

Clean room replication

No additional configuration required.

Steps to reproduce

  1. Open WSL.
  2. Go to a directory that belongs to windows (usually /mnt/c/Users/<USERNAME>).
  3. Ensure that you have read/write permissions for the directory
  4. Create a file with an all-capital name (e.g. A.txt)
  5. Open it in neovim using nvim -nu /tmp/nvt-min.lua.
  6. Open the sidebar using :NvimTreeOpen.
  7. Locate and navigate to the created file (e.g. A.txt).
  8. Press r and rename it to the lowercase version of its name (e.g. A.txt -> a.txt).
  9. Observe [NvimTree] Cannot rename /mnt/c/Users/<USERNAME>/A.txt -> /mnt/c/Users/<USERNAME>/a.txt: file already exists.

Expected behavior

Step 9 should leave the file renamed and output like [NvimTree] /mnt/c/Users/<USERNAME>/A.txt -> /mnt/c/Users/<USERNAME>/a.txt.

Actual behavior

Step 9, error, no file renamed.

@ktnlvr ktnlvr added the bug Something isn't working label Apr 27, 2025
@alex-courtis
Copy link
Member

Honestly, I don't think this is achievable with windows mapping a case insensitive with a case sensitive file system.

After many attempts we did finally get this working on macos #2814, with just one file system.

The nvim-tree team doesn't have expertise with or access to windows however you're welcome to contribute a fix.

Please ensure that all new or modified codepaths are behind the appropriate windows feature flag.

@alex-courtis alex-courtis added OS Windows WSL specific to windows WSL PR please nvim-tree team does not have the bandwidth to implement; a PR will be gratefully appreciated OS Windows specific to windows labels Apr 28, 2025
ktnlvr added a commit to ktnlvr/nvim-tree.lua that referenced this issue Apr 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working OS Windows WSL specific to windows WSL OS Windows specific to windows PR please nvim-tree team does not have the bandwidth to implement; a PR will be gratefully appreciated
Projects
None yet
Development

No branches or pull requests

2 participants