Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/image.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Terminal support:
- [wezterm](https://wezfurlong.org/wezterm/)
Wezterm has only limited support for the kitty graphics protocol.
Inline image rendering is not supported.
- [warp](https://www.warp.dev/)
- [tmux](https://github.com/tmux/tmux)
Snacks automatically tries to enable `allow-passthrough=on` for tmux,
but you may need to enable it manually in your tmux configuration.
Expand Down
6 changes: 3 additions & 3 deletions lua/snacks/image/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ local M = setmetatable({}, {
})

M.meta = {
desc = "Image viewer using Kitty Graphics Protocol, supported by `kitty`, `wezterm` and `ghostty`",
desc = "Image viewer using Kitty Graphics Protocol, supported by `kitty`, `wezterm`, `ghostty` and `warp`",
needs_setup = true,
}

Expand Down Expand Up @@ -308,7 +308,7 @@ function M.health()
vim.wait(1500, function()
return detected
end, 10)
Snacks.health.have_tool({ "kitty", "wezterm", "ghostty" })
Snacks.health.have_tool({ "kitty", "wezterm", "ghostty", "warp" })
local is_win = jit.os:find("Windows")
if not Snacks.health.have_tool({ "magick", not is_win and "convert" or nil }) then
Snacks.health.error("`magick` is required to convert images. Only PNG files will be displayed.")
Expand Down Expand Up @@ -374,7 +374,7 @@ function M.health()
Snacks.health.warn("image viewer is enabled with `opts.force = true`. Use at your own risk")
else
Snacks.health.error("your terminal does not support the kitty graphics protocol")
Snacks.health.info("supported terminals: `kitty`, `wezterm`, `ghostty`")
Snacks.health.info("supported terminals: `kitty`, `wezterm`, `ghostty`, `warp`")
end
end

Expand Down
6 changes: 6 additions & 0 deletions lua/snacks/image/terminal.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ local environments = {
supported = true,
placeholders = false,
},
{
name = "warp",
env = { TERM_PROGRAM = "WarpTerminal" },
supported = true,
placeholders = false,
},
{
name = "tmux",
env = { TERM = "tmux", TMUX = true },
Expand Down