image.nvim icon indicating copy to clipboard operation
image.nvim copied to clipboard

Ueberzug dies unexpectedly on neovim startup

Open JonasKleinebecker opened this issue 8 months ago • 3 comments

I tried to make the plugin work with ueberzug since my terminal doesnt support kitty but ueberzug dies unexpectedly on neovim startup and the image rendering in markdown files does not work.

My installation process:

echo 'deb http://download.opensuse.org/repositories/home:/justkidding/xUbuntu_24.10/ /' | sudo tee /etc/apt/sources.list.d/home:justkidding.list
curl -fsSL https://download.opensuse.org/repositories/home:justkidding/xUbuntu_24.10/Release.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/home_justkidding.gpg > /dev/null
sudo apt update
sudo apt install ueberzugpp
ueberzug --version

ueberzugpp 2.9.6

sudo apt install libmagickwand-dev
sudo luarocks install magick

neovim image.nvim config:

return {
  "3rd/image.nvim",
  opts = {
    backend = "ueberzug",
    processor = "magick_rock", -- or "magick_cli"
    integrations = {
      markdown = {
        enabled = true,
        clear_in_insert_mode = false,
        download_remote_images = true,
        only_render_image_at_cursor = false,
        floating_windows = false,          -- if true, images will be rendered in floating markdown windows
        filetypes = { "markdown", "vimwiki" }, -- markdown extensions (ie. quarto) can go here
      },
      neorg = {
        enabled = true,
        filetypes = { "norg" },
      },
      typst = {
        enabled = true,
        filetypes = { "typst" },
      },
      html = {
        enabled = false,
      },
      css = {
        enabled = false,
      },
    },
    max_width = nil,
    max_height = nil,
    max_width_window_percentage = nil,
    max_height_window_percentage = 50,
    window_overlap_clear_enabled = false,                                             -- toggles images when windows are overlapped
    window_overlap_clear_ft_ignore = { "cmp_menu", "cmp_docs", "snacks_notif", "scrollview", "scrollview_sign" },
    editor_only_render_when_focused = false,                                          -- auto show/hide images when the editor gains/looses focus
    tmux_show_only_in_active_window = false,                                          -- auto show/hide images in the correct Tmux window (needs visual-activity off)
    hijack_file_patterns = { "*.png", "*.jpg", "*.jpeg", "*.gif", "*.webp", "*.avif" }, -- render image files as images when opened
  },
}

I also added the following to my tmux config but the error occurs both inside and outside tmux:

set -gq allow-passthrough on
set -g visual-activity off

The following error occurs whenever open neovim:

Error executing luv callback:
...al/share/nvim/lazy/image.nvim/lua/image/utils/logger.lua:54: 00:41:50.927131 [image.nvim] image: ueberzug died unexpectedly {
  code = 0,
  signal = 6
}
stack traceback:
        [C]: in function 'handler'
        ...al/share/nvim/lazy/image.nvim/lua/image/utils/logger.lua:54: in function 'throw'
        ...are/nvim/lazy/image.nvim/lua/image/backends/ueberzug.lua:18: in function <...are/nvim/lazy/image.nvim/lua/image/backends/ueberzug.lua:15>

JonasKleinebecker avatar Mar 15 '25 23:03 JonasKleinebecker

Try using magick_cli instead of magick_rock as your processor. magick_rock is harder to install/make work anyway, which is why I recommend magick_cli (which you installed with sudo apt install libmagickwand-dev).

Two more things:

  • If you are running this from TTY (highly doubt it), ueberzug++ can't run.
  • I don't see that you configured ueberzug++, you probably need to make that work!

UnaTried avatar Apr 18 '25 20:04 UnaTried

Can be anything, does ueberzugpp work outside of Neovim?

3rd avatar Apr 22 '25 00:04 3rd

Can be anything, does ueberzugpp work outside of Neovim?

I've got similiar problem:

git:(master) ✗ ueberzug layer
terminate called after throwing an instance of 'std::runtime_error'
  what():  Unable to calculate terminal sizes
[1]    20049 IOT instruction (core dumped)  ueberzug layer

zhangfuwen avatar Oct 22 '25 11:10 zhangfuwen