@f5xc-salesdemos/pi-tui 19.28.0 → 19.28.2

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@f5xc-salesdemos/pi-tui",
4
- "version": "19.28.0",
4
+ "version": "19.28.2",
5
5
  "description": "Terminal User Interface library with differential rendering for efficient text-based applications",
6
6
  "homepage": "https://github.com/f5xc-salesdemos/xcsh",
7
7
  "author": "Can Boluk",
@@ -37,8 +37,8 @@
37
37
  "fmt": "biome format --write ."
38
38
  },
39
39
  "dependencies": {
40
- "@f5xc-salesdemos/pi-natives": "19.28.0",
41
- "@f5xc-salesdemos/pi-utils": "19.28.0",
40
+ "@f5xc-salesdemos/pi-natives": "19.28.2",
41
+ "@f5xc-salesdemos/pi-utils": "19.28.2",
42
42
  "marked": "^17.0"
43
43
  },
44
44
  "devDependencies": {
package/src/terminal.ts CHANGED
@@ -134,7 +134,6 @@ export class ProcessTerminal implements Terminal {
134
134
  }
135
135
 
136
136
  start(onInput: (data: string) => void, onResize: () => void): void {
137
- this.#inputHandler = onInput;
138
137
  this.#resizeHandler = onResize;
139
138
 
140
139
  // Register for emergency cleanup
@@ -186,6 +185,13 @@ export class ProcessTerminal implements Terminal {
186
185
  // Start periodic OSC 11 re-query for terminals without Mode 2031
187
186
  // (Warp, Alacritty, WezTerm, iTerm2). Self-disables once Mode 2031 fires.
188
187
  this.#startOsc11Poll();
188
+
189
+ // Defer activating the user input handler until terminal capability
190
+ // queries have settled. Without this, query responses (Kitty, DA1,
191
+ // OSC 11) race into the editor as typed text.
192
+ setTimeout(() => {
193
+ this.#inputHandler = onInput;
194
+ }, 50);
189
195
  }
190
196
 
191
197
  /**
package/src/tui.ts CHANGED
@@ -394,7 +394,18 @@ export class TUI extends Container {
394
394
  start(clearScreen = true): void {
395
395
  this.#stopped = false;
396
396
  this.terminal.start(
397
- data => this.#handleInput(data),
397
+ data => {
398
+ // Guard: drop terminal capability responses that leaked through
399
+ // the terminal's own filters (e.g. after stop/start cycles).
400
+ if (
401
+ /^\x1b\[\?[\d;]*[a-z]$/i.test(data) || // DA1/Kitty: ESC[?...c or ESC[?...u
402
+ /^\x1b\](?:11|10|4);/.test(data) || // OSC color queries
403
+ /^\x1b\[>[\d;]*[a-z]$/i.test(data) // DA2: ESC[>...c
404
+ ) {
405
+ return;
406
+ }
407
+ this.#handleInput(data);
408
+ },
398
409
  () => this.requestRender(),
399
410
  );
400
411
  this.terminal.hideCursor();