Skip to content

@jsvision/core / setTitle

Function: setTitle()

setTitle(text, caps): string

Defined in: render/osc.ts:76

Emit an OSC 0/2 window-title set. Returns '' when the terminal does not support setting the title.

Parameters

text

string

New window title (sanitized).

caps

CapabilityProfile

Resolved terminal capabilities.

Returns

string

The ANSI string to write to the terminal, or '' if unsupported.

Example

ts
import { setTitle, resolveCapabilities } from '@jsvision/core';
const caps = resolveCapabilities().profile;
process.stdout.write(setTitle('My App — editing report.txt', caps));