kovidgoyal/kitty · info

canceled by user

Error message

canceled by user

What it means

The choose_fonts kitten handler returns this error when the user presses ctrl+c, aborting the font chooser. It is the deliberate user-cancellation signal, not a bug.

Source

Thrown at kittens/choose_fonts/ui.go:204

	redraw_needed := false
	if h.mouse_state.UpdateState(event) {
		redraw_needed = true
	}
	if event.Event_type == loop.MOUSE_CLICK && event.Buttons&loop.LEFT_MOUSE_BUTTON != 0 {
		if err = h.mouse_state.ClickHoveredRegions(); err != nil {
			return
		}
	}
	if redraw_needed && rc == h.render_count {
		err = h.draw_screen()
	}
	return
}

func (h *handler) on_key_event(event *loop.KeyEvent) (err error) {
	if event.MatchesPressOrRepeat("ctrl+c") {
		event.Handled = true
		return fmt.Errorf("canceled by user")
	}
	if h.current_pane != nil {
		err = h.current_pane.on_key_event(event)
	}
	return
}

func (h *handler) on_text(text string, from_key_event bool, in_bracketed_paste bool) (err error) {
	if h.current_pane != nil {
		err = h.current_pane.on_text(text, from_key_event, in_bracketed_paste)
	}
	return
}

func (h *handler) on_escape_code(etype loop.EscapeCodeType, payload []byte) error {
	switch etype {
	case loop.APC:
		gc := graphics.GraphicsCommandFromAPC(payload)

View on GitHub (pinned to 6d5d0c4406)

Solutions

  1. No fix needed; it is intentional cancellation behavior
  2. If cancellation should be quieter, handle this error at the caller and exit gracefully
Defensive patterns

Strategy: try-catch

Try / catch

err := h.on_key_event(ev)
if err != nil && err.Error() == "canceled by user" { os.Exit(130) } // standard SIGINT exit code

Prevention

When it happens

Trigger: Pressing ctrl+c while the choose_fonts kitten UI is focused.

Common situations: User exiting the font chooser to abort without applying a font.

Related errors


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