kovidgoyal/kitty · error

Invalid --place specification: %s

Error message

Invalid --place specification: %s

What it means

--place must have the form WIDTHxHEIGHT@LEFTxTOP. This instance fires when no '@' separates the area from the position via strings.Cut.

Source

Thrown at kittens/icat/main.go:124

	case "height":
		fit_mode = fit_height
	case "none", "neither":
		fit_mode = fit_none
	case "both":
		fit_mode = fit_both
	default:
		return fmt.Errorf("unknown fit specification: %#v", opts.Fit)
	}
	return nil
}

func parse_place() (err error) {
	if opts.Place == "" {
		return nil
	}
	area, pos, found := strings.Cut(opts.Place, "@")
	if !found {
		return fmt.Errorf("Invalid --place specification: %s", opts.Place)
	}
	w, h, found := strings.Cut(area, "x")
	if !found {
		return fmt.Errorf("Invalid --place specification: %s", opts.Place)
	}
	l, t, found := strings.Cut(pos, "x")
	if !found {
		return fmt.Errorf("Invalid --place specification: %s", opts.Place)
	}
	place = &Place{}
	place.width, err = strconv.Atoi(w)
	if err != nil {
		return err
	}
	place.height, err = strconv.Atoi(h)
	if err != nil {
		return err
	}

View on GitHub (pinned to 6d5d0c4406)

Solutions

  1. Provide both halves: --place=WxH@LxT, e.g. --place=20x10@3x3
  2. Omit --place to use default centered placement

Example fix

# before
kitty +kitten icat --place=100x100 img.png
# after
kitty +kitten icat --place=100x100@2x2 img.png
Defensive patterns

Strategy: validation

Validate before calling

if _, _, ok := strings.Cut(place, "@"); !ok { return errors.New("--place needs WxH@LxT") }

Prevention

When it happens

Trigger: --place=100x100 (missing @position part entirely).

Common situations: Forgetting the position half of the spec; copying a partial example.

Related errors


AI-assisted analysis of kovidgoyal/kitty@6d5d0c4406 (2026-08-27). Data as JSON: /api/errors/0fdf41d40f6886cb. Report an issue: GitHub.