fix: restore sixel output on Windows (#2494)

Co-authored-by: Joe Lim <50560759+joelim-work@users.noreply.github.com>
This commit is contained in:
CatsDeservePetsandJoe Lim authored and GitHub committed 2026-04-07 19:25:34 +02:00
1 parent 5bcfc6b80d
commit a6d60d7115
1 file changed
+3 -4
+3 -4
View File
@@ -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