kovidgoyal/kitty · warning · SystemExit

Must be run as kitten diff

Error message

Must be run as kitten diff

What it means

macOS rejected the notification request kitty submitted via addNotificationRequest (kitty/cocoa_window.m:572). The completion handler receives an NSError whose localizedDescription is logged; the Python callback then receives 'creation_failed'. Common causes are missing authorization or an invalid payload.

Source

Thrown at kittens/diff/main.py:13

#!/usr/bin/env python
# License: GPL v3 Copyright: 2018, Kovid Goyal <kovid at kovidgoyal.net>

import sys
from functools import partial

from kitty.conf.types import Definition
from kitty.constants import appname
from kitty.simple_cli_definitions import CONFIG_HELP, CompletionSpec


def main(args: list[str]) -> None:
    raise SystemExit('Must be run as kitten diff')


definition = Definition(
    '!kittens.diff',
)

agr = definition.add_group
egr = definition.end_group
opt = definition.add_option
map = definition.add_map
mma = definition.add_mouse_map

# diff {{{
agr('diff', 'Diffing')

opt(
    'syntax_aliases',
    'pyj:py pyi:py recipe:py',

View on GitHub (pinned to 6d5d0c4406)

Solutions

  1. Grant kitty notification permission in System Settings > Notifications.
  2. Ensure notifications include a title (macOS requires one): kitten @send-notification --title '...'.
  3. If permission is pending, trigger the permission request once and accept it.
  4. Test with: kitten @send-notification --title test --message hello.

Example fix

# before
kitten @send-notification --message 'done'
# after
kitten @send-notification --title 'Build' --message 'done'
Defensive patterns

Strategy: validation

Validate before calling

kitten @send-notification --title 'always include a title' --message 'body'

Try / catch

# handle the callback result
kitten @send-notification --title t --message m --wait-for-close; echo $?

Prevention

When it happens

Trigger: Sending a desktop notification (kitten @send-notification or OSC 99/777) after authorization was denied or not yet granted, or with content the center rejects (missing/empty title is invalid on macOS).

Common situations: User denied notification permission for kitty, first-run before permission prompt is answered, or a script sending a notification with no title.

Related errors


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