Comments (18)
@dankamongmen does notcurses do anything special to handle switching panes in tmux?
nope, very little tmux-specific code
from image.nvim.
Yes, it only handles window switching, with a massive hack. In theory it could handle panes as well, need to check.
from image.nvim.
Hey, yes, there's no handling for tmux pane switching yet, but it's on the list!
from image.nvim.
@3rd have you looked into this at all? If you have any info on where to start supporting something like this I'd be more than happy to tackle it.
Starting to grow tired of switching tabs and then having to go back to close an image
If you haven't looked at this at all I'm also happy to look into it, just thought I'd ask first.
from image.nvim.
Couldn't find a way to do it without adding a tmux script, still exploring.
from image.nvim.
@benlubas would it be acceptable to hide/show the images on nvim focus lost/gained? It would also hide them when switching to a different pane in the same window.
from image.nvim.
Yeah my first thought was focus lost/gained, personally I wouldn't have a problem with images disappearing when switching panes but I could see why others might.
I wonder what notcurses does.. maybe we can ask dank
from image.nvim.
I've tried a simple implementation with focus lost, and it's unfortunately not working.
(P()
is a function that prints using vim.inspect)
if state.options.tmux_mode then
local held_images = {}
print("tmux mode")
-- hide all images on focus lost
vim.api.nvim_create_autocmd("FocusLost", {
group = group,
callback = function(_au)
print("focus lost")
vim.schedule(function()
held_images = api.get_images()
P(held_images)
for _, current_image in ipairs(held_images) do
current_image:clear()
end
end)
end,
})
-- re-render on focus gained
vim.api.nvim_create_autocmd("FocusGained", {
group = group,
callback = function(_au)
print("focus gained")
for _, current_image in ipairs(held_images) do
current_image:render()
end
end,
})
end
from image.nvim.
Added a new option editor_only_render_when_focused
in 133926c that should be an ok workaround until we figure something else out ; it's not tied to Tmux in any way, just a general option.
The more advanced way would be to make a plugin for Tmux that sends a message to nvim, either through the remote protocol (would require remote control enabled), by sending keys (yuck), or by writing to a socket file (probably).
I think it's good enough for now.
from image.nvim.
Reopening, doesn't seem to work properly, looking into it.
from image.nvim.
Haha, I beat you to it. That implementation works for focus via window manager, but tmux switching, while it triggers the auto command, doesn't actually clear the image.
from image.nvim.
The Neovim part seems ok, it's a clearing issue, which is better than the events not working. I think it doesn't have time to output the escape codes for clearing.
image-focus.mp4
from image.nvim.
damn
tmux/tmux#3265
tmux/tmux#3274
tmux/tmux#3001
from image.nvim.
@dankamongmen does notcurses do anything special to handle switching panes in tmux?
from image.nvim.
Found a way to do it by finding the active tty for the current tmux session and writing Kitty's clear-all control sequence in that one. It's hacky, but it works. Just needs some changes to make the "restore" work.
from image.nvim.
Linking PR: #45
from image.nvim.
This is now in master
, needs tmux_show_only_in_active_window = true
and set -g visual-activity off
in Tmux 🎉
from image.nvim.
Hi! In the following gif I open a split (pane) I see the image in the pane below (even though I'm using the tmux_show_only_in_active_window
setting):
from image.nvim.
Related Issues (20)
- inline image render overlaps status line
- [Feature Request] Support inline encoded image
- Status line flashing and disapearing when I install this plugin HOT 3
- Get an error with `luarocks.nvim` HOT 3
- Error in image.nvim interpreting allow-passthrough as per the README instructions HOT 1
- Render same image object multiple times HOT 4
- Offset initial image generation position in config settings
- renderer.lua: attempt to index a nil value HOT 1
- Bug: inline images don't account for concealed text or virtual text in the same line HOT 1
- Bug: only one inline-image on each line updates HOT 2
- [feat] Support for zellij HOT 4
- [Bug] Show error when opened the same image for the second time. HOT 5
- Image is not rendered if it's on the first line of the file HOT 1
- [Bug] Image overlap till next line
- Unexpected effect on ext_messages
- Alacritty with Ueberzug in Wayland remains blank HOT 1
- Curl gives an error (maybe related to query string parameters handling?) HOT 1
- [Bug]: Misplacement of pictures HOT 4
- [ADD] Add SVG File preview support (maybe using `cairosvg`?) HOT 3
- Ability to supply headers/modify the http request to fetch remote images HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from image.nvim.