{"record":{"id":"619151ea1d298195","repo":"kovidgoyal/kitty","slug":"invalid-size-specification-s-with-error-the-pix-619151","errorCode":null,"errorMessage":"Invalid size specification: %s with error: The pixel height is smaller than the number of rows","messagePattern":"Invalid size specification: (.+?) with error: The pixel height is smaller than the number of rows","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kittens/icat/main.go","lineNumber":219,"sourceCode":"\t\t}\n\t\tscreen_size.Col = uint16(t)\n\t\tif t, err = strconv.ParseUint(parts[1], 10, 16); err != nil || t < 1 {\n\t\t\treturn 1, fmt.Errorf(\"Invalid size specification: %s with error: %w\", opts.UseWindowSize, err)\n\t\t}\n\t\tscreen_size.Row = uint16(t)\n\t\tif t, err = strconv.ParseUint(parts[2], 10, 16); err != nil || t < 1 {\n\t\t\treturn 1, fmt.Errorf(\"Invalid size specification: %s with error: %w\", opts.UseWindowSize, err)\n\t\t}\n\t\tscreen_size.Xpixel = uint16(t)\n\t\tif t, err = strconv.ParseUint(parts[3], 10, 16); err != nil || t < 1 {\n\t\t\treturn 1, fmt.Errorf(\"Invalid size specification: %s with error: %w\", opts.UseWindowSize, err)\n\t\t}\n\t\tscreen_size.Ypixel = uint16(t)\n\t\tif screen_size.Xpixel < screen_size.Col {\n\t\t\treturn 1, fmt.Errorf(\"Invalid size specification: %s with error: The pixel width is smaller than the number of columns\", opts.UseWindowSize)\n\t\t}\n\t\tif screen_size.Ypixel < screen_size.Row {\n\t\t\treturn 1, fmt.Errorf(\"Invalid size specification: %s with error: The pixel height is smaller than the number of rows\", opts.UseWindowSize)\n\t\t}\n\t}\n\n\tif opts.PrintWindowSize {\n\t\tfmt.Printf(\"%dx%d\", screen_size.Xpixel, screen_size.Ypixel)\n\t\treturn 0, nil\n\t}\n\tif 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\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)","sourceCodeStart":201,"sourceCodeEnd":237,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/kittens/icat/main.go#L201-L237","documentation":"Cross-field validation: pixel height (Ypixel) must be at least the row count. The spec's fourth number is smaller than its second number.","triggerScenarios":"--use-window-size=80,24,1920,20 — 20 pixels tall cannot hold 24 rows.","commonSituations":"Swapped rows/pixels; DPI-scaled values mixed with logical rows; stale cached window size after resizing.","solutions":["Make pixel height >= rows (cell_height * rows)","Verify field order COLS,ROWS,XPIXEL,YPIXEL","Recompute sizes after terminal resize instead of caching"],"exampleFix":"// before\n--use-window-size=80,24,1920,20\n// after\n--use-window-size=80,24,1920,1080","handlingStrategy":"validation","validationCode":"if ypixel < rows { log.Fatal(\"pixel height must be >= rows\") }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pixel height must cover all rows","Refresh size spec on window resize events"],"tags":["kitty","icat","window-size","validation"],"backgroundTag":"invalid-cli-argument","analyzedSha":"6d5d0c440603ad9bdf6dcd599f73f6dde21acb44","analyzedAt":"2026-08-27T14:20:20.142Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}