Skip to main content
Deno.isatty - Deno documentation
function Deno.isatty
isatty(rid: number): boolean
Deprecated

This will be soft-removed in Deno 2.0. See the Deno 1.x to 2.x Migration Guide for migration instructions.

Check if a given resource id (rid) is a TTY (a terminal).

// This example is system and context specific
const nonTTYRid = Deno.openSync("my_file.txt").rid;
const ttyRid = Deno.openSync("/dev/tty6").rid;
console.log(Deno.isatty(nonTTYRid)); // false
console.log(Deno.isatty(ttyRid)); // true

Parameters

rid: number

Return Type

boolean