kovidgoyal/kitty · info

Aborted by user!

Error message

Aborted by user!

What it means

While waiting for a terminal clipboard response, the first Esc/Ctrl+C only prints a warning that aborting could spew garbage; a second press aborts with this error. It is deliberate user cancellation of a pending terminal query.

Source

Thrown at kittens/clipboard/legacy.go:222

		return
	}

	esc_count := 0
	lp.OnKeyEvent = func(event *loop.KeyEvent) error {
		if event.MatchesPressOrRepeat("ctrl+c") || event.MatchesPressOrRepeat("esc") {
			if transmitting {
				return nil
			}
			event.Handled = true
			esc_count++
			if esc_count < 2 {
				key := "Esc"
				if event.MatchesPressOrRepeat("ctrl+c") {
					key = "Ctrl+C"
				}
				lp.QueueWriteString(fmt.Sprintf("Waiting for response from terminal, press %s again to abort. This could cause garbage to be spewed to the screen.\r\n", key))
			} else {
				return fmt.Errorf("Aborted by user!")
			}
		}
		return nil
	}

	err = lp.Run()
	if err != nil {
		return
	}
	ds := lp.DeathSignalName()
	if ds != "" {
		fmt.Println("Killed by signal: ", ds)
		lp.KillIfSignalled()
		return
	}
	if len(clipboard_contents) > 0 {
		_, err = os.Stdout.Write(clipboard_contents)
		if err != nil {

View on GitHub (pinned to 6d5d0c4406)

Solutions

  1. No fix needed — intentional abort semantics
  2. If it fires immediately, the terminal query is hanging: check terminal/multiplexer support
  3. Prefer Ctrl+C abort over Esc when possible to avoid screen garbage
Defensive patterns

Strategy: try-catch

Try / catch

err := lp.Run()
if err != nil && err.Error() == "Aborted by user!" { os.Exit(130) }

Prevention

When it happens

Trigger: Pressing Esc or Ctrl+C twice while the clipboard kitten waits for a terminal response.

Common situations: Terminal never responds to the query (hung), user aborts to escape the waiting state.

Related errors


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