kovidgoyal/kitty · critical

Failed to find the kitty executable, this kitten requires th

Error message

Failed to find the kitty executable, this kitten requires the kitty executable to be present. You can use the environment variable KITTY_PATH_TO_KITTY_EXE to specify the path to the kitty executable

What it means

The choose-fonts kitten needs a kitty executable to launch its font-backend subprocess ('kitty +runpy ...') and could not find one: KITTY_PATH_TO_KITTY_EXE is unset, utils.KittyExe() returned empty, and 'kitty' is not on PATH.

Source

Thrown at kittens/choose_fonts/backend.go:38

	to                      io.WriteCloser
	json_decoder            *json.Decoder
	cmd                     *exec.Cmd
	stderr                  strings.Builder
	lock                    sync.Mutex
	r                       io.ReadCloser
	w                       io.WriteCloser
	wait_for_exit           chan error
	started, exited, failed bool
	timeout                 time.Duration
}

func (k *kitty_font_backend_type) start() (err error) {
	exe := utils.KittyExe()
	if exe == "" {
		exe = utils.Which("kitty")
	}
	if exe == "" {
		return fmt.Errorf("Failed to find the kitty executable, this kitten requires the kitty executable to be present. You can use the environment variable KITTY_PATH_TO_KITTY_EXE to specify the path to the kitty executable")
	}

	k.cmd = exec.Command(exe, "+runpy", "from kittens.choose_fonts.backend import main; main()")
	k.cmd.Stderr = &k.stderr

	if k.r, k.to, err = os.Pipe(); err != nil {
		return err
	}
	k.cmd.Stdin = k.r
	if k.from, k.w, err = os.Pipe(); err != nil {
		return err
	}
	k.cmd.Stdout = k.w
	k.json_decoder = json.NewDecoder(k.from)
	if err = k.cmd.Start(); err != nil {
		return err
	}
	k.started = true

View on GitHub (pinned to 6d5d0c4406)

Solutions

  1. Set KITTY_PATH_TO_KITTY_EXE to the full path of the kitty binary
  2. Ensure 'kitty' is on PATH (symlink or add install dir to PATH)
  3. Reinstall/locate kitty: 'which kitty' or check your package manager

Example fix

# before
kitten choose_fonts
# after
export KITTY_PATH_TO_KITTY_EXE=/usr/local/bin/kitty
kitten choose_fonts
Defensive patterns

Strategy: validation

Validate before calling

if os.Getenv("KITTY_PATH_TO_KITTY_EXE") == "" { exe, err := exec.LookPath("kitty"); if err != nil { /* fail fast with clear message */ } }

Prevention

When it happens

Trigger: Calling choose_fonts in an environment where kitty was launched via a renamed binary, a container with kitty libs but no exe on PATH, or KITTY_PATH_TO_KITTY_EXE points nowhere.

Common situations: Custom builds where the binary is not named 'kitty' or not on PATH; SSH/remote sessions with stripped PATH; Nix/GNU Guix style installs needing explicit env vars.

Understand the failure class

Background: "environment variable is not set" and "Missing keys in environment" errors: what missing required env var messages mean and how to fix them — this error's family across 28 libraries.

Related errors


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