weirongxu / coc-explorer

πŸ“ Explorer for coc.nvim
MIT License
1.14k stars 45 forks source link

[BUG] Not deleting the selected file or folder with df #541

Closed aspiiire closed 2 years ago

aspiiire commented 2 years ago

Describe the bug

I am unable to delete any type of file using coc-explorer; While navigating if I press df it gives me the following error "[coc.nvim] Error: spawn Unknown system error -86" ( I have used coc-explorer in many other pc's so I know that's working out of the box)

Result from CocInfo

## versions

vim version: NVIM v0.7.2
node version: v18.8.0
coc.nvim version: 0.0.82-7e5a0298 2022-08-26 14:55:12 +0800
coc.nvim directory: /Users/myname/.config/nvim/plugged/coc.nvim
term: xterm-kitty
platform: darwin

## Log of coc.nvim

2022-08-31T11:28:56.421 INFO (pid:2717) [plugin] - coc.nvim initialized with node: v18.8.0 after 123ms
2022-08-31T11:28:56.790 INFO (pid:2717) [attach] - receive notification: highlight []
2022-08-31T11:29:00.269 INFO (pid:2717) [attach] - receive notification: runCommand [
  'coc-helper.internal.didVimEvent_m1_v0_13_0_coc_helper_1',
  'BufWipeout',
  9
]
2022-08-31T11:29:00.271 INFO (pid:2717) [attach] - receive notification: runCommand [
  'coc-helper.internal.didVimEvent_m1_v0_13_0_explorer_2',
  'BufWipeout',
  9
]
2022-08-31T11:29:00.271 INFO (pid:2717) [attach] - receive notification: runCommand [
  'coc-helper.internal.didVimEvent_m1_v0_13_0_coc_helper_1',
  'BufWipeout',
  10
]
2022-08-31T11:29:00.271 INFO (pid:2717) [attach] - receive notification: runCommand [
  'coc-helper.internal.didVimEvent_m1_v0_13_0_explorer_2',
  'BufWipeout',
  10
]
2022-08-31T11:29:00.272 INFO (pid:2717) [attach] - receive notification: runCommand [
  'coc-helper.internal.didVimEvent_m1_v0_13_0_coc_helper_1',
  'BufWipeout',
  11
]
2022-08-31T11:29:00.273 INFO (pid:2717) [attach] - receive notification: runCommand [
  'coc-helper.internal.didVimEvent_m1_v0_13_0_explorer_2',
  'BufWipeout',
  11
]
2022-08-31T11:29:00.274 INFO (pid:2717) [attach] - receive notification: runCommand [
  'coc-helper.internal.didVimEvent_m1_v0_13_0_coc_helper_1',
  'BufWipeout',
  4
]
2022-08-31T11:29:00.274 INFO (pid:2717) [attach] - receive notification: runCommand [
  'coc-helper.internal.didVimEvent_m1_v0_13_0_explorer_2',
  'BufWipeout',
  4
]
2022-08-31T11:29:00.274 INFO (pid:2717) [attach] - receive notification: runCommand [
  'coc-helper.internal.didVimEvent_m1_v0_13_0_coc_helper_1',
  'BufWipeout',
  3
]
2022-08-31T11:29:00.275 INFO (pid:2717) [attach] - receive notification: runCommand [
  'coc-helper.internal.didVimEvent_m1_v0_13_0_explorer_2',
  'BufWipeout',
  3
]
2022-08-31T11:29:00.275 INFO (pid:2717) [attach] - receive notification: runCommand [
  'coc-helper.internal.didVimEvent_m1_v0_13_0_coc_helper_1',
  'BufWipeout',
  8
]
2022-08-31T11:29:00.275 INFO (pid:2717) [attach] - receive notification: runCommand [
  'coc-helper.internal.didVimEvent_m1_v0_13_0_explorer_2',
  'BufWipeout',
  8
]
2022-08-31T11:29:00.275 INFO (pid:2717) [attach] - receive notification: runCommand [
  'coc-helper.internal.didVimEvent_m1_v0_13_0_coc_helper_1',
  'BufWipeout',
  6
]
2022-08-31T11:29:00.276 INFO (pid:2717) [attach] - receive notification: runCommand [
  'coc-helper.internal.didVimEvent_m1_v0_13_0_explorer_2',
  'BufWipeout',
  6
]
2022-08-31T11:29:00.277 INFO (pid:2717) [attach] - receive notification: runCommand [
  'coc-helper.internal.didVimEvent_m1_v0_13_0_coc_helper_1',
  'BufWipeout',
  7
]
2022-08-31T11:29:00.277 INFO (pid:2717) [attach] - receive notification: runCommand [
  'coc-helper.internal.didVimEvent_m1_v0_13_0_explorer_2',
  'BufWipeout',
  7
]
2022-08-31T11:29:00.279 INFO (pid:2717) [attach] - receive notification: runCommand [
  'coc-helper.internal.didVimEvent_m1_v0_13_0_coc_helper_1',
  'BufDelete',
  2
]
2022-08-31T11:29:00.279 INFO (pid:2717) [attach] - receive notification: runCommand [
  'coc-helper.internal.didVimEvent_m1_v0_13_0_explorer_2',
  'BufDelete',
  2
]
2022-08-31T11:29:00.280 INFO (pid:2717) [attach] - receive notification: runCommand [
  'coc-helper.internal.didVimEvent_m1_v0_13_0_coc_helper_1',
  'BufWipeout',
  2
]
2022-08-31T11:29:00.280 INFO (pid:2717) [attach] - receive notification: runCommand [
  'coc-helper.internal.didVimEvent_m1_v0_13_0_explorer_2',
  'BufWipeout',
  2
]
2022-08-31T11:29:00.328 INFO (pid:2717) [services] - registered service "eslint"
2022-08-31T11:29:00.329 INFO (pid:2717) [services] - ESLint state change: stopped => starting
2022-08-31T11:29:00.345 INFO (pid:2717) [services] - registered service "tsserver"
2022-08-31T11:29:00.393 INFO (pid:2717) [services] - service tsserver started
2022-08-31T11:29:00.411 INFO (pid:2717) [core-watchman] - watchman watching project: /Users/myname/Projects/mywebsite
2022-08-31T11:29:00.443 INFO (pid:2717) [services] - ESLint state change: starting => running
2022-08-31T11:29:00.446 INFO (pid:2717) [services] - service eslint started
2022-08-31T11:29:09.767 INFO (pid:2717) [attach] - Request action: diagnosticList []
2022-08-31T11:29:09.768 INFO (pid:2717) [attach] - receive notification: runCommand [
  'coc-helper.internal.didVimEvent_m1_v0_13_0_explorer_2',
  'CocDiagnosticChange'
]
2022-08-31T11:29:10.076 INFO (pid:2717) [attach] - receive notification: highlight []
2022-08-31T11:29:15.480 INFO (pid:2717) [attach] - receive notification: highlight []
2022-08-31T11:29:15.516 INFO (pid:2717) [attach] - Request action: diagnosticList []
2022-08-31T11:29:15.516 INFO (pid:2717) [attach] - receive notification: runCommand [
  'coc-helper.internal.didVimEvent_m1_v0_13_0_explorer_2',
  'CocDiagnosticChange'
]
2022-08-31T11:29:15.564 INFO (pid:2717) [attach] - Request action: diagnosticList []
2022-08-31T11:29:15.564 INFO (pid:2717) [attach] - receive notification: runCommand [
  'coc-helper.internal.didVimEvent_m1_v0_13_0_explorer_2',
  'CocDiagnosticChange'
]
2022-08-31T11:29:16.531 INFO (pid:2717) [attach] - Request action: diagnosticList []
2022-08-31T11:29:16.532 INFO (pid:2717) [attach] - receive notification: runCommand [
  'coc-helper.internal.didVimEvent_m1_v0_13_0_explorer_2',
  'CocDiagnosticChange'
]
2022-08-31T11:29:16.582 INFO (pid:2717) [attach] - Request action: diagnosticList []
2022-08-31T11:29:16.583 INFO (pid:2717) [attach] - receive notification: runCommand [
  'coc-helper.internal.didVimEvent_m1_v0_13_0_explorer_2',
  'CocDiagnosticChange'
]
2022-08-31T11:29:17.397 INFO (pid:2717) [attach] - Request action: doAutocmd [ 1, 2 ]
2022-08-31T11:29:17.806 INFO (pid:2717) [attach] - receive notification: highlight []
2022-08-31T11:29:17.906 INFO (pid:2717) [attach] - Request action: diagnosticList []
2022-08-31T11:29:17.906 INFO (pid:2717) [attach] - receive notification: runCommand [
  'coc-helper.internal.didVimEvent_m1_v0_13_0_explorer_2',
  'CocDiagnosticChange'
]
2022-08-31T11:29:17.960 INFO (pid:2717) [attach] - Request action: diagnosticList []
2022-08-31T11:29:17.960 INFO (pid:2717) [attach] - receive notification: runCommand [
  'coc-helper.internal.didVimEvent_m1_v0_13_0_explorer_2',
  'CocDiagnosticChange'
]
2022-08-31T11:30:02.498 INFO (pid:2717) [attach] - Request action: diagnosticList []
2022-08-31T11:30:02.502 INFO (pid:2717) [attach] - receive notification: runCommand [
  'coc-helper.internal.didVimEvent_m1_v0_13_0_explorer_2',
  'CocDiagnosticChange'
]
2022-08-31T11:30:24.512 INFO (pid:2717) [attach] - Request action: diagnosticList []
2022-08-31T11:30:24.512 INFO (pid:2717) [attach] - receive notification: runCommand [
  'coc-helper.internal.didVimEvent_m1_v0_13_0_explorer_2',
  'CocDiagnosticChange'
]
2022-08-31T11:30:31.058 INFO (pid:2717) [attach] - receive notification: runCommand [
  'coc-helper.internal.didVimEvent_m1_v0_13_0_coc_helper_1',
  'BufWipeout',
  15
]
2022-08-31T11:30:31.058 INFO (pid:2717) [attach] - receive notification: runCommand [
  'coc-helper.internal.didVimEvent_m1_v0_13_0_explorer_2',
  'BufWipeout',
  15
]
2022-08-31T11:30:31.058 INFO (pid:2717) [attach] - receive notification: runCommand [
  'coc-helper.internal.didVimEvent_m1_v0_13_0_coc_helper_1',
  'BufWipeout',
  14
]
2022-08-31T11:30:31.058 INFO (pid:2717) [attach] - receive notification: runCommand [
  'coc-helper.internal.didVimEvent_m1_v0_13_0_explorer_2',
  'BufWipeout',
  14
]
2022-08-31T11:30:31.058 INFO (pid:2717) [attach] - receive notification: runCommand [
  'coc-helper.internal.didVimEvent_m1_v0_13_0_coc_helper_1',
  'BufWipeout',
  17
]
2022-08-31T11:30:31.059 INFO (pid:2717) [attach] - receive notification: runCommand [
  'coc-helper.internal.didVimEvent_m1_v0_13_0_explorer_2',
  'BufWipeout',
  17
]
2022-08-31T11:30:31.059 INFO (pid:2717) [attach] - receive notification: runCommand [
  'coc-helper.internal.didVimEvent_m1_v0_13_0_coc_helper_1',
  'BufWipeout',
  16
]
2022-08-31T11:30:31.059 INFO (pid:2717) [attach] - receive notification: runCommand [
  'coc-helper.internal.didVimEvent_m1_v0_13_0_explorer_2',
  'BufWipeout',
  16
]
2022-08-31T11:30:40.054 INFO (pid:2717) [attach] - receive notification: runCommand [
  'coc-helper.internal.didVimEvent_m1_v0_13_0_coc_helper_1',
  'BufWipeout',
  19
]
2022-08-31T11:30:40.054 INFO (pid:2717) [attach] - receive notification: runCommand [
  'coc-helper.internal.didVimEvent_m1_v0_13_0_explorer_2',
  'BufWipeout',
  19
]
2022-08-31T11:30:40.054 INFO (pid:2717) [attach] - receive notification: runCommand [
  'coc-helper.internal.didVimEvent_m1_v0_13_0_coc_helper_1',
  'BufWipeout',
  18
]
2022-08-31T11:30:40.055 INFO (pid:2717) [attach] - receive notification: runCommand [
  'coc-helper.internal.didVimEvent_m1_v0_13_0_explorer_2',
  'BufWipeout',
  18
]
2022-08-31T11:30:40.055 INFO (pid:2717) [attach] - receive notification: runCommand [
  'coc-helper.internal.didVimEvent_m1_v0_13_0_coc_helper_1',
  'BufWipeout',
  21
]
2022-08-31T11:30:40.055 INFO (pid:2717) [attach] - receive notification: runCommand [
  'coc-helper.internal.didVimEvent_m1_v0_13_0_explorer_2',
  'BufWipeout',
  21
]
2022-08-31T11:30:40.055 INFO (pid:2717) [attach] - receive notification: runCommand [
  'coc-helper.internal.didVimEvent_m1_v0_13_0_coc_helper_1',
  'BufWipeout',
  20
]
2022-08-31T11:30:40.055 INFO (pid:2717) [attach] - receive notification: runCommand [
  'coc-helper.internal.didVimEvent_m1_v0_13_0_explorer_2',
  'BufWipeout',
  20
]
2022-08-31T11:30:40.567 INFO (pid:2717) [attach] - receive notification: highlight []
2022-08-31T11:30:40.585 INFO (pid:2717) [attach] - Request action: diagnosticList []
2022-08-31T11:30:40.585 INFO (pid:2717) [attach] - receive notification: runCommand [
  'coc-helper.internal.didVimEvent_m1_v0_13_0_explorer_2',
  'CocDiagnosticChange'
]
2022-08-31T11:30:42.197 INFO (pid:2717) [attach] - Request action: diagnosticList []
2022-08-31T11:30:42.197 INFO (pid:2717) [attach] - receive notification: runCommand [
  'coc-helper.internal.didVimEvent_m1_v0_13_0_explorer_2',
  'CocDiagnosticChange'
]
2022-08-31T11:30:43.406 INFO (pid:2717) [attach] - Request action: doAutocmd [ 1, 22 ]
2022-08-31T11:30:43.409 INFO (pid:2717) [attach] - Request action: diagnosticList []
2022-08-31T11:30:43.410 INFO (pid:2717) [attach] - receive notification: runCommand [
  'coc-helper.internal.didVimEvent_m1_v0_13_0_explorer_2',
  'CocDiagnosticChange'
]
2022-08-31T11:30:43.721 INFO (pid:2717) [attach] - receive notification: highlight []
2022-08-31T11:32:33.182 INFO (pid:2717) [attach] - receive notification: runCommand [
  'coc-helper.internal.didVimEvent_m1_v0_13_0_coc_helper_1',
  'BufDelete',
  22
]
2022-08-31T11:32:33.182 INFO (pid:2717) [attach] - receive notification: runCommand [
  'coc-helper.internal.didVimEvent_m1_v0_13_0_explorer_2',
  'BufDelete',
  22
]
2022-08-31T11:32:33.682 INFO (pid:2717) [attach] - receive notification: highlight []
2022-08-31T11:32:33.688 INFO (pid:2717) [attach] - Request action: diagnosticList []
2022-08-31T11:32:33.689 INFO (pid:2717) [attach] - receive notification: runCommand [
  'coc-helper.internal.didVimEvent_m1_v0_13_0_explorer_2',
  'CocDiagnosticChange'
]
2022-08-31T11:32:36.550 INFO (pid:2717) [attach] - Request action: diagnosticList []
2022-08-31T11:32:36.550 INFO (pid:2717) [attach] - receive notification: runCommand [
  'coc-helper.internal.didVimEvent_m1_v0_13_0_explorer_2',
  'CocDiagnosticChange'
]
2022-08-31T11:32:36.612 INFO (pid:2717) [attach] - Request action: diagnosticList []
2022-08-31T11:32:36.612 INFO (pid:2717) [attach] - receive notification: runCommand [
  'coc-helper.internal.didVimEvent_m1_v0_13_0_explorer_2',
  'CocDiagnosticChange'
]
2022-08-31T11:33:23.215 INFO (pid:2717) [attach] - receive notification: highlight []
2022-08-31T11:33:27.952 INFO (pid:2717) [attach] - Request action: diagnosticList []
2022-08-31T11:33:27.953 INFO (pid:2717) [attach] - receive notification: runCommand [
  'coc-helper.internal.didVimEvent_m1_v0_13_0_explorer_2',
  'CocDiagnosticChange'
]
2022-08-31T11:33:28.019 INFO (pid:2717) [attach] - Request action: diagnosticList []
2022-08-31T11:33:28.019 INFO (pid:2717) [attach] - receive notification: runCommand [
  'coc-helper.internal.didVimEvent_m1_v0_13_0_explorer_2',
  'CocDiagnosticChange'
]
2022-08-31T11:33:29.166 INFO (pid:2717) [attach] - receive notification: highlight []
2022-08-31T11:33:29.262 INFO (pid:2717) [attach] - Request action: diagnosticList []
2022-08-31T11:33:29.262 INFO (pid:2717) [attach] - receive notification: runCommand [
  'coc-helper.internal.didVimEvent_m1_v0_13_0_explorer_2',
  'CocDiagnosticChange'
]
2022-08-31T11:33:29.318 INFO (pid:2717) [attach] - Request action: diagnosticList []
2022-08-31T11:33:29.318 INFO (pid:2717) [attach] - receive notification: runCommand [
  'coc-helper.internal.didVimEvent_m1_v0_13_0_explorer_2',
  'CocDiagnosticChange'
]
2022-08-31T11:33:29.539 INFO (pid:2717) [attach] - Request action: doAutocmd [ 1, 2 ]
2022-08-31T11:33:29.951 INFO (pid:2717) [attach] - receive notification: highlight []
2022-08-31T11:33:30.049 INFO (pid:2717) [attach] - Request action: diagnosticList []
2022-08-31T11:33:30.049 INFO (pid:2717) [attach] - receive notification: runCommand [
  'coc-helper.internal.didVimEvent_m1_v0_13_0_explorer_2',
  'CocDiagnosticChange'
]
2022-08-31T11:33:30.082 INFO (pid:2717) [attach] - Request action: diagnosticList []
2022-08-31T11:33:30.082 INFO (pid:2717) [attach] - receive notification: runCommand [
  'coc-helper.internal.didVimEvent_m1_v0_13_0_explorer_2',
  'CocDiagnosticChange'
]
2022-08-31T11:35:21.138 INFO (pid:2717) [attach] - receive notification: runCommand [ 'explorer', '--preset', 'floating' ]
2022-08-31T11:35:23.305 INFO (pid:2717) [attach] - receive notification: highlight []
2022-08-31T11:35:23.875 INFO (pid:2717) [attach] - receive notification: highlight []
2022-08-31T11:35:24.876 INFO (pid:2717) [attach] - receive notification: highlight []
2022-08-31T11:35:26.594 INFO (pid:2717) [attach] - Request action: doKeymap [ 'explorer-key-n-df' ]
2022-08-31T11:35:27.878 INFO (pid:2717) [attach] - receive notification: highlight []
2022-08-31T11:35:28.881 INFO (pid:2717) [attach] - receive notification: highlight []
2022-08-31T11:35:29.377 INFO (pid:2717) [attach] - Request action: doKeymap [ 'explorer-key-n-df' ]
2022-08-31T11:35:30.150 INFO (pid:2717) [attach] - receive notification: highlight []
2022-08-31T11:36:02.795 INFO (pid:2717) [attach] - Request action: doKeymap [ 'explorer-key-n-[esc]' ]
2022-08-31T11:36:03.309 INFO (pid:2717) [attach] - receive notification: highlight []
2022-08-31T11:36:07.361 INFO (pid:2717) [attach] - receive notification: showInfo []

Steps to reproduce Steps to reproduce the behavior:

  1. Open coc-explorer
  2. Select any file and pressing df
  3. Show the popup if I wan to delete, I press yes
  4. I See the error "[coc.nvim] Error: spawn Unknown system error -86"

Expected behavior

Should delete the file or folder

weirongxu commented 2 years ago

Did you configure the explorer.trash.command option?

aspiiire commented 2 years ago

Nope, Fantastic it was really helpful, just for reference to other people.

I have added this line inside coc-settings.json "explorer.trash.command": "trash %s"

I also had to install trash with brew install trash since I am on a Mac device, And now everything work fine, nice πŸ˜„!

But I was wondering why I never had to set it up and it always worked out of the box, also in mac devices, what may be the issue?

weirongxu commented 2 years ago

I guess it could be some issue with the trash library. I found that it compiles an executable in macos (link). Maybe this library is not supported to run on your mac? Like M1 ARM CPU?

weirongxu commented 2 years ago

Okay, I found the answer, we need to upgrade the trash library https://github.com/sindresorhus/macos-trash/issues/15 . But the bad news is that trash migrated to node ESM after 8.0, coc-nvim may not support it, I will test it later. :cry:

aspiiire commented 2 years ago

Okay, I found the answer, we need to upgrade the trash library sindresorhus/macos-trash#15 . But the bad news is that trash migrated to node ESM after 8.0, coc-nvim may not support it, I will test it later. 😒

Thanks for you help and thanks for your time, to be honest the most important thing is that You gave me a way to make it work. By the way, With m1 the air mac works properly it's only with the m1 pro that give this problem.