From eb4028957d18770ccd8e12c84505d3893585e9d2 Mon Sep 17 00:00:00 2001 From: ayn2op Date: Mon, 19 Oct 2026 00:55:37 -0400 Subject: [PATCH] feat(messageslist): draw kitty images in Rio (#851) --- internal/ui/chat/messageslist/model.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/internal/ui/chat/messageslist/model.go b/internal/ui/chat/messageslist/model.go index 732a67e..5327769 100644 --- a/internal/ui/chat/messageslist/model.go +++ b/internal/ui/chat/messageslist/model.go @@ -25,6 +25,10 @@ import ( "github.com/yuin/goldmark/v2/ast" ) +// placeholderTerminals are the terminals, by XTVERSION name, that draw kitty's Unicode placeholders. +// WezTerm and Konsole support kitty graphics but not Unicode placeholders. +var placeholderTerminals = []string{"kitty", "ghostty", "Rio"} + type messageItem struct { message discord.Message // view is the message as drawn, keeping its wrapped text, or nil until it is shown and after what it shows changes. @@ -557,8 +561,7 @@ func (m Model) Update(msg tview.Msg) (Model, tview.Cmd) { case "halfblocks": m.kitty = false default: - // WezTerm and Konsole support kitty graphics but not Unicode placeholders. - m.kitty = msg.Name == "kitty" || msg.Name == "ghostty" + m.kitty = slices.Contains(placeholderTerminals, msg.Name) } case scrollMsg: m.scrollState = viewport.ScrollState(msg)