kovidgoyal/kitty · warning · SystemExit

This should be run as kitten icat

Error message

This should be run as kitten icat

What it means

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.

Source

Thrown at kittens/icat/main.py:193

--no-trailing-newline -n
type=bool-set
By default, the cursor is moved to the next line after displaying an image. This option, prevents that. Should not be used
when catting multiple images. Also has no effect when the :option:`--place` option is used.
"""

help_text = (
    'A cat like utility to display images in the terminal.'
    ' You can specify multiple image files and/or directories.'
    ' Directories are scanned recursively for image files. If STDIN'
    ' is not a terminal, image data will be read from it as well.'
    ' You can also specify HTTP(S) or FTP URLs which will be'
    ' automatically downloaded and displayed.'
)
usage = 'image-file-or-url-or-directory ...'


if __name__ == '__main__':
    raise SystemExit('This should be run as kitten icat')
elif __name__ == '__doc__':
    import sys

    from kitty.simple_cli_definitions import CompletionSpec

    cd = sys.cli_docs  # type: ignore
    cd['usage'] = usage
    cd['options'] = lambda: OPTIONS.format()
    cd['help_text'] = help_text
    cd['short_desc'] = 'Display images in the terminal'
    cd['args_completion'] = CompletionSpec.from_string('type:file mime:image/* group:Images')

View on GitHub (pinned to 6d5d0c4406)

Solutions

  1. Make clients wait for the response before exiting (don't fire-and-forget remote control commands)
  2. Increase client-side timeouts for long operations so the connection stays open for the reply
  3. Ignore the log if the client intentionally hung up early
Defensive patterns

Strategy: fallback

Prevention

When it happens

Trigger: 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.

Common situations: Client (kitty @ invocation) exiting before the response arrives; timeouts on the client side killing the connection early.

Related errors


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