@vincemakes/kiso-tui 0.32.0 → 0.32.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/compositor.js +20 -1
- package/dist/editor.js +12 -3
- package/package.json +2 -2
package/dist/compositor.js
CHANGED
|
@@ -57,6 +57,7 @@ import { atPanelRows, bandHeader } from "./at-picker.js";
|
|
|
57
57
|
import { sessionPickerRows } from "./session-picker.js";
|
|
58
58
|
import { CAP_PREVIEW, thinkingRow, Container, MOTION_FRAMES, MdStream, bodySpacing, boxBottom, boxTop, cellComponent, gutterCut, cutLine, pendingQueueRows, statusLine, visibleWidth, breathFrame, } from "./components.js";
|
|
59
59
|
import { bannerLines, escapeTerminal, foldResult, foldThinking, palette, renderTerminalGap, renderToolSummary } from "./lines.js";
|
|
60
|
+
import { oneRow } from "@vincemakes/kiso-tui-cells/render";
|
|
60
61
|
import { displayVerb, keysSheetRows } from "./strings.js";
|
|
61
62
|
/** DC-56: does a rendered row carry any visible text once its SGR is
|
|
62
63
|
* stripped? A washed pad row is spaces under a background colour — width
|
|
@@ -2638,6 +2639,8 @@ export class Body {
|
|
|
2638
2639
|
* CRASH with the diagnostic, never a silent truncate. */
|
|
2639
2640
|
/** DC-48 — the field cut is announced ONCE per session. */
|
|
2640
2641
|
#cutOnce = false;
|
|
2642
|
+
/** HF-1: the ①b notice, once per session (the same discipline as #cutOnce). */
|
|
2643
|
+
#breakOnce = false;
|
|
2641
2644
|
#checked(line, W) {
|
|
2642
2645
|
// Invariant ①b (R3f): a ROW IS ONE PHYSICAL ROW.
|
|
2643
2646
|
//
|
|
@@ -2663,7 +2666,23 @@ export class Body {
|
|
|
2663
2666
|
// (it moves the cursor to column 1).
|
|
2664
2667
|
const bad = /[\n\r]/.exec(line);
|
|
2665
2668
|
if (bad !== null) {
|
|
2666
|
-
|
|
2669
|
+
// HF-1 (0.32.1): the SAME ruling as the width half below. This
|
|
2670
|
+
// threw in the field on a heredoc shell command (the running
|
|
2671
|
+
// card's head carried the model's newlines) and the owner's
|
|
2672
|
+
// session died with it. Under test the crash keeps its teeth;
|
|
2673
|
+
// in the field the break is projected to ⏎ — the row goes out
|
|
2674
|
+
// as one row — and a notice says so once. The builders project
|
|
2675
|
+
// first (tui-cells `oneRow`), so this branch is the net under
|
|
2676
|
+
// the net: a builder nobody has found yet costs a mark, not a
|
|
2677
|
+
// session.
|
|
2678
|
+
const why = `kiso-tui invariant ①b violated: a row containing ${JSON.stringify(bad[0])} was about to be emitted — a row must be ONE physical row, and the width check cannot see this (charWidth counts a newline as one cell) — ${JSON.stringify(line.slice(0, 80))}`;
|
|
2679
|
+
if (process.env.KISO_INVARIANTS === "throw")
|
|
2680
|
+
throw new Error(why);
|
|
2681
|
+
if (!this.#breakOnce) {
|
|
2682
|
+
this.#breakOnce = true;
|
|
2683
|
+
queueMicrotask(() => this.notice("kiso-tui: a row carried a line break and was shown as one row (invariant ①b) · please report"));
|
|
2684
|
+
}
|
|
2685
|
+
line = oneRow(line);
|
|
2667
2686
|
}
|
|
2668
2687
|
const w = visibleWidth(line);
|
|
2669
2688
|
if (w > W) {
|
package/dist/editor.js
CHANGED
|
@@ -1419,7 +1419,16 @@ export class Editor {
|
|
|
1419
1419
|
}
|
|
1420
1420
|
i += 1;
|
|
1421
1421
|
}
|
|
1422
|
-
else if (c === "\x0f") {
|
|
1422
|
+
else if (c === "\x0f" && !this.#pasting) {
|
|
1423
|
+
// DC-58 (0.32.1): this branch and the two below take `!#pasting`,
|
|
1424
|
+
// the guard tab and CR already had — inside a paste a control byte
|
|
1425
|
+
// is content or nothing, never a gesture. Unguarded, a pasted BEL
|
|
1426
|
+
// opened $VISUAL mid-paste and the rest of the body went to that
|
|
1427
|
+
// child's stdin: DC-7's rule from the third side (a byte from a
|
|
1428
|
+
// paste is data the human handed over, as a reply's byte is the
|
|
1429
|
+
// terminal's). Unclaimed control bytes were discarded already;
|
|
1430
|
+
// now the claimed ones fall to the same discard while pasting.
|
|
1431
|
+
//
|
|
1423
1432
|
// W15: the expand key — rides the chain like a command, the
|
|
1424
1433
|
// editor just forwards it.
|
|
1425
1434
|
//
|
|
@@ -1436,7 +1445,7 @@ export class Editor {
|
|
|
1436
1445
|
cb();
|
|
1437
1446
|
i += 1;
|
|
1438
1447
|
}
|
|
1439
|
-
else if (c === "\x14") {
|
|
1448
|
+
else if (c === "\x14" && !this.#pasting) {
|
|
1440
1449
|
// §2.3 — ctrl+t folds the committed thinking blocks, and
|
|
1441
1450
|
// folds them back. `\x14` was unbound across the tree
|
|
1442
1451
|
// (checked before the round), and it is the key the
|
|
@@ -1449,7 +1458,7 @@ export class Editor {
|
|
|
1449
1458
|
cb();
|
|
1450
1459
|
i += 1;
|
|
1451
1460
|
}
|
|
1452
|
-
else if (c === "\x07") {
|
|
1461
|
+
else if (c === "\x07" && !this.#pasting) {
|
|
1453
1462
|
// §2.4 — ctrl+g opens $VISUAL / $EDITOR on the composer.
|
|
1454
1463
|
//
|
|
1455
1464
|
// 0x07 is BEL, which is also the terminator a terminal puts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vincemakes/kiso-tui",
|
|
3
|
-
"version": "0.32.
|
|
3
|
+
"version": "0.32.1",
|
|
4
4
|
"description": "kiso tui — the pure terminal layer (cell renderer, dock, raw editor, diff, palette). Zero runtime dependencies: input is data, output is bytes.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -35,6 +35,6 @@
|
|
|
35
35
|
},
|
|
36
36
|
"homepage": "https://github.com/vincemakes/kiso/tree/main/packages/tui#readme",
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@vincemakes/kiso-tui-cells": "0.32.
|
|
38
|
+
"@vincemakes/kiso-tui-cells": "0.32.1"
|
|
39
39
|
}
|
|
40
40
|
}
|