microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.11k stars 29.27k forks source link

Deletion of directory '...' failed. Should I try again? (y/n) #206009

Open Forge36 opened 8 months ago

Forge36 commented 8 months ago

Does this issue occur when all extensions are disabled?: Yes

Steps to Reproduce:

  1. Configure VS Code as git's editor git config --global core.editor = 'code --wait --reuse-window --disable-extensions'
  2. start an interactive rebase git rebase HEAD~2 -i
  3. Delete all text in the rebase file
  4. Save
  5. Close visual studio

See error: Deletion of directory '...' failed. Should I try again? (y/n)

I'm also using windows terminal with git-bash and this entirely breaks the terminal forcing me to close the tab.

There does appear to be a race condition as leaving visual studio open for a longer period of time does not exhibit the error (i.e. it's inconsistent).

roscoekerby commented 2 months ago

You might have a subdirectory in the directory you are trying to delete.

HughWarrington commented 1 week ago

I get the same symptoms, but I am using Notepad++ as my editor. i.e. I will do a rebase, and at the end I get Deletion of directory '.git/rebase-merge' failed. Should I try again? (y/n). Sometimes it's that git-internal path, other times it can't delete a directory which was removed as part of the rebase. In other words, this might not be a vscode bug. I never saw this error in years of using git, until recently when I also started using Windows Terminal for the first time. Perhaps that's related.

Forge36 commented 1 week ago

I am using Windows Terminal as well.