@visulima/ansi
Version:
ANSI escape codes for some terminal swag.
34 lines (29 loc) • 1.14 kB
JavaScript
;
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
const constants = require('./packem_shared/constants-BK26O-46.cjs');
var __defProp = Object.defineProperty;
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
const stringToHex = /* @__PURE__ */ __name((input) => {
let hex = "";
for (let index = 0; index < input.length; index += 1) {
const charCode = input.codePointAt(index);
if (charCode === void 0) {
continue;
}
const byteHex = charCode.toString(16).toUpperCase();
hex += byteHex.length === 1 ? `0${byteHex}` : byteHex;
}
return hex;
}, "stringToHex");
const XTGETTCAP = /* @__PURE__ */ __name((...caps) => {
if (caps.length === 0) {
return "";
}
const hexCaps = caps.map((cap) => stringToHex(cap));
return `${constants.DCS}+q${hexCaps.join(constants.SEP)}${constants.ST}`;
}, "XTGETTCAP");
const requestTermcap = XTGETTCAP;
const requestTerminfo = XTGETTCAP;
exports.XTGETTCAP = XTGETTCAP;
exports.requestTermcap = requestTermcap;
exports.requestTerminfo = requestTerminfo;