image.nvim
image.nvim copied to clipboard
image does not flush on tmux session
- I enabled rendered at cursor, and it work flawlessly when on kitty terminal, but in tmux the image does not flush whatsoever, and will still show the image on every panel then keep spawning this error
- here is my plugin and tmux config:
return {
{
"3rd/image.nvim",
ft = { "markdown", "quarto", "vimwiki" },
dependencies = { "leafo/magick" },
opts = {
integrations = {
markdown = {
clear_in_insert_mode = true,
only_render_image_at_cursor = true,
},
},
html = {
enabled = true,
},
editor_only_render_when_focused = true,
window_overlap_clear_enabled = true, -- auto show/hide images when the editor gains/looses focus
tmux_show_only_in_active_window = true,
},
},
}
set-option -a terminal-features 'xterm-256color:RGB'
set-option -g status-position top
set -gq allow-passthrough on
set -g visual-activity off
set -ga update-environment TERM
set -ga update-environment TERM_PROGRAM
Wasn't able to reproduce this, do you have anything special / shell wrappers / something different going on? Kitty + tmux works ok for me.
Same issue using tmux + kitty, works flawlessly without tmux on wezterm and kitty terminal. I am running it on m1 macbook pro.
Same issue here, running outside of tmux on kitty works fine but with tmux the image stays
Same issue here, works in ghostty (which supports kitty image protocol), but images get stuck with tmux + ghostty.
Update: it seems to not happen in a fresh tmux session, but it was happening in a session I had running for a while. Not sure what was different about that one.
i got the same issue as well. am using leetcode.nvim and have the questions with images rendered on the side, even after closing the buffer and window it is stuck to my terminal on all the tmux sessions and on all my subsequent windows in the same place
I had this problem and setting tmux_show_only_in_active_window = true fixed it.
Any update on this? following the proposed solution by @ficcdaf didn't work for me, as I actually have it set already :/
Same problem here, reproduced with ghostty + tmux and kitty + tmux. Both emulators work fine outside the tmux session.
Can't reproduce on:
โ nvim --version
NVIM v0.11.0-nightly+e4bc8b5
Build type: Release
LuaJIT 2.1.1713773202
Run "nvim -V1 -v" for more info
โ tmux -V
tmux 3.5a
โ kitty --version
kitty 0.38.1
Which versions of Neovim, Tmux and Kitty does this happen with?
The problem was due to nushell. The substitution syntax is different in nushell ๐ข
From /tmp/nvim-image.txt
09:31:29.120661 [image.nvim] write: "\27Ptmux;\27\27_Gq=2,d=i,i=1,a=d\27\27\\\27\\" Error: nu::parser::parse_mismatch_with_did_you_mean
ร Parse mismatch during operation.
โญโ[source:1:20]
1 โ tmux list-panes -t $(tmux display-message -p '#{client_session}') -F '#{pane_tty}' -f '#{pane_active}'
ยท โโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโ
ยท โฐโโ expected valid variable name.
โฐโโโโ
It works fine when I remove my shell option
-- vim.opt.shell = "nu"
In the above screenshot, @fm39hz is using fish. Fish users may experience the same issue because fish also substitute with () instead of $()
I made this PR#267 to resolve the issue
Thank you @crierr!
This issue is still occurring in my environment (kitty+tmux).
I've tried all the suggested configuration options, but the problem persists.
I suspect the root cause is that the FocusLost event doesn't fire when nvim actually loses focus, but rather when focus returns to nvim. I attempted a workaround by executing img:clear() on all displayed images just before leaving the drawing area, but this didn't resolve the issue either.
is anyone still having this issue?
I also have the same problem even with tmux_show_only_in_active_window = true
First, I only have this in my .tmux.conf
set -gq allow-passthrough on
set -g visual-activity off
But when I ran :checkhealth this showed up in tmux section - โ ๏ธ WARNING focus-events is not enabled. |'autoread'| may not work.
So, I added this to my .tmux.conf and everything seem to work fine.
set -gq allow-passthrough on
set -g visual-activity off
set-option -g focus-events on
For me tmux_show_only_in_active_window = true fixed the problem when changing windows, but still occurs in the tmux choose commands
set-option -g focus-events on
This configuration fixed it for me. I should probably be added to the README/docs somewhere