-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug: kitty-scrollback.nvim errors when using image.nvim #261
Comments
Hi @paulwyszynski, thank you for reporting. I haven't tested kitty-scrollback.nvim with image.nvim yet. Could you share your Neovim config repo or a snippet of your image.nvim config setup so that I can try and reproduce? |
Hi @mikesmithgh sure here you can find my image.lua file for image.nvim /~https://github.com/paulwyszynski/dotfiles/blob/master/nvim/lua/plugins/image.lua In the plugins folder is my entire plugins setup with all the plugins I use. I also use lazyvim as my setup http://www.lazyvim.org/ |
Hey @paulwyszynski, I am unable to get I get the error same error as you see in kitty-scrollback.nvim.
I see this in the README of image.nvim:
I tried following those steps but it didn't work for me. Do you have some configuration in your .bash/zsh/fish for this? I am guessing kitty-scrollback.nvim is having trouble finding some environment variables. |
Hi @mikesmithgh |
Thanks @paulwyszynski , I figured out what was happening. I have a wrapper script around kitty-scrollback.nvim is unable to find
You have two options to fix this:
Example: {
'3rd/image.nvim',
cond = vim.env.KITTY_SCROLLBACK_NVIM ~= 'true',
opts = {},
},
Let me know how it goes and I'll plan to update the Wiki /~https://github.com/mikesmithgh/kitty-scrollback.nvim/wiki#recommended-configurations-for-other-plugins |
Hi @mikesmithgh thank you for your time and investigation! I actually prefer the 2nd solution. But the path does not exist for me. When I echo this I added the file The 1st solution with the cond field works for me. If you have any suggestions for the 2nd solution with env path, let me know! Thanks so far! |
Could you try the path |
Tried it already, same issue. |
@paulwyszynski Actually, could you try using the env var If that doesn't work, then some follow up: How did you install ImageMagick ? When I was troubleshooting this, I found that magick LuaRock is using the command Try
You should see something similar to If you don't see a file similar to If you don't see the If it is there, and you have You can also try the commands |
I installed it like so: both entries added:
Same issue. this is my output here
in neovim only this is found: the fallback is nil in neovim: |
hmm.. I'm not sure why it isn't working. Okay, one last (hacky) thing you can do 😂 There is an open issue 3rd/image.nvim#91 (comment) related, seems like others have similar issues. The workaround is to hardcode the full path to libMagickWand-7.Q16HDRI.dylib in the magick luarock. The file should be at You can replace /~https://github.com/leafo/magick/blob/6971fa700c4d392130492a3925344b51c7cc54aa/magick/wand/lib.lua#L220-L231 lib = try_to_load("MagickWand", function()
local lname = get_flags():match("-l(MagickWand[^%s]*)")
local suffix
if ffi.os == "OSX" then
suffix = ".dylib"
elseif ffi.os == "Windows" then
suffix = ".dll"
else
suffix = ".so"
end
return lname and "lib" .. lname .. suffix
end) with lib = try_to_load("/usr/local/lib/libMagickWand-7.Q16HDRI.dylib") This hardcodes the filepath, so not great, but at least a workaround. |
I came across this post as well, but the path does not exist for me, also installing lua 5.1 via brew is not an option anymore. My luarocks folder looks like this: If it's working for you I think we had a different installation approach, because all I did, is like installing imagemagick via brew and the content added to my image.lua file in plugins folder. That is weird about the error, path's non-existent:
|
@paulwyszynski
|
also FYI for brew you can use luajit for 5.1.
I think luarocks.nvim is doing some magic under the hood to make it happen 😄 |
Yeah i think so too, the luarocks dependency makes some vodoo. And installing luajit will fix it? |
Interesting. Has image.nvim worked for you in just a normal Neovim session. Have you actually been able to render an image? I am not sure where your lua rock is being saved on your machine. Since you are using lazy.nvim and luarocks.nvim, I assumed it was The other approach using If it is working for you, then I am just not sure where it is on your filesystem. If it is not working, you could try running this in Neovim:
and it should install the rock to |
Ok I removed everything and installed from scratch, now I can see the rocks folder and this workaround #261 (comment) seems to work for now. Thank you! Hope they fix this in the future. |
@paulwyszynski awesome! Glad the workaround worked at least. I'll plan to add a note to the wiki and close this issue out 👍 |
Hey,
I don't if it's correct to address this here or in image.nvim. So I'm using kitty and image.nvim /~https://github.com/3rd/image.nvim and according to the setup it works for me (If you follow the setup for MacOS). But when I'm trying to load the scrollback in nvim it show the nvim start screen with this error:
image.nvim: magick rock not found, please install it and restart your editor. Error: "...y/luarocks.nvim/.rocks/share/lua/5.1/magick/wand/lib.lua:220: Failed to load ImageMagick (MagickWand )"
Loading the scrollback in nvim also takes like ~15 sec.
This error doesn't appear when I open nvim normally. I guess this has something to do with my plugins setup.
The text was updated successfully, but these errors were encountered: