mikesmithgh / kitty-scrollback.nvim

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

bug: module 'kitty-scrollback.launch' not found #74

Closed 4rtemis-4rrow closed 10 months ago

4rtemis-4rrow commented 10 months ago

followed the instruction to the letter, healthcheck was all good, the kitten, kitty config, etc, all of it was copy pasted from the readme (except for the file paths, which I changed to match mine), pressing ctrl+shift+h runs neovim, but the following error happens

Error detected while processing VimEnter Autocommands for "*":
Error executing lua callback: [string ":lua"]:1: module 'kitty-scrollback.launch' not found:
        no field package.preload['kitty-scrollback.launch']
        no file './kitty-scrollback/launch.lua'
        no file '/usr/share/luajit-2.1/kitty-scrollback/launch.lua'
        no file '/usr/local/share/lua/5.1/kitty-scrollback/launch.lua'
        no file '/usr/local/share/lua/5.1/kitty-scrollback/launch/init.lua'
        no file '/usr/share/lua/5.1/kitty-scrollback/launch.lua'
        no file '/usr/share/lua/5.1/kitty-scrollback/launch/init.lua'
        no file './kitty-scrollback/launch.so'
        no file '/usr/local/lib/lua/5.1/kitty-scrollback/launch.so'
        no file '/usr/lib/lua/5.1/kitty-scrollback/launch.so'
        no file '/usr/local/lib/lua/5.1/loadall.so'
        no file './kitty-scrollback.so'
        no file '/usr/local/lib/lua/5.1/kitty-scrollback.so'
        no file '/usr/lib/lua/5.1/kitty-scrollback.so'
        no file '/usr/local/lib/lua/5.1/loadall.so'
stack traceback:
        [C]: in function 'require'
        [string ":lua"]:1: in function <[string ":lua"]:1>
Press ENTER or type command to continue

if it's of any difference, I'm using lazy.nvim, distro is garuda linux (arch based) meaning I have all the latest packages thanks to anyone who takes the time to read this, and I'm sorry if I forgot to add something important

mikesmithgh commented 10 months ago

@4rtemis-4rrow thanks for reporting, could you provide the output of :KittyScrollbackCheckHealth and a copy of what your lazy.nvim setup looks like for kitty-scrollback.nvim?

4rtemis-4rrow commented 10 months ago

@mikesmithgh

:KittyScrollbackCheckHealth

==============================================================================
kitty-scrollback: require("kitty-scrollback.health").check()

kitty-scrollback: Neovim version 0.9+ ~
- OK NVIM 0.9.4
- If you are using a version of nvim that is less than 0.10, then formatting on this checkhealth may be malformed

kitty-scrollback: kitty-scrollback.nvim version ~
- OK        `|`\___/`|`       *kitty-scrollback.nvim* @ `3f3e43d`
  =) `^`Y`^` (=
  \  *^*  /       If you have any issues or questions using *kitty-scrollback.nvim* then     
  ` )=*=( `       please create an issue at                                                    
  /     \       https://github.com/mikesmithgh/kitty-scrollback.nvim/issues and              
  |     |       provide the `KittyScrollbackCheckHealth` report.                               
  /| | | |\                                                                                    
  \| | `|`_`|`/\
  /_// ___/     *Bonus* *points* *for* *cat* *memes*
  \_)       

kitty-scrollback: Kitty remote control ~
- OK `kitty @ ls` exited with code *0*

kitty-scrollback: Kitty data ~
- OK Kitty data available
  >lua
  {
  columns = 203,
  cursor_x = 7,
  cursor_y = 2,
  kitty_config_dir = "/home/artemis-arrow/.config/kitty",
  kitty_opts = {
  allow_remote_control = "yes",
  listen_on = "unix:/tmp/kitty",
  scrollback_fill_enlarged_window = false,
  scrollback_lines = 2000,
  scrollback_pager = { "less", "--chop-long-lines", "--RAW-CONTROL-CHARS", "+INPUT_LINE_NUMBER" },
  scrollback_pager_history_size = 0,
  shell_integration = { "enabled" }
  },
  kitty_scrollback_config = "ksb_builtin_checkhealth",
  kitty_version = { 0, 31, 0 },
  ksb_dir = "/home/artemis-arrow/.local/share/nvim/lazy/kitty-scrollback.nvim",
  lines = 53,
  scrolled_by = 0,
  window_id = 1,
  window_title = "nv"
  }

kitty-scrollback: Kitty version 0.29+ ~
- OK kitty 0.31.0

kitty-scrollback: clipboard ~
- OK Clipboard tool found: *wl-copy*

kitty-scrollback: sed ~
- OK `sed -E -e s/$//g -e s/\[\?25.\[.*;.*H\[.*//g` exited with code *0* and stdout `expected`
  `sed: /usr/bin/sed`

kitty-scrollback: Kitty debug config ~
- OK kitty 0.31.0 created by Kovid Goyal
  Linux Daedalus 6.5.3-zen1-1-zen #1 ZEN SMP PREEMPT_DYNAMIC Wed, 13 Sep 2023 08:37:16 +0000 x86_64
  Garuda Linux 6.5.3-zen1-1-zen (/dev/tty)

  DISTRIB_ID=Garuda
  DISTRIB_RELEASE=Soaring
  DISTRIB_DESCRIPTION="Garuda Linux"
  DISTRIB_CODENAME="Raptor"
  Running under: `WaylandFrozen:` False
  `Paths:  kitty:` /usr/bin/kitty
  `  base dir:` /usr/lib/kitty
  `  extensions dir:` /usr/lib/kitty/kitty
  `  system shell:` /bin/zsh
  `Loaded config files:`
  /home/artemis-arrow/.config/kitty/kitty.conf
  `Loaded config overrides:`
  allow_remote_control yes

  Config options different from defaults:
  active_tab_font_style      (True, False)
  allow_remote_control       yes
  background_opacity         0.7
  bold_font                  JetBrains Mono NL Bold Nerd Font Complete
  bold_italic_font           JetBrains Mono NL Bold Italic Nerd Font Complete Mono
  confirm_os_window_close    0
  cursor_blink_interval      0.0
  cursor_shape               2
  dynamic_background_opacity True
  enable_audio_bell          False
  font_family                JetBrains Mono NL Regular Nerd Font Complete Mono
  font_size                  9.0
  inactive_tab_font_style    (True, False)
  italic_font                JetBrains Mono NL Italic Nerd Font Complete Mono
  listen_on                  unix:/tmp/kitty
  open_url_with              ['librewolf']
  selection_foreground       None
  strip_trailing_spaces      smart
  tab_fade                   (1.0,)
  `Changed mouse actions:`
  ctrl+shift+right press ungrabbed →  combine : mouse_select_command_output : kitty_scrollback_nvim --config ksb_builtin_last_visited_cmd_output
  `Added shortcuts:`
  ctrl+j →  scroll_line_down
  ctrl+k →  scroll_line_up
  ctrl+shift+/ →  next_layout
  ctrl+shift+c →  copy_to_clipboard
  ctrl+shift+j →  next_window
  ctrl+shift+k →  previous_window
  ctrl+shift+left →  previous_tab
  ctrl+shift+n →  new_window
  ctrl+shift+r →  start_resizing_window
  ctrl+shift+right →  next_tab
  ctrl+shift+t →  new_tab
  ctrl+shift+v →  paste_from_clipboard
  `Removed shortcuts:`
  ctrl+shift+tab →  previous_tab
  ctrl+tab →  next_tab
  kitty_mod++ →  change_font_size all +2.0
  kitty_mod+, →  move_tab_backward
  kitty_mod+- →  change_font_size all -2.0
  kitty_mod+. →  move_tab_forward
  kitty_mod+0 →  tenth_window
  kitty_mod+1 →  first_window
  kitty_mod+2 →  second_window
  kitty_mod+3 →  third_window
  kitty_mod+4 →  fourth_window
  kitty_mod+5 →  fifth_window
  kitty_mod+6 →  sixth_window
  kitty_mod+7 →  seventh_window
  kitty_mod+8 →  eighth_window
  kitty_mod+9 →  ninth_window
  kitty_mod+= →  change_font_size all +2.0
  kitty_mod+[ →  previous_window
  kitty_mod+] →  next_window
  kitty_mod+` →  move_window_to_top
  kitty_mod+a > 1 →  set_background_opacity 1
  kitty_mod+a > d →  set_background_opacity default
  kitty_mod+a > l →  set_background_opacity -0.1
  kitty_mod+a > m →  set_background_opacity +0.1
  kitty_mod+alt+t →  set_tab_title
  kitty_mod+b →  move_window_backward
  kitty_mod+backspace →  change_font_size all 0
  kitty_mod+c →  copy_to_clipboard
  kitty_mod+delete →  clear_terminal reset active
  kitty_mod+down →  scroll_line_down
  kitty_mod+e →  open_url_with_hints
  kitty_mod+end →  scroll_end
  kitty_mod+enter →  new_window
  kitty_mod+escape →  kitty_shell window
  kitty_mod+f →  move_window_forward
  kitty_mod+f1 →  show_kitty_doc overview
  kitty_mod+f10 →  toggle_maximized
  kitty_mod+f11 →  toggle_fullscreen
  kitty_mod+f2 →  edit_config_file
  kitty_mod+f5 →  load_config_file
  kitty_mod+f6 →  debug_config
  kitty_mod+f7 →  focus_visible_window
  kitty_mod+f8 →  swap_with_window
  kitty_mod+home →  scroll_home
  kitty_mod+j →  scroll_line_down
  kitty_mod+k →  scroll_line_up
  kitty_mod+kp_add →  change_font_size all +2.0
  kitty_mod+kp_subtract →  change_font_size all -2.0
  kitty_mod+l →  next_layout
  kitty_mod+left →  previous_tab
  kitty_mod+n →  new_os_window
  kitty_mod+o →  pass_selection_to_program
  kitty_mod+p > f →  kitten hints --type path --program -
  kitty_mod+p > h →  kitten hints --type hash --program -
  kitty_mod+p > l →  kitten hints --type line --program -
  kitty_mod+p > n →  kitten hints --type linenum
  kitty_mod+p > shift+f →  kitten hints --type path
  kitty_mod+p > w →  kitten hints --type word --program -
  kitty_mod+p > y →  kitten hints --type hyperlink
  kitty_mod+page_down →  scroll_page_down
  kitty_mod+page_up →  scroll_page_up
  kitty_mod+q →  close_tab
  kitty_mod+r →  start_resizing_window
  kitty_mod+right →  next_tab
  kitty_mod+s →  paste_from_selection
  kitty_mod+t →  new_tab
  kitty_mod+u →  kitten unicode_input
  kitty_mod+up →  scroll_line_up
  kitty_mod+v →  paste_from_clipboard
  kitty_mod+w →  close_window
  kitty_mod+x →  scroll_to_prompt 1
  kitty_mod+z →  scroll_to_prompt -1
  shift+insert →  paste_from_selection
  `Changed shortcuts:`
  kitty_mod+g →  kitty_scrollback_nvim --config ksb_builtin_last_cmd_output
  kitty_mod+h →  kitty_scrollback_nvim
  `Colors`:
  active_border_color        #3d59a1 
  active_tab_background      #16161e 
  active_tab_foreground      #3d59a1 
  background                 #1a1b26 
  bell_border_color          #e0af68 
  color0                     #414868 
  color1                     #f7768e 
  color10                    #73daca 
  color11                    #e0af68 
  color12                    #7aa2f7 
  color13                    #bb9af7 
  color14                    #7dcfff 
  color15                    #c0caf5 
  color2                     #73daca 
  color3                     #e0af68 
  color4                     #7aa2f7 
  color5                     #bb9af7 
  color6                     #7dcfff 
  color7                     #c0caf5 
  color8                     #414868 
  color9                     #f7768e 
  cursor                     #c0caf5 
  cursor_text_color          #1a1b26 
  foreground                 #a9b1d6 
  inactive_border_color      #101014 
  inactive_tab_background    #16161e 
  inactive_tab_foreground    #787c99 
  selection_background       #28344a 
  tab_bar_background         #101014 
  url_color                  #9ece6a 

  `Important environment variables seen by the kitty process:`
  PATH                                `/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl`
  LANG                                `en_US.UTF-8`
  EDITOR                              `/usr/bin/nvim`
  SHELL                               `/bin/zsh`
  DISPLAY                             `:0`
  WAYLAND_DISPLAY                     `wayland-1`
  USER                                `artemis-arrow`
  XCURSOR_SIZE                        `24`
  LC_ADDRESS                          `en_GB.UTF-8`
  LC_NAME                             `en_GB.UTF-8`
  LC_MONETARY                         `en_GB.UTF-8`
  XDG_SEAT                            `seat0`
  XDG_SESSION_DESKTOP                 `sway`
  XDG_SESSION_TYPE                    `wayland`
  LC_PAPER                            `en_GB.UTF-8`
  XDG_CURRENT_DESKTOP                 `sway`
  XDG_SESSION_CLASS                   `user`
  LC_IDENTIFICATION                   `en_GB.UTF-8`
  LC_TELEPHONE                        `en_GB.UTF-8`
  LC_MEASUREMENT                      `en_GB.UTF-8`
  XDG_VTNR                            `1`
  XDG_SESSION_ID                      `3`
  XDG_RUNTIME_DIR                     `/run/user/1000`
  LC_TIME                             `en_GB.UTF-8`
  LC_NUMERIC                          `en_GB.UTF-8`

lazy.nvim setup

    {
        'mikesmithgh/kitty-scrollback.nvim',
        enabled = true,
        lazy = true,
        cmd = { 'KittyScrollbackGenerateKittens', 'KittyScrollbackCheckHealth' },
        event = { 'User KittyScrollbackLaunch' },
        config = function()
            require('kitty-scrollback').setup()
        end,
    },

thank you for taking the time to respond

mikesmithgh commented 10 months ago

@4rtemis-4rrow thanks for the info, everything seems configured correctly. For some reason, it is having trouble finding your kitty-scrollback.nvim installation at /home/artemis-arrow/.local/share/nvim/lazy/kitty-scrollback.nvim.

Could you copy the file reproduce.lua to you machine, run the following command, and copy the results?

I am trying to see if the directory is where we expect it to be and if there are any issues adding it to neovim's runtime path. This is basically a chunk of what kitty-scrollback.nvim does when it starts (https://github.com/mikesmithgh/kitty-scrollback.nvim/blob/main/python/kitty_scrollback_nvim.py#L181 if you are interested).

nvim --headless -u reproduce.lua -c 'quit'

reproduce.lua

vim.print("list ksb_dir")
vim.cmd([[!ls /home/artemis-arrow/.local/share/nvim/lazy/kitty-scrollback.nvim]])

vim.print("before rtpath append")
vim.print(vim.opt.runtimepath:get())

vim.opt.runtimepath:append([[/home/artemis-arrow/.local/share/nvim/lazy/kitty-scrollback.nvim]])

vim.print("after rtpath append")
vim.print(vim.opt.runtimepath:get())

require("kitty-scrollback.launch")
4rtemis-4rrow commented 10 months ago

@mikesmithgh

list ksb_dir
:!ls /home/artemis-arrow/.local/share/nvim/lazy/kitty-scrollback.nvim
CHANGELOG.md
CONTRIBUTING.md
doc
lua
media
python
README.md
scripts
setup.cfg

before rtpath append
{ "/home/artemis-arrow/.config/nvim", "/etc/xdg/nvim", "/home/artemis-arrow/.local/share/nvim/site", "/usr/local/share/nvim/site", "/usr/share/nvim/site", "/usr/share/nvim/runtime", "/usr/lib/nvim", "/usr/share/nvim/site/after", "/usr/local/share/nvim/site/after", "/home/artemis-arrow/.local/share/nvim/site/after", "/etc/xdg/nvim/after", "/home/artemis-arrow/.config/nvim/after" }
after rtpath append
{ "/home/artemis-arrow/.config/nvim", "/etc/xdg/nvim", "/home/artemis-arrow/.local/share/nvim/site", "/usr/local/share/nvim/site", "/usr/share/nvim/site", "/usr/share/nvim/runtime", "/usr/lib/nvim", "/usr/share/nvim/site/after", "/usr/local/share/nvim/site/after", "/home/artemis-arrow/.local/share/nvim/site/after", "/etc/xdg/nvim/after", "/home/artemis-arrow/.config/nvim/after", "/home/artemis-arrow/.local/share/nvim/lazy/kitty-scrollback.nvim" }%
mikesmithgh commented 10 months ago

@4rtemis-4rrow everything looks correct, this is an odd one to debug. I created a branch to try and help.

Step 1

Could you add the the following line to your lazy.nvim config and reload lazy.nvim to use the new branch?

    branch = 'debug-launch-failure',

After that branch is setup, try ctrl+shift+h and copy over any errors you see.

Step 2

Could you let me know what your kitty.conf has for the action_alias kitty_scrollback_nvim?

Step 3

If it is still failing, try adding --no-nvim-args to your kitten. In kitty.conf update the line like this:

map kitty_mod+h kitty_scrollback_nvim --no-nvim-args

Then completely close and reopen Kitty, and try ctrl+shift+h and let me know what happens.

Thanks for troubleshooting!

mikesmithgh commented 10 months ago

Hey @4rtemis-4rrow I am closing this. Feel free to reopen if you need any help.