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
This commit is contained in:
Ed Zynda
2026-06-04 14:29:23 +03:00
parent f6a48f4a39
commit d27eccc615
+3 -3
View File
@@ -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
}