roundel
API reference

roundel/terminal

Every export of roundel/terminal, with its signature and doc comment: unicode, AGENTS, interactive, plus 2 types.

Two questions about the terminal that are not colour, and that three packages in the family were each answering by hand (R12).

import { unicode, AGENTS, interactive } from 'roundel/terminal';

Functions

unicode

Whether the terminal can be expected to draw non-ASCII glyphs — is-unicode-supported 2.1.0, condition for condition. Everything but Windows is yes, except the Linux console (TERM=linux), whose font has no ticks; on Windows only the terminals the incumbent names.

function unicode({ env, platform }: Glyphs): boolean;
ParameterType
{ env, platform }Glyphs

Returns boolean

Constants

AGENTS

The variables whose presence says an agent is driving the process — the list burgee/src/agent.ts probes (N12), after @vercel/detect-agent. AI_AGENT is the generic one any agent can set.

const AGENTS: readonly ["AI_AGENT", "CLAUDECODE", "CURSOR_AGENT", "CODEX_THREAD_ID", "GEMINI_CLI"];

interactive

Whether a person can be asked something and be expected to answer.

const interactive: ({ env, isTTY }: Terminal) => boolean;

Interfaces

Glyphs

The slice unicode reads: the environment and the platform, process.platform's spelling.

interface Glyphs {
    env: Record<string, string | undefined>;
    platform?: string;
}

Terminal

The slice of a runtime interactive reads. burgee's and caique's runtimes both satisfy it.

interface Terminal {
    env: Record<string, string | undefined>;
    isTTY: {
        stdin: boolean;
    };
}

On this page