@f5xc-salesdemos/pi-tui 14.6.2 → 15.0.0

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.
Files changed (2) hide show
  1. package/package.json +3 -3
  2. package/src/tui.ts +5 -5
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@f5xc-salesdemos/pi-tui",
4
- "version": "14.6.2",
4
+ "version": "15.0.0",
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": "14.6.2",
41
- "@f5xc-salesdemos/pi-utils": "14.6.2",
40
+ "@f5xc-salesdemos/pi-natives": "15.0.0",
41
+ "@f5xc-salesdemos/pi-utils": "15.0.0",
42
42
  "marked": "^17.0"
43
43
  },
44
44
  "devDependencies": {
package/src/tui.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  */
4
4
  import * as fs from "node:fs";
5
5
  import * as path from "node:path";
6
- import { getCrashLogPath, getDebugLogPath } from "@f5xc-salesdemos/pi-utils";
6
+ import { $flag, getCrashLogPath, getDebugLogPath } from "@f5xc-salesdemos/pi-utils";
7
7
  import { isKeyRelease, matchesKey } from "./keys";
8
8
  import type { Terminal } from "./terminal";
9
9
  import { ImageProtocol, setCellDimensions, setTerminalImageProtocol, TERMINAL } from "./terminal-capabilities";
@@ -228,8 +228,8 @@ export class TUI extends Container {
228
228
  #sixelProbeBuffer = "";
229
229
  #sixelProbeTimeout?: NodeJS.Timeout;
230
230
  #sixelProbeUnsubscribe?: () => void;
231
- #showHardwareCursor = process.env.PI_HARDWARE_CURSOR === "1";
232
- #clearOnShrink = process.env.PI_CLEAR_ON_SHRINK === "1"; // Clear empty rows when content shrinks (default: off)
231
+ #showHardwareCursor = $flag("PI_HARDWARE_CURSOR");
232
+ #clearOnShrink = $flag("PI_CLEAR_ON_SHRINK"); // Clear empty rows when content shrinks (default: off)
233
233
  #maxLinesRendered = 0; // High-water line count used for clear-on-shrink policy
234
234
  #fullRedrawCount = 0;
235
235
  #stopped = false;
@@ -1035,7 +1035,7 @@ export class TUI extends Container {
1035
1035
  this.#previousHeight = height;
1036
1036
  };
1037
1037
 
1038
- const debugRedraw = process.env.PI_DEBUG_REDRAW === "1";
1038
+ const debugRedraw = $flag("PI_DEBUG_REDRAW");
1039
1039
  const logRedraw = (reason: string): void => {
1040
1040
  if (!debugRedraw) return;
1041
1041
  const logPath = getDebugLogPath();
@@ -1246,7 +1246,7 @@ export class TUI extends Container {
1246
1246
 
1247
1247
  buffer += "\x1b[?2026l"; // End synchronized output
1248
1248
 
1249
- if (process.env.PI_TUI_DEBUG === "1") {
1249
+ if ($flag("PI_TUI_DEBUG")) {
1250
1250
  const debugDir = "/tmp/tui";
1251
1251
  fs.mkdirSync(debugDir, { recursive: true });
1252
1252
  const debugPath = path.join(debugDir, `render-${Date.now()}-${Math.random().toString(36).slice(2)}.log`);