From d27eccc61572f2ed99fc9c6640fc61d3b65b2c34 Mon Sep 17 00:00:00 2001 From: Ed Zynda Date: Thu, 4 Jun 2026 14:29:23 +0300 Subject: [PATCH] fix(ui): skip image preview when input width is too small - Return 0 from thumbCols when width <= 6 so a full-size thumbnail is no longer rendered for tiny or uninitialized (width 0) terminals; the caller falls back to the text pill --- internal/ui/input.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/ui/input.go b/internal/ui/input.go index bcc7be80..38ab4b5c 100644 --- a/internal/ui/input.go +++ b/internal/ui/input.go @@ -579,10 +579,10 @@ const ( // thumbCols returns the thumbnail width in terminal cells given the current // input width, or 0 when there is no room to render a preview. func (s *InputComponent) thumbCols() int { - cols := thumbMaxCols - if s.width > 6 && s.width-6 < cols { - cols = s.width - 6 + if s.width <= 6 { + return 0 } + cols := min(thumbMaxCols, s.width-6) if cols < 1 { return 0 }