3rd / image.nvim

🖼️ Bringing images to Neovim.
MIT License
1.16k stars 51 forks source link

Image still visible when switching to another tmux window #226

Open paulwyszynski opened 1 month ago

paulwyszynski commented 1 month ago

Hi,

I know this one was fixed previously, but I have the same issue with:

Tmux 3.5
Nvim 0.10.1
Kitty 0.35.2

I have also the following settings in my neovim config. It should also hide when cursor is moved off of image, but the image is rendered forever. It gets only cleared after I detach and reattach to my tmux session.

return {
  {
    "vhyrro/luarocks.nvim",
    priority = 1001, -- this plugin needs to run before anything else
    opts = {
      rocks = { "magick" },
    },
  },
  {
    "3rd/image.nvim",
    opts = {
      integrations = {
        markdown = {
          clear_in_insert_mode = true,
          only_render_image_at_cursor = true,
        },
      },
      html = {
        enabled = true,
      },
      css = {
        enabled = true,
      },
      max_width_window_percentage = 50,
      tmux_show_only_in_active_window = true,
    },
  },
}

My tmux.conf

# Image.nvim specific settings
set -g visual-activity off
set -gq allow-passthrough on
xuwei152 commented 1 month ago

I have the same issue. "tmux_show_only_in_active_window = true," does not work. I changed default options in the lua/image/init.lua directly and it works.

image

paulwyszynski commented 1 month ago

You mean here: ~/.local/share/nvim/lazy/image.nvim/lua/image? That didn't help either on my side. Did you kill tmux server, too?

xuwei152 commented 1 month ago

No, I didn't kill tmux server.

paulwyszynski commented 1 month ago

Actually same with 3.5a I figured out, that this only happens if you have more than one tmux windows in a session and try to render images in markdown files at tmux window index > 1...

paulwyszynski commented 1 month ago

I guess the solution is the following if you're using kitty:

Start a new session. Credits to YT

3rd commented 3 weeks ago

@xuwei152 Hey, tried to debug why the tmux_show_only_in_active_window option didn't work, do you have more details? It should do the same as setting it directly.