@visulima/ansi
Version:
ANSI escape codes for some terminal swag.
36 lines (33 loc) • 1.55 kB
JavaScript
import { C as CSI } from './packem_shared/constants-CE7WkXh_.mjs';
var __defProp = Object.defineProperty;
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
const keyModifierOptions = /* @__PURE__ */ __name((resource, value) => {
if (resource < 0 || !Number.isInteger(resource)) {
return "";
}
const pp = resource.toString();
if (value !== void 0) {
if (!Number.isInteger(value)) {
return "";
}
const pv = value.toString();
return `${CSI}>${pp};${pv}m`;
}
return `${CSI}>${pp}m`;
}, "keyModifierOptions");
const XTMODKEYS = keyModifierOptions;
const queryKeyModifierOptions = /* @__PURE__ */ __name((resource) => {
if (resource < 0 || !Number.isInteger(resource)) {
return "";
}
const pp = resource.toString();
return `${CSI}?${pp}m`;
}, "queryKeyModifierOptions");
const resetKeyModifierOptions = /* @__PURE__ */ __name((resource) => keyModifierOptions(resource), "resetKeyModifierOptions");
const setKeyModifierOptions = /* @__PURE__ */ __name((resource, value) => keyModifierOptions(resource, value), "setKeyModifierOptions");
const XTQMODKEYS = queryKeyModifierOptions;
const setModifyOtherKeys1 = `${CSI}>4;1m`;
const setModifyOtherKeys2 = `${CSI}>4;2m`;
const resetModifyOtherKeys = `${CSI}>4m`;
const queryModifyOtherKeys = `${CSI}?4m`;
export { XTMODKEYS, XTQMODKEYS, keyModifierOptions, queryKeyModifierOptions, queryModifyOtherKeys, resetKeyModifierOptions, resetModifyOtherKeys, setKeyModifierOptions, setModifyOtherKeys1, setModifyOtherKeys2 };