{"record":{"id":"b16265724a28f86a","repo":"kovidgoyal/kitty","slug":"terminal-does-not-support-reporting-screen-sizes-i","errorCode":null,"errorMessage":"Terminal does not support reporting screen sizes in pixels, use a terminal such as kitty, WezTerm, Konsole, etc. that does.","messagePattern":"Terminal does not support reporting screen sizes in pixels, use a terminal such as kitty, WezTerm, Konsole, etc\\. that does\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kittens/icat/main.go","lineNumber":249,"sourceCode":"\t\t\treturn 1, err\n\t\t}\n\t}\n\tswitch {\n\tcase opts.ClearAll:\n\t\tcc := &graphics.GraphicsCommand{}\n\t\tcc.SetAction(graphics.GRT_action_delete).SetDelete(graphics.GRT_free_by_range).SetLeftEdge(0).SetTopEdge(math.MaxUint32)\n\t\tif err = cc.WriteWithPayloadTo(os.Stdout, nil); err != nil {\n\t\t\treturn 1, err\n\t\t}\n\tcase opts.Clear:\n\t\tcc := &graphics.GraphicsCommand{}\n\t\tcc.SetAction(graphics.GRT_action_delete).SetDelete(graphics.GRT_free_visible)\n\t\tif err = cc.WriteWithPayloadTo(os.Stdout, nil); err != nil {\n\t\t\treturn 1, err\n\t\t}\n\t}\n\tif screen_size.Xpixel == 0 || screen_size.Ypixel == 0 {\n\t\treturn 1, fmt.Errorf(\"Terminal does not support reporting screen sizes in pixels, use a terminal such as kitty, WezTerm, Konsole, etc. that does.\")\n\t}\n\n\titems, err := process_dirs(args...)\n\tif err != nil {\n\t\treturn 1, err\n\t}\n\tif opts.Place != \"\" && len(items) > 1 {\n\t\treturn 1, fmt.Errorf(\"The --place option can only be used with a single image, not %d\", len(items))\n\t}\n\tfiles_channel = make(chan input_arg, len(items))\n\tfor i, ia := range items {\n\t\tia.index = i\n\t\tfiles_channel <- ia\n\t}\n\tnum_of_items = len(items)\n\toutput_channel = make(chan *image_data, 1)\n\tkeep_going = &atomic.Bool{}\n\tkeep_going.Store(true)","sourceCodeStart":231,"sourceCodeEnd":267,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/kittens/icat/main.go#L231-L267","documentation":"icat needs the terminal window size in pixels to place/scale images. The resolved screen size reports 0 pixels in width or height, meaning the terminal (or its queries) did not supply pixel dimensions.","triggerScenarios":"Running kitten icat inside tmux/screen or a plain VT that answers TIOCGWINSZ with ws_xpixel/ws_ypixel = 0, or --use-window-size with pixel fields ending as 0 after some code path.","commonSituations":"tmux without proper TIOCGWINSZ passthrough; SSH into a legacy terminal; running under a non-graphics-protocol terminal multiplexer.","solutions":["Run directly in kitty, WezTerm, or Konsole","If under tmux, set tmux to pass through the window size (terminal-overrides / latest tmux) or detach","Verify with kitty +kitten icat --print-window-size that a non-zero pixel size is reported"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"out, err := exec.Command(\"kitty\",\"+kitten\",\"icat\",\"--print-window-size\").Output()\n// parse WxH; if either is 0, fall back to sixel/ascii or abort","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Check pixel size with --print-window-size before scripting icat","Avoid running icat through tmux/screen without passthrough config"],"tags":["kitty","icat","terminal-support","pixels"],"backgroundTag":"terminal-capability-unsupported","analyzedSha":"6d5d0c440603ad9bdf6dcd599f73f6dde21acb44","analyzedAt":"2026-08-27T14:20:20.142Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}