appcenter-cli
Version:
Command line tool for Visual Studio App Center
26 lines (25 loc) • 885 B
JavaScript
;
//
// Utilities to deal with the terminal and formatting
//
Object.defineProperty(exports, "__esModule", { value: true });
exports.terminal = void 0;
var terminal;
(function (terminal) {
function columns() {
const stdout = process.stdout; // Need to cast to any to get access to the TTY functions
if (stdout.isTTY) {
return stdout.columns;
}
// Not interactive, default to 80 columns arbitrarily.
return 80;
}
terminal.columns = columns;
// Is this an interactive session or not?
function isInteractive() {
const stdout = process.stdout; // Need to cast to any to get access to the TTY functions
const stdin = process.stdin;
return !!stdin.isTTY && !!stdout.isTTY;
}
terminal.isInteractive = isInteractive;
})(terminal = exports.terminal || (exports.terminal = {}));