From 4eedac3604dad9f366d28868077eb02eddc22661 Mon Sep 17 00:00:00 2001 From: Asher Gomez Date: Wed, 24 Jan 2024 10:01:56 +1100 Subject: feat: `Deno.{stdin,stdout,stderr}.isTerminal()`, deprecate `Deno.isatty()` (#22011) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This change: 1. Implements `Deno.stdin.isTerminal()`, `Deno.stdout.isTerminal()` and `Deno.stderr.isTerminal()`. 2. Deprecates `Deno.isatty()` for removal in Deno v2, in favour of the above instance methods. 3. Replaces use of `Deno.isatty()` with the above instance methods. Related #21995 --------- Co-authored-by: Bartek IwaƄczuk Co-authored-by: Divy Srivastava --- cli/tests/unit/tty_test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cli/tests/unit') diff --git a/cli/tests/unit/tty_test.ts b/cli/tests/unit/tty_test.ts index f6dc33b6a..8ca9a5d5b 100644 --- a/cli/tests/unit/tty_test.ts +++ b/cli/tests/unit/tty_test.ts @@ -4,7 +4,7 @@ import { assert } from "./test_util.ts"; // Note tests for Deno.stdin.setRaw is in integration tests. Deno.test(function consoleSize() { - if (!Deno.isatty(Deno.stdout.rid)) { + if (!Deno.stdout.isTerminal()) { return; } const result = Deno.consoleSize(); -- cgit v1.2.3