Deno.isatty(rid: number) : boolean
检查给定的资源ID(rid)是否为TTY。
Check if a given resource id (rid) is a TTY.
rid : number
rid : number
boolean
boolean
// 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
Deno.close(nonTTYRid);
Deno.close(ttyRid);
无
No