xvzc / chezmoi.nvim

Chezmoi plugin for neovim
MIT License
73 stars 3 forks source link

Error when running list on new setup. #10

Closed patrick-motard closed 5 months ago

patrick-motard commented 5 months ago

I'm getting the following errors when I attempt to run :Telescope chezmoi list-files. For context, here are the relevant dotfiles. Any ideas on what I may be doing wrong would be much appreciated!!

   Error  17:01:37 msg_show.lua_error Error executing luv callback:
cannot resume dead coroutine
stack traceback:
    [builtin#36]: at 0x56306f0f6f70
    [C]: in function 'wait'
    .../.local/share/nvim/lazy/plenary.nvim/lua/plenary/job.lua:486: in function 'wait'
    .../.local/share/nvim/lazy/plenary.nvim/lua/plenary/job.lua:453: in function 'sync'
    ...e/nvim/lazy/chezmoi.nvim/lua/chezmoi/commands/__base.lua:44: in function 'list'
    ...zy/chezmoi.nvim/lua/telescope/_extensions/find_files.lua:41: in function <...zy/chezmoi.nvim/lua/telescope/_extensions/find_files.lua:38>
    ...share/nvim/lazy/telescope.nvim/lua/telescope/command.lua:183: in function 'run_command'
    ...share/nvim/lazy/telescope.nvim/lua/telescope/command.lua:259: in function 'load_command'
    ...ocal/share/nvim/lazy/telescope.nvim/plugin/telescope.lua:108: in function <...ocal/share/nvim/lazy/telescope.nvim/plugin/telescope.lua:107>
    [C]: in function 'nvim_exec2'
    vim/_editor.lua: in function 'cmd'
    .../nvim/lazy/telescope.nvim/lua/telescope/actions/init.lua:429: in function 'run_replace_or_original'
    ...re/nvim/lazy/telescope.nvim/lua/telescope/actions/mt.lua:65: in function 'run_replace_or_original'
    ...re/nvim/lazy/telescope.nvim/lua/telescope/actions/mt.lua:65: in function 'key_func'
    ...hare/nvim/lazy/telescope.nvim/lua/telescope/mappings.lua:269: in function <...hare/nvim/lazy/telescope.nvim/lua/telescope/mappings.lua:268>
   Error  17:01:37 msg_show.lua_error Error executing luv callback:
...e/nvim/lazy/chezmoi.nvim/lua/chezmoi/commands/__base.lua:34: 'chezmoi list'command returned non 0 exit code:
chezmoi: unknown command "list" for "chezmoi"
stack traceback:
    [builtin#36]: at 0x56306f0f6f70
    [C]: in function 'wait'
    .../.local/share/nvim/lazy/plenary.nvim/lua/plenary/job.lua:486: in function 'wait'
    .../.local/share/nvim/lazy/plenary.nvim/lua/plenary/job.lua:453: in function 'sync'
    ...e/nvim/lazy/chezmoi.nvim/lua/chezmoi/commands/__base.lua:44: in function 'list'
    ...zy/chezmoi.nvim/lua/telescope/_extensions/find_files.lua:41: in function <...zy/chezmoi.nvim/lua/telescope/_extensions/find_files.lua:38>
    ...share/nvim/lazy/telescope.nvim/lua/telescope/command.lua:183: in function 'run_command'
    ...share/nvim/lazy/telescope.nvim/lua/telescope/command.lua:259: in function 'load_command'
    ...ocal/share/nvim/lazy/telescope.nvim/plugin/telescope.lua:108: in function <...ocal/share/nvim/lazy/telescope.nvim/plugin/telescope.lua:107>
    [C]: in function 'nvim_exec2'
    vim/_editor.lua: in function 'cmd'
    .../nvim/lazy/telescope.nvim/lua/telescope/actions/init.lua:429: in function 'run_replace_or_original'
    ...re/nvim/lazy/telescope.nvim/lua/telescope/actions/mt.lua:65: in function 'run_replace_or_original'
    ...re/nvim/lazy/telescope.nvim/lua/telescope/actions/mt.lua:65: in function 'key_func'
    ...hare/nvim/lazy/telescope.nvim/lua/telescope/mappings.lua:269: in function <...hare/nvim/lazy/telescope.nvim/lua/telescope/mappings.lua:268>
xvzc commented 5 months ago

Hi! Thank you for having interest in my project. Please check out that the command is :Telescope chezmoi find_files, not list-files Also i need to handle errors that occur when the given command doens't exist. Thank you for your bug report.

patrick-motard commented 5 months ago

Sorry, I mistyped what I entered in my bug report. I did in fact type :Telescope chezmoi find_files, not list-files. As evidence, you can see that find_files is present in the stack trace i shared.

Additionally, this bug isn't just for the telescope command. It's also occurring when I run :ChezmoiList. The stack trace and error are the same in both cases.

patrick-motard commented 5 months ago

Hi! Thank you for having interest in my project.

And hello to you too! I'm incredibly excited about this project. It would save me an immense amount of time once i can get it working. A major quality of life improvement for sure.

xvzc commented 5 months ago

Oh I see! Can you share the output of chezmoi --version and nvim --version?

patrick-motard commented 5 months ago
 ✘  ~  nvim -v
NVIM v0.9.5
Build type: Release
LuaJIT 2.1.1692716794

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/local/share/nvim"

Run :checkhealth for more info
 ~  chezmoi --version
chezmoi version v2.7.3, commit 32a15ac909ee8108d0eaeebcdbbac2305e32a9ba, built at 2021-10-23T00:31:10Z, built by goreleaser
patrick-motard commented 5 months ago

It looks like list was introduced in v2.10.0. I updated chezmoi to the latest, 2.47.0, and this error no longer occurs.

Perhaps as an enhancement this plugin could throw an error if the user doesn't have at least 2.10.0 installed? I also like your idea of throwing an error if the user runs a command that doesn't exist.

FYI, the command run in the video on the projects readme is list-files, which believe doesn't exist.