@oh-my-pi/pi-tui 17.1.0 → 17.1.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/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [17.1.1] - 2026-07-24
6
+
7
+ ### Fixed
8
+
9
+ - Fixed WarpTerminal wrapping streamed Compatibility Jamo at the platform-default width instead of its rendered one-cell width ([#6461](https://github.com/can1357/oh-my-pi/issues/6461)).
10
+
5
11
  ## [17.1.0] - 2026-07-24
6
12
 
7
13
  ### Added
@@ -1,3 +1,4 @@
1
+ import type { HangulCompatibilityJamoWidth } from "./utils.js";
1
2
  export { isInsideTmux, wrapTmuxPassthrough } from "./tmux.js";
2
3
  export declare enum ImageProtocol {
3
4
  Kitty = "\u001B_G",
@@ -21,9 +22,21 @@ export declare class TerminalInfo {
21
22
  readonly supportsScreenToScrollback: boolean;
22
23
  /** Renders the Kitty OSC 66 text-sizing protocol (scaled spans). Kitty only. */
23
24
  readonly textSizing: boolean;
25
+ /**
26
+ * Hangul Compatibility Jamo (U+3131..=U+318E) cell width. Ghostty follows
27
+ * UAX#11 (2 cells); Warp paints 1; "platform" keeps the OS default
28
+ * (macOS narrow, otherwise UAX#11).
29
+ */
30
+ readonly hangulJamoWidth: HangulCompatibilityJamoWidth;
24
31
  constructor(id: TerminalId, imageProtocol: ImageProtocol | null, trueColor: boolean, hyperlinks: boolean, notifyProtocol?: NotifyProtocol, deccara?: boolean, supportsScreenToScrollback?: boolean,
25
32
  /** Renders the Kitty OSC 66 text-sizing protocol (scaled spans). Kitty only. */
26
- textSizing?: boolean);
33
+ textSizing?: boolean,
34
+ /**
35
+ * Hangul Compatibility Jamo (U+3131..=U+318E) cell width. Ghostty follows
36
+ * UAX#11 (2 cells); Warp paints 1; "platform" keeps the OS default
37
+ * (macOS narrow, otherwise UAX#11).
38
+ */
39
+ hangulJamoWidth?: HangulCompatibilityJamoWidth);
27
40
  /**
28
41
  * Mutable clone for the {@link TERMINAL} singleton: copies every field and
29
42
  * keeps the prototype methods, so the builder and runtime setters flip
@@ -1,5 +1,3 @@
1
- import { type HangulCompatibilityJamoWidth } from "./utils.js";
2
- export declare function resolveHangulCompatibilityJamoWidthFromTerminalIdentity(env?: NodeJS.ProcessEnv): HangulCompatibilityJamoWidth;
3
1
  /**
4
2
  * Split `data` into chunks whose encoded UTF-8 byte length is no greater than
5
3
  * `maxChunkBytes`, preferring a line boundary (`\n`) as the cut point so
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@oh-my-pi/pi-tui",
4
- "version": "17.1.0",
4
+ "version": "17.1.1",
5
5
  "description": "Terminal User Interface library with differential rendering for efficient text-based applications",
6
6
  "homepage": "https://omp.sh",
7
7
  "author": "Can Boluk",
@@ -37,8 +37,8 @@
37
37
  "fmt": "biome format --write ."
38
38
  },
39
39
  "dependencies": {
40
- "@oh-my-pi/pi-natives": "17.1.0",
41
- "@oh-my-pi/pi-utils": "17.1.0",
40
+ "@oh-my-pi/pi-natives": "17.1.1",
41
+ "@oh-my-pi/pi-utils": "17.1.1",
42
42
  "lru-cache": "11.5.2",
43
43
  "marked": "^18.0.6"
44
44
  },
@@ -10,6 +10,7 @@ import {
10
10
  setKittyGraphics,
11
11
  } from "./kitty-graphics";
12
12
  import { isInsideTmux, wrapTmuxPassthrough, wrapTmuxPassthroughIfNeeded } from "./tmux";
13
+ import type { HangulCompatibilityJamoWidth } from "./utils";
13
14
 
14
15
  export { isInsideTmux, wrapTmuxPassthrough } from "./tmux";
15
16
 
@@ -105,6 +106,12 @@ export class TerminalInfo {
105
106
  readonly supportsScreenToScrollback: boolean = false,
106
107
  /** Renders the Kitty OSC 66 text-sizing protocol (scaled spans). Kitty only. */
107
108
  public readonly textSizing: boolean = false,
109
+ /**
110
+ * Hangul Compatibility Jamo (U+3131..=U+318E) cell width. Ghostty follows
111
+ * UAX#11 (2 cells); Warp paints 1; "platform" keeps the OS default
112
+ * (macOS narrow, otherwise UAX#11).
113
+ */
114
+ public readonly hangulJamoWidth: HangulCompatibilityJamoWidth = "platform",
108
115
  ) {}
109
116
 
110
117
  /**
@@ -447,7 +454,17 @@ export function resolveWarpImageProtocol(
447
454
  }
448
455
 
449
456
  function getWarpTerminalInfo(platform: NodeJS.Platform, env: NodeJS.ProcessEnv = Bun.env): TerminalInfo {
450
- return new TerminalInfo("warp", resolveWarpImageProtocol(platform, env), true, false, NotifyProtocol.Osc9);
457
+ return new TerminalInfo(
458
+ "warp",
459
+ resolveWarpImageProtocol(platform, env),
460
+ true,
461
+ false,
462
+ NotifyProtocol.Osc9,
463
+ false,
464
+ false,
465
+ false,
466
+ 1,
467
+ );
451
468
  }
452
469
  const KNOWN_TERMINALS = Object.freeze({
453
470
  // Fallback terminals
@@ -455,7 +472,7 @@ const KNOWN_TERMINALS = Object.freeze({
455
472
  trueColor: new TerminalInfo("trueColor", null, true, false, NotifyProtocol.Bell),
456
473
  // Recognized terminals
457
474
  kitty: new TerminalInfo("kitty", ImageProtocol.Kitty, true, true, NotifyProtocol.Osc99, true, true, true),
458
- ghostty: new TerminalInfo("ghostty", ImageProtocol.Kitty, true, true, NotifyProtocol.Osc9),
475
+ ghostty: new TerminalInfo("ghostty", ImageProtocol.Kitty, true, true, NotifyProtocol.Osc9, false, false, false, 2),
459
476
  wezterm: new TerminalInfo("wezterm", ImageProtocol.Kitty, true, true, NotifyProtocol.Osc9),
460
477
  iterm2: new TerminalInfo("iterm2", ImageProtocol.Iterm2, true, true, NotifyProtocol.Osc9),
461
478
  vscode: new TerminalInfo("vscode", null, true, true, NotifyProtocol.Bell),
@@ -465,7 +482,7 @@ const KNOWN_TERMINALS = Object.freeze({
465
482
  // detectKittyUnicodePlaceholdersSupport correctly excludes it). It does not
466
483
  // honor OSC 8 yet (the escape renders as visible text), so hyperlinks stay off,
467
484
  // but it does support OSC 9 notifications.
468
- warp: new TerminalInfo("warp", ImageProtocol.Kitty, true, false, NotifyProtocol.Osc9),
485
+ warp: new TerminalInfo("warp", ImageProtocol.Kitty, true, false, NotifyProtocol.Osc9, false, false, false, 1),
469
486
  });
470
487
 
471
488
  /** Resolve terminal identity from environment markers used by common emulators. */
package/src/terminal.ts CHANGED
@@ -19,31 +19,12 @@ import {
19
19
  TERMINAL,
20
20
  } from "./terminal-capabilities";
21
21
  import { isInsideTmux, wrapTmuxPassthrough } from "./tmux";
22
- import { type HangulCompatibilityJamoWidth, setHangulCompatibilityJamoWidth } from "./utils";
22
+ import { setHangulCompatibilityJamoWidth } from "./utils";
23
23
 
24
24
  const TERMINAL_PROGRESS_KEEPALIVE_MS = 1000;
25
25
  const TERMINAL_PROGRESS_ACTIVE_SEQUENCE = "\x1b]9;4;3\x07";
26
26
  const TERMINAL_PROGRESS_CLEAR_SEQUENCE = "\x1b]9;4;0;\x07";
27
27
  const WINDOWS_TERMINAL_OSC11_POLL_MS = 30_000;
28
- // Hangul Compatibility Jamo (U+3131..=U+318E) render width is terminal-dependent:
29
- // Ghostty follows UAX#11 (2 cells); Terminal.app and iTerm2 render narrow (1),
30
- // matching the macOS platform default. Override only for terminals known to
31
- // disagree — the rest keep the platform default (macOS narrow, otherwise UAX#11),
32
- // so this is a no-op everywhere except Ghostty. A runtime DSR/CPR probe that
33
- // auto-detects the width on unknown terminals is tracked separately.
34
- export function resolveHangulCompatibilityJamoWidthFromTerminalIdentity(
35
- env: NodeJS.ProcessEnv = Bun.env,
36
- ): HangulCompatibilityJamoWidth {
37
- if (
38
- env.GHOSTTY_RESOURCES_DIR ||
39
- env.TERM_PROGRAM?.toLowerCase() === "ghostty" ||
40
- env.TERM?.toLowerCase().includes("ghostty")
41
- ) {
42
- return 2;
43
- }
44
- return "platform";
45
- }
46
-
47
28
  function shouldEnableModifyOtherKeysFallback(env: NodeJS.ProcessEnv = Bun.env): boolean {
48
29
  if (!env.SSH_CONNECTION && !env.SSH_TTY && !env.SSH_CLIENT) return true;
49
30
  return TERMINAL.id !== "base" && TERMINAL.id !== "trueColor";
@@ -659,7 +640,7 @@ export class ProcessTerminal implements Terminal {
659
640
  // The query handler intercepts input temporarily, then installs the user's handler
660
641
  // See: https://sw.kovidgoyal.net/kitty/keyboard-protocol/
661
642
  this.#queryAndEnableKittyProtocol();
662
- setHangulCompatibilityJamoWidth(resolveHangulCompatibilityJamoWidthFromTerminalIdentity());
643
+ setHangulCompatibilityJamoWidth(TERMINAL.hangulJamoWidth);
663
644
 
664
645
  // Query terminal background color via OSC 11 for dark/light detection.
665
646
  // Uses DA1 (Primary Device Attributes) as a sentinel: terminals process