{"record":{"id":"c59200995f66f5af","repo":"kovidgoyal/kitty","slug":"the-place-option-can-only-be-used-with-a-single","errorCode":null,"errorMessage":"The --place option can only be used with a single image, not %d","messagePattern":"The --place option can only be used with a single image, not (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kittens/icat/main.go","lineNumber":257,"sourceCode":"\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)\n\tif !opts.DetectSupport && num_of_items > 0 {\n\t\tnum_workers := utils.Max(1, utils.Min(num_of_items, runtime.NumCPU()))\n\t\tfor range num_workers {\n\t\t\tgo run_worker()\n\t\t}\n\t}\n\n\tpassthrough_mode := no_passthrough","sourceCodeStart":239,"sourceCodeEnd":275,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/kittens/icat/main.go#L239-L275","documentation":"The --place option positions one image at a specific grid cell, so it only makes sense with exactly one image. It was given while more than one image (after directory expansion) was being displayed.","triggerScenarios":"kitten icat --place 3x2@2x1 img1.png img2.png, or passing a directory containing multiple images with --place.","commonSituations":"Globbing a directory (icat expands directories to their images); shell expanding *.png into several files.","solutions":["Pass a single image file with --place","Drop --place when displaying multiple images (use --grid instead)","If a directory was passed, ensure it contains exactly one image"],"exampleFix":"// before\nkitten icat --place 3x2@2x1 ./imgs/\n// after\nkitten icat --place 3x2@2x1 ./imgs/only.png","handlingStrategy":"validation","validationCode":"files, _ := filepath.Glob(pattern)\nif place != \"\" && len(files) > 1 { log.Fatal(\"--place requires exactly one image\") }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Expand globs/directories yourself before invoking icat","Use --place only with a single explicit file"],"tags":["kitty","icat","cli-args","image-placement"],"backgroundTag":"invalid-cli-argument","analyzedSha":"6d5d0c440603ad9bdf6dcd599f73f6dde21acb44","analyzedAt":"2026-08-27T14:20:20.142Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}