@f5-sales-demo/pi-tui 23.9.5 → 23.10.3

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/README.md CHANGED
@@ -416,7 +416,7 @@ const spacer = new Spacer(2); // 2 empty lines (default: 1)
416
416
 
417
417
  ### Image
418
418
 
419
- Renders images inline for terminals that support the Kitty graphics protocol (Kitty, Ghostty, WezTerm) or iTerm2 inline images. Falls back to a text placeholder on unsupported terminals.
419
+ Renders images inline for terminals that support the Kitty graphics protocol (Kitty, Ghostty, WezTerm) or iTerm2 inline images. Falls back to a text placeholder on unsupported terminals. Inside Herdr, images require the server-provided `HERDR_KITTY_GRAPHICS=1` capability. Disabling graphics in Herdr selects the text fallback even when the outer terminal supports images.
420
420
 
421
421
  ```typescript
422
422
  interface ImageTheme {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@f5-sales-demo/pi-tui",
4
- "version": "23.9.5",
4
+ "version": "23.10.3",
5
5
  "description": "Terminal User Interface library with differential rendering for efficient text-based applications",
6
6
  "homepage": "https://github.com/f5-sales-demo/xcsh",
7
7
  "author": "Can Boluk",
@@ -37,8 +37,8 @@
37
37
  "fmt": "biome format --write ."
38
38
  },
39
39
  "dependencies": {
40
- "@f5-sales-demo/pi-natives": "23.9.5",
41
- "@f5-sales-demo/pi-utils": "23.9.5",
40
+ "@f5-sales-demo/pi-natives": "23.10.3",
41
+ "@f5-sales-demo/pi-utils": "23.10.3",
42
42
  "marked": "18.0.11"
43
43
  },
44
44
  "devDependencies": {
@@ -231,7 +231,12 @@ export function resolveTerminalId(env: NodeJS.ProcessEnv): TerminalId {
231
231
  export function resolveTerminalInfo(env: NodeJS.ProcessEnv, stdoutIsTTY: boolean): TerminalInfo {
232
232
  const terminal = getTerminalInfo(resolveTerminalId(env));
233
233
  const hyperlinks = shouldEnableTerminalHyperlinks(env, stdoutIsTTY, terminal.id);
234
- const forcedImageProtocol = getForcedImageProtocol(env);
234
+ let forcedImageProtocol = getForcedImageProtocol(env);
235
+ if (isInsideHerdr(env)) {
236
+ // Herdr owns graphics delivery. Inherited host hints cannot override its opt-out.
237
+ if (!stdoutIsTTY || !hasHerdrKittyGraphics(env)) forcedImageProtocol = null;
238
+ else if (forcedImageProtocol === undefined) forcedImageProtocol = ImageProtocol.Kitty;
239
+ }
235
240
  if (forcedImageProtocol !== undefined) {
236
241
  return new TerminalInfo(
237
242
  terminal.id,
package/src/tui.ts CHANGED
@@ -8,7 +8,7 @@ import { isKeyRelease, matchesKey } from "./keys";
8
8
  import { type MouseRoutable, routeSgrMouseInput } from "./mouse";
9
9
  import { setAlternateScreenActive, type Terminal } from "./terminal";
10
10
  import { ImageProtocol, setCellDimensions, setTerminalImageProtocol, TERMINAL } from "./terminal-capabilities";
11
- import { isInsideTerminalMultiplexer } from "./terminal-multiplexer";
11
+ import { isInsideHerdr, isInsideTerminalMultiplexer } from "./terminal-multiplexer";
12
12
  import { extractSegments, getSegmenter, sliceByColumn, sliceWithWidth, visibleWidth } from "./utils";
13
13
 
14
14
  const SEGMENT_RESET = "\x1b[0m";
@@ -608,6 +608,8 @@ export class TUI extends Container {
608
608
  }
609
609
 
610
610
  #querySixelSupport(): void {
611
+ // Herdr negotiates Kitty delivery through its child capability, not host SIXEL probes.
612
+ if (isInsideHerdr()) return;
611
613
  if (TERMINAL.imageProtocol) return;
612
614
  if (process.platform !== "win32") return;
613
615
  if (!Bun.env.WT_SESSION) return;