mikesmithgh / kitty-scrollback.nvim

😽 Open your Kitty scrollback buffer with Neovim. Ameowzing!
Apache License 2.0
438 stars 11 forks source link

bug: KittyScrollbackCheckHealth hangs and unable to specify runtimepath with custom config #270

Open steakhutzeee opened 3 weeks ago

steakhutzeee commented 3 weeks ago

Hi, I just installed the plugin and look it's working mostly fine.

Noted a few points:

  1. nvim +'KittyScrollbackCheckHealth' does not work for me.

Kitty just hangs, becoming unresponsive.

Any idea why? Opening nvim and checking health from there with :checkhealth kitty finds nothing.

  1. Also, I noted that if I setup my config with global = function() then I still have to use --config global in my kitty.conf, like 'global' is not recognized as the actual global config.

  2. I managed to apply my custom keymaps defining them in a custom config via custom_config = function() and --config custom_config in my kitty.conf. Then I created an empty lua file with vim.opt.runtimepath:append(vim.fn.stdpath('data') .. '/lazy/kitty-scrollback.nvim') in it and appended --nvim-args -u /lua file. I tested opening nvim with -u option and pointing to this lua file and it opens without issue. But when I open the scrollback then I receive an error that it's unable to read my custom_config. Ideas why?

Thanks!

mikesmithgh commented 2 days ago

Opening nvim and checking health from there with :checkhealth kitty finds nothing.

This should be checkhealth kitty-scrollback

Any idea why?

Most likely there is some lazy loading going on and kitty-scrollback.nvim is not loaded yet. Could you share you configuration for kitty-scrollback.nvim?

I'm not sure if you are using lazy.nvim, but for example in the README https://github.com/mikesmithgh/kitty-scrollback.nvim/blob/d51725a6b71d65dd9df83ddc07903de2fb2736ee/README.md?plain=1#L241

You have to specify the cmd to automatically load kitty-scrollback.nvim for KittyScrollbackCheckHealth.

  {
    'mikesmithgh/kitty-scrollback.nvim',
    enabled = true,
    lazy = true,
    cmd = { 'KittyScrollbackGenerateKittens', 'KittyScrollbackCheckHealth' },
    event = { 'User KittyScrollbackLaunch' },
    -- version = '*', -- latest stable version, may have breaking changes if major version changed
    -- version = '^5.0.0', -- pin major version, include fixes and features that do not have breaking changes
    config = function()
      require('kitty-scrollback').setup()
    end,
  }

I managed to apply my custom keymaps defining them in a custom config via custom_config = function() and --config custom_config in my kitty.conf. Then I created an empty lua file with vim.opt.runtimepath:append(vim.fn.stdpath('data') .. '/lazy/kitty-scrollback.nvim') in it and appended --nvim-args -u /lua file. I tested opening nvim with -u option and pointing to this lua file and it opens without issue. But when I open the scrollback then I receive an error that it's unable to read my custom_config. Ideas why?

I'm not quite sure. Could you provide your Neovim and kitty.conf configuration so I can take a look?

steakhutzeee commented 2 days ago

Sure, here is my nvim kitty-scrollback config https://gist.github.com/steakhutzeee/92afb11bc18d0b97b5bb9ba029136600 and here is my Kitty config https://gist.github.com/steakhutzeee/e65233d3e61069fbce2b1bc69e369862

Also, manually entering the checkhealth as indicated I get:

ERROR No healthcheck found for "kitty-scrollback" plugin.

Yes, I'm using lazy.nvim and with my config the plugin looks like not loaded:

kitty-scrollback

Thanks!

mikesmithgh commented 2 days ago

Your config appears fine to me, at least I can't see anything that would be a problem.

Also, manually entering the checkhealth as indicated I get: ERROR No healthcheck found for "kitty-scrollback" plugin.

This makes sense since it is lazy loaded and hasn't loaded yet.

Try opening neovim and running

:lua require('kitty-scrollback')
checkhealth kitty-scrollback

This should at least give you some healthcheck (not the full one since it isn't ran with :KittyScrollbackCheckHealth). Let me know if that atleast works then will continue trying to troubleshoot.

I managed to apply my custom keymaps defining them in a custom config via custom_config = function() and --config custom_config in my kitty.conf. Then I created an empty lua file with vim.opt.runtimepath:append(vim.fn.stdpath('data') .. '/lazy/kitty-scrollback.nvim') in it and appended --nvim-args -u /lua file. I tested opening nvim with -u option and pointing to this lua file and it opens without issue. But when I open the scrollback then I receive an error that it's unable to read my custom_config. Ideas why?

I'm a little confused by this. Your config looked okay.

Are you saying you did:

  1. added custom_config to you kitty-scrollback.nvim config and --config custom_config in my kitty.conf
  2. it worked successfully?
  3. if so why did you create the other lua file and do --nvim-args -u /lua file ?

You may be combining two approached. Are you trying to follow https://github.com/mikesmithgh/kitty-scrollback.nvim?tab=readme-ov-file#user-configuration to have a separate nvim configuration?