/** * Terminal cell-width table for the interactive `botmux list` picker. * * This is a CROSS-TERMINAL CONSERVATIVE UPPER BOUND, not a match for any one * terminal: for any real terminal, the width here is >= what that terminal * paints. That direction is what makes the picker safe — the vertical viewport * assumes one session per physical row, so a cell must never render WIDER than * we budgeted (that wraps and pushes the pinned title off the alt-screen). * Over-counting only truncates a cell slightly early; under-counting wraps. * * Width 2 = union of: * - `@xterm/addon-unicode11` wcwidth == 2 (Unicode 11 EAW + then-current emoji; * also what the project's own xterm web terminal paints, see src/worker.ts); * - a pinned Unicode 17.0 Emoji_Presentation set (Unicode 14/15/16/17 emoji * like 🫠🩷🛘🪊 that xterm-11 still scores as 1 but modern terminals paint 2); * - a pinned Unicode 17.0 East_Asian_Width = W/F set (e.g. the trigram block * U+2630..U+2637 ☰, Wide since Unicode 16 — xterm-11 EAW is a decade behind). * Both pinned from official UCD files (not the running Node's \p{…}/EAW) so the * table is identical on every Node regardless of the ICU/Unicode version it * bundles, and does not lag the current Unicode standard. * Width 0 = xterm-11 zero-width set (controls, combining marks, ZWJ, variation * selectors) — checked first, so a combining mark that is also EAW-wide stays 0. * EXCEPTION: the emoji variation selector VS16 (U+FE0F) is given width 1, not 0. * VS16 promotes a preceding default-text glyph to emoji presentation, which a * grapheme-aware terminal paints two wide (❤ + VS16 = ❤️ = 2). The per-code-point * model can't look back, so budgeting 1 for VS16 makes text-base(1)+VS16(1) = 2 * (correct); an already-wide emoji + VS16 over-counts to 3 (safe upper bound). * The text variation selector VS15 (U+FE0E, forces narrow) stays 0. * Per-code-point sum, NO grapheme clustering (a ZWJ family emoji is * 2+0+2+0+2 = 6) — over-counting there is harmless for the no-wrap invariant. * * Cursor-moving controls (Tab, ESC, C0/C1) are NOT handled here — width cannot * express "jump to next tab stop"; cli.ts sanitizes them out of dynamic text * before measuring/printing. * * Flat sorted [start,end,start,end,...] inclusive ranges over U+0000..U+10FFFF; * everything not listed is width 1. DO NOT hand-edit — regenerate with * `node scripts/generate-terminal-width.mjs` when the xterm addon or Node's * Unicode tables bump (test/terminal-width-generated.test.ts guards against drift). */ /** Cell width of a single code point under xterm Unicode 11 (0, 1, or 2). */ export declare function codePointCellWidth(cp: number): 0 | 1 | 2; /** * Display width of a string in terminal cells, matching xterm's * `getStringCellWidth` (per-code-point sum, no grapheme clustering). */ export declare function terminalCellWidth(str: string): number; //# sourceMappingURL=terminal-width.d.ts.map