Skip to main content
The Deno 2 Release Candidate is here
Learn more
Latest
function $consoleSize.consoleSizeViaSTTY
import { $consoleSize } from "https://deno.land/x/dxx@rf/src/lib/$locals.ts";
const { consoleSizeViaSTTY } = $consoleSize;

Get the size of the console as columns/rows, using the stty shell command.

const { columns, rows } = await consoleSizeViaSTTY();

Returns

Promise<ConsoleSize | undefined>