Skip to content

Delete folder doesn't work on Windows #264

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

Closed
lopi-py opened this issue Apr 11, 2022 · 4 comments
Closed

Delete folder doesn't work on Windows #264

lopi-py opened this issue Apr 11, 2022 · 4 comments
Labels
bug Something isn't working

Comments

@lopi-py
Copy link
Contributor

lopi-py commented Apr 11, 2022

I get this error

Error executing vim.schedule lua callback: Vim:E475: Invalid value for argument cmd: 'rmdir' is not executable
stack traceback:
        [C]: in function 'system'
        ....nvim/lua/neo-tree/sources/filesystem/lib/fs_actions.lua:250: in function 'callback'
        ...ck\packer\start\neo-tree.nvim/lua/neo-tree/ui/inputs.lua:73: in function 'on_confirm'
        ...e\pack\packer\start\dressing.nvim/lua/dressing/input.lua:79: in function 'fn'
        vim/_editor.lua:380: in function 'cb'
        vim/_editor.lua:256: in function <vim/_editor.lua:256>

if I exit from neovim and try rmdir, it works, it's odd, maybe the env is not properly setted?

@cseickel
Copy link
Contributor

Huh, I did have to just work off of documentation for this one because I don't run neovim on Windows. It could be that it is actually just part of cmd.exe and not it's own executable.

Would you mind trying these variants and letting me know if it works?

at this line:

local result = vim.fn.system({"rmdir", "/s", "/q", path})

try:

        local result = vim.fn.system({"cmd.exe", "rmdir", "/s", "/q", path})

or

        local result = vim.fn.system("rmdir /s /q " .. vim.fn.fnameescape(path))

@lopi-py
Copy link
Contributor Author

lopi-py commented Apr 11, 2022

local result = vim.fn.system({"cmd.exe", "/c", "rmdir", "/s", "/q", path})

works

@cseickel
Copy link
Contributor

cseickel commented Apr 11, 2022

Thanks @lopi-py!

@cseickel
Copy link
Contributor

Updated.

@cseickel cseickel added the bug Something isn't working label Apr 11, 2022
@lopi-py lopi-py closed this as completed Apr 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants