From 7c5f38d06afc4041261379ce69fa5df2442ea24e Mon Sep 17 00:00:00 2001 From: Rose Hogenson Date: Thu, 28 May 2026 16:48:49 -0700 Subject: Change to block24 mode by default This will have better compatibility, e.g. with tmux. I also added handling for when Xpixel and Ypixel are zero. --- icat.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/icat.go b/icat.go index a1922f1..a8768b3 100644 --- a/icat.go +++ b/icat.go @@ -22,7 +22,7 @@ import ( var ( x = flag.Int("x", 0, "set image width in columns") y = flag.Int("y", 0, "set image height in rows") - m = flagPrintMode(flag.CommandLine, "m", modeSixel, "one of 'block', 'block24', or 'sixel'") + m = flagPrintMode(flag.CommandLine, "m", modeBlock24, "one of 'block', 'block24', or 'sixel'") ) type printMode int @@ -134,6 +134,9 @@ func icat(args []string) error { lines = int(ws.Row) lines-- // Leave a line for the status bar. cellX, cellY := int(ws.Xpixel)/int(ws.Col), int(ws.Ypixel)/int(ws.Row) + if cellX == 0 && cellY == 0 { + cellX, cellY = 10, 20 + } if *m == modeSixel { cols *= cellX lines *= cellY -- cgit v1.3.1