{"record":{"id":"2d70ef20cf74fbc5","repo":"kovidgoyal/kitty","slug":"this-should-be-run-as-kitten-icat","errorCode":null,"errorMessage":"This should be run as kitten icat","messagePattern":"This should be run as kitten icat","errorType":"console","errorClass":"SystemExit","httpStatus":null,"severity":"warning","filePath":"kittens/icat/main.py","lineNumber":193,"sourceCode":"--no-trailing-newline -n\ntype=bool-set\nBy default, the cursor is moved to the next line after displaying an image. This option, prevents that. Should not be used\nwhen catting multiple images. Also has no effect when the :option:`--place` option is used.\n\"\"\"\n\nhelp_text = (\n    'A cat like utility to display images in the terminal.'\n    ' You can specify multiple image files and/or directories.'\n    ' Directories are scanned recursively for image files. If STDIN'\n    ' is not a terminal, image data will be read from it as well.'\n    ' You can also specify HTTP(S) or FTP URLs which will be'\n    ' automatically downloaded and displayed.'\n)\nusage = 'image-file-or-url-or-directory ...'\n\n\nif __name__ == '__main__':\n    raise SystemExit('This should be run as kitten icat')\nelif __name__ == '__doc__':\n    import sys\n\n    from kitty.simple_cli_definitions import CompletionSpec\n\n    cd = sys.cli_docs  # type: ignore\n    cd['usage'] = usage\n    cd['options'] = lambda: OPTIONS.format()\n    cd['help_text'] = help_text\n    cd['short_desc'] = 'Display images in the terminal'\n    cd['args_completion'] = CompletionSpec.from_string('type:file mime:image/* group:Images')\n","sourceCodeStart":175,"sourceCodeEnd":205,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/kittens/icat/main.py#L175-L205","documentation":"send() on the peer socket returned 0 — zero bytes written, which for a stream socket is abnormal — so kitty marks the write failed and discards the queued response. The peer will not receive its reply.","triggerScenarios":"Replying to a peer that has already closed its side (half-closed connection) or a degenerate socket state where send() yields 0; MSG_NOSIGNAL send on a socket in a strange state.","commonSituations":"Client (kitty @ invocation) exiting before the response arrives; timeouts on the client side killing the connection early.","solutions":["Make clients wait for the response before exiting (don't fire-and-forget remote control commands)","Increase client-side timeouts for long operations so the connection stays open for the reply","Ignore the log if the client intentionally hung up early"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Read the full response before exiting a remote-control client","Set adequate client timeouts","Treat dropped replies to hung-up clients as expected"],"tags":["remote-control","sockets","send-failed","kitty"],"backgroundTag":"socket-peer-disconnected","analyzedSha":"6d5d0c440603ad9bdf6dcd599f73f6dde21acb44","analyzedAt":"2026-08-27T14:20:20.142Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}