{"record":{"id":"3b2c4f866c3b59e0","repo":"kovidgoyal/kitty","slug":"aborted-by-user","errorCode":null,"errorMessage":"Aborted by user!","messagePattern":"Aborted by user!","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"info","filePath":"kittens/clipboard/legacy.go","lineNumber":222,"sourceCode":"\t\treturn\n\t}\n\n\tesc_count := 0\n\tlp.OnKeyEvent = func(event *loop.KeyEvent) error {\n\t\tif event.MatchesPressOrRepeat(\"ctrl+c\") || event.MatchesPressOrRepeat(\"esc\") {\n\t\t\tif transmitting {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t\tevent.Handled = true\n\t\t\tesc_count++\n\t\t\tif esc_count < 2 {\n\t\t\t\tkey := \"Esc\"\n\t\t\t\tif event.MatchesPressOrRepeat(\"ctrl+c\") {\n\t\t\t\t\tkey = \"Ctrl+C\"\n\t\t\t\t}\n\t\t\t\tlp.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))\n\t\t\t} else {\n\t\t\t\treturn fmt.Errorf(\"Aborted by user!\")\n\t\t\t}\n\t\t}\n\t\treturn nil\n\t}\n\n\terr = lp.Run()\n\tif err != nil {\n\t\treturn\n\t}\n\tds := lp.DeathSignalName()\n\tif ds != \"\" {\n\t\tfmt.Println(\"Killed by signal: \", ds)\n\t\tlp.KillIfSignalled()\n\t\treturn\n\t}\n\tif len(clipboard_contents) > 0 {\n\t\t_, err = os.Stdout.Write(clipboard_contents)\n\t\tif err != nil {","sourceCodeStart":204,"sourceCodeEnd":240,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/kittens/clipboard/legacy.go#L204-L240","documentation":"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.","triggerScenarios":"Pressing Esc or Ctrl+C twice while the clipboard kitten waits for a terminal response.","commonSituations":"Terminal never responds to the query (hung), user aborts to escape the waiting state.","solutions":["No fix needed — intentional abort semantics","If it fires immediately, the terminal query is hanging: check terminal/multiplexer support","Prefer Ctrl+C abort over Esc when possible to avoid screen garbage"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"err := lp.Run()\nif err != nil && err.Error() == \"Aborted by user!\" { os.Exit(130) }","preventionTips":["Educate users that double Esc/Ctrl+C aborts waiting","If queries hang often, investigate terminal support rather than aborting"],"tags":["kitty","clipboard","user-cancellation","esc"],"backgroundTag":"user-cancelled-operation","analyzedSha":"6d5d0c440603ad9bdf6dcd599f73f6dde21acb44","analyzedAt":"2026-08-27T14:20:20.142Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}