UNPKG

@controlplane/cli

Version:

Control Plane Corporation CLI

25 lines 1.09 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.defaultingToMessage = exports.resizeRemoteTerminal = exports.terminalResizeDebounce = void 0; const client_1 = require("../session/client"); const time_1 = require("../util/time"); function terminalResizeDebounce(client, delay = 100) { return (0, time_1.debounce)(() => resizeRemoteTerminal(client), delay); } exports.terminalResizeDebounce = terminalResizeDebounce; function resizeRemoteTerminal(client) { client_1.wire.debug(`<<<<<<< WS Resize Window - Columns: ${process.stdout.columns} Rows: ${process.stdout.rows}`); const message = { type: 'resize', buffer: [], width: process.stdout.columns, height: process.stdout.rows, }; client.send(JSON.stringify(message)); } exports.resizeRemoteTerminal = resizeRemoteTerminal; function defaultingToMessage(type, name) { return `Defaulting to ${type} '${name}' because no ${type} was specified in the command.`; } exports.defaultingToMessage = defaultingToMessage; //# sourceMappingURL=helpers.js.map