mikesmithgh/kitty-scrollback.nvim

bug: list chars in keymap generation causing error: "Ignoring invalid config line"

mushfiq814 opened this issue · 4 comments

Hpoefully this is the right place to report this. I was seeing an issue with KittyScrollbackGenerateKittens since I use list and listchars within my neovim config and running nvim --headless +'KittyScrollbackGenerateKittens' +'set nonumber' +'set norelativenumber' +'%print' +'quit!' 2>&1 as instructed in the README caused the space list character to show up in the output in my terminal as follows

#·kitty-scrollback.nvim·Kitten·alias
action_alias·kitty_scrollback_nvim·kitten·/home/user/.local/share/nvim/lazy/kitty-scrollback.nvim/python/kitty_scrollback_nvim.py

#·Browse·scrollback·buffer·in·nvim
map·kitty_mod+h·kitty_scrollback_nvim
#·Browse·output·of·the·last·shell·command·in·nvim
map·kitty_mod+g·kitty_scrollback_nvim·--config·ksb_builtin_last_cmd_output
#·Show·clicked·command·output·in·nvim
mouse_map·ctrl+shift+right·press·ungrabbed·combine·:·mouse_select_command_output·:·kitty_scrollback_nvim·--config·ksb_builtin_last_visited_cmd_output

Notice the · characters where spaces should be. I didn't notice this at first and copied the generated config and obviously things didn't work. Looking at kitty logs, I would see all the lines being ignored with a Ignoring invalid config line error.

A quick solution to this might be to add an extra setting to disable list characters from being generated with :set nolist inside the KittyScrollbackGenerateKittens command, i.e. nvim --headless +'KittyScrollbackGenerateKittens' +'set nonumber' +'set norelativenumber' +'set nolist' +'%print' +'quit!' 2>&1

I wanted to at least report this so others could find this if searching for it.

Thank you for your work in building this great integration furthering my productivity with the terminal!

Thanks for reporting and the kind words 🙂. Good catch

🎉 This issue has been resolved in version 4.0.3 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@mushfiq814 I was able to fix this and simplify the command. Previously, it was printing the buffer which is why listchars, numbers, etc showed in the output. I changed it to print the commands directly. I updated the README and the command isn't as scary now 😂

Now you can just run:

nvim --headless +'KittyScrollbackGenerateKittens'

Let me know if you have any other issues 👍

Nice! Lol yup that's definitely better. Thank you!