Skip to content

@jsvision/core / notify

Function: notify()

notify(title, body, caps): string

Defined in: render/osc.ts:108

Emit a desktop notification via the first protocol the terminal supports (Kitty, iTerm2, urxvt, or Windows Terminal/ConEmu), falling back to a single bell when none is available. Title and body are sanitized, so an embedded escape cannot open a second sequence.

Parameters

title

string

Notification title (sanitized).

body

string

Notification body (sanitized).

caps

CapabilityProfile

Resolved terminal capabilities.

Returns

string

The ANSI string to write to the terminal.

Example

ts
import { notify, resolveCapabilities } from '@jsvision/core';
const caps = resolveCapabilities().profile;
process.stdout.write(notify('Build finished', 'All tests passed', caps));