From a6d60d71159064c9478972d278d1187673646881 Mon Sep 17 00:00:00 2001 From: CatsDeservePets <145048791+CatsDeservePets@users.noreply.github.com> Date: Tue, 7 Apr 2026 19:25:34 +0200 Subject: [PATCH] fix: restore `sixel` output on `Windows` (#2494) Co-authored-by: Joe Lim <50560759+joelim-work@users.noreply.github.com> --- sixel.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sixel.go b/sixel.go index f7098002..5ef5c18e 100644 --- a/sixel.go +++ b/sixel.go @@ -1,7 +1,6 @@ package main import ( - "errors" "fmt" "log" "os" @@ -86,8 +85,7 @@ func (sxs *sixelScreen) printSixel(win *win, screen tcell.Screen, reg *reg) { func cellSize(screen tcell.Screen) (int, int, error) { tty, ok := screen.Tty() if !ok { - // fallback for Windows Terminal - return 10, 20, nil + return -1, -1, fmt.Errorf("failed to get tty") } ws, err := tty.WindowSize() @@ -97,7 +95,8 @@ func cellSize(screen tcell.Screen) (int, int, error) { cw, ch := ws.CellDimensions() if cw <= 0 || ch <= 0 { - return -1, -1, errors.New("cell dimensions should be greater than 0") + // fallback for Windows Terminal + return 10, 20, nil } return cw, ch, nil