From 6ccaa90c28c490b26d868d14b92a54372cc6b631 Mon Sep 17 00:00:00 2001 From: Alexander Courtis Date: Sun, 31 Mar 2024 15:23:11 +1100 Subject: [PATCH 1/3] fix(#2733): escape trash path --- lua/nvim-tree/actions/fs/trash.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/nvim-tree/actions/fs/trash.lua b/lua/nvim-tree/actions/fs/trash.lua index 3ea660ac403..8ed612f6443 100644 --- a/lua/nvim-tree/actions/fs/trash.lua +++ b/lua/nvim-tree/actions/fs/trash.lua @@ -42,7 +42,7 @@ function M.remove(node) -- trashes a path (file or folder) local function trash_path(on_exit) local need_sync_wait = utils.is_windows - local job = vim.fn.jobstart(M.config.trash.cmd .. ' "' .. node.absolute_path .. '"', { + local job = vim.fn.jobstart(M.config.trash.cmd .. ' ' .. vim.fn.fnameescape(node.absolute_path), { detach = not need_sync_wait, on_exit = on_exit, on_stderr = on_stderr, From 8db560e09c4e8f7346c76f851bed9d951484e8c0 Mon Sep 17 00:00:00 2001 From: Alexander Courtis Date: Sun, 31 Mar 2024 15:25:31 +1100 Subject: [PATCH 2/3] fix(#2733): escape trash path --- lua/nvim-tree/actions/fs/trash.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/nvim-tree/actions/fs/trash.lua b/lua/nvim-tree/actions/fs/trash.lua index 8ed612f6443..301b64225ed 100644 --- a/lua/nvim-tree/actions/fs/trash.lua +++ b/lua/nvim-tree/actions/fs/trash.lua @@ -42,7 +42,7 @@ function M.remove(node) -- trashes a path (file or folder) local function trash_path(on_exit) local need_sync_wait = utils.is_windows - local job = vim.fn.jobstart(M.config.trash.cmd .. ' ' .. vim.fn.fnameescape(node.absolute_path), { + local job = vim.fn.jobstart(M.config.trash.cmd .. " " .. vim.fn.fnameescape(node.absolute_path), { detach = not need_sync_wait, on_exit = on_exit, on_stderr = on_stderr, From 7dcbaf3a22ad569a234ef29f5dd19a7564961fd9 Mon Sep 17 00:00:00 2001 From: Alexander Courtis Date: Tue, 2 Apr 2024 11:28:42 +1100 Subject: [PATCH 3/3] fix(#2733): escape trash path --- lua/nvim-tree/actions/fs/trash.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/nvim-tree/actions/fs/trash.lua b/lua/nvim-tree/actions/fs/trash.lua index 301b64225ed..8188d867172 100644 --- a/lua/nvim-tree/actions/fs/trash.lua +++ b/lua/nvim-tree/actions/fs/trash.lua @@ -42,7 +42,7 @@ function M.remove(node) -- trashes a path (file or folder) local function trash_path(on_exit) local need_sync_wait = utils.is_windows - local job = vim.fn.jobstart(M.config.trash.cmd .. " " .. vim.fn.fnameescape(node.absolute_path), { + local job = vim.fn.jobstart(M.config.trash.cmd .. " " .. vim.fn.shellescape(node.absolute_path), { detach = not need_sync_wait, on_exit = on_exit, on_stderr = on_stderr,