edluffy / hologram.nvim

👻 A cross platform terminal image viewer for Neovim. Extensible and fast, written in Lua and C. Works on macOS and Linux.
MIT License
1.28k stars 31 forks source link

Wezterm support #17

Open adelarsq opened 2 years ago

adelarsq commented 2 years ago

Now that Wezterm has some support for Kitty protocol I am trying to make this to work.

But for me shows this error for the minimal setup:

image

Will be needed something more on the plugin or terminal for this to work?

OmeletWithoutEgg commented 2 years ago

You might need require('hologram').setup {} to prevent the error. However, the protocol support of wezterm seems quite weird... I can't get hologram.nvim work in wezterm.

adelarsq commented 2 years ago

You might need require('hologram').setup {} to prevent the error.

I am already using but no way to make this work. 😢

AnonymouX47 commented 1 year ago

Wezterm's current support for the protocol is still highly experimental.

From my personal experience, most features are either not yet implemented or not correctly implemented.

Support for the iTerm2 image protocol is stable though and might be a better option on Wezterm as soon as it's added here (i.e in hologram.nvim).

optimizasean commented 1 year ago

@OmeletWithoutEgg

As a note, add this to your init.vim (~/.config/nvim/init.vim):

" Install Hologram with Plug
Plug 'edluffy/hologram.nvim'

" Setup Hologram
lua << EOF
require'hologram'.setup{
    auto_display = true -- WIP automatic markdown image display, may be prone to breaking
}
EOF

Will fail first time, once you run PlugUpdate after opening NeoVim then the error should be gone. The parenthesis cause errors for some reason (not a lua specialist here).

It works in WezTerm on macOS but the image renders funky - correct, but on top of things (kind of) and small. Not sure what is wrong with it.

Discovered bug on this png in WezTerm nightly with NeoVim latest: https://github.com/video-dev/hls.js/blob/master/docs/design.md, line 68.

EDIT: Tested across number of images and types. Apparently has different issues for each, not exactly sure of the relation. Errors include: rendering over cursor, rendering at odd sizes (aspect correct, but not source image size or some fixed size), following cursor, overlaying over text, not in location (which is spaced correctly for size of image rendered), and a couple other weird bugs. Potentially could be my environment but I would be very interested in seeing this work for WezTerm.

AnonymouX47 commented 1 year ago

@optimizasean

I would be very interested in seeing this work for WezTerm.

This can only be achieved on WezTerm's end.

See https://github.com/wez/wezterm/issues/986#issuecomment-1120622597