Terminal
Model
Signature
interface Key {
readonly ctrl: boolean;
readonly meta: boolean;
readonly name: string;
readonly shift: boolean;
}QuitException
Added in v1.0.0
Source
Signature
declare class QuitException extends YieldableError<this> & {
readonly _tag: "QuitException";
} & Readonly<{}> {
constructor(args: void);
}Signature
interface UserInput {
readonly input: Option<string>;
readonly key: Key;
}Models
A Terminal represents a command-line interface which can read input from a user and display messages to a user.
Signature
interface Terminal {
readonly columns: Effect<number>;
readonly display: (text: string) => Effect<void, PlatformError>;
readonly isTTY: Effect<boolean>;
readonly readInput: Effect<ReadonlyMailbox<UserInput>, never, Scope>;
readonly readLine: Effect<string, QuitException>;
readonly rows: Effect<number>;
}Refinements
isQuitException
Added in v1.0.0
Source
Signature
declare function isQuitException(u: unknown): u is QuitException;
A
QuitExceptionrepresents an exception that occurs when a user attempts to quit out of aTerminalprompt for input (usually by enteringctrl+c).