@oh-my-pi/pi-tui 15.10.5 → 15.10.6

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,15 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [15.10.6] - 2026-06-08
6
+
7
+ ### Added
8
+
9
+ - Added `TUI.getFocused()` accessor and `Input.pasteText(text)` method so callers consuming non-bracketed paste transports (e.g. kitty's OSC 5522 enhanced clipboard) can route a paste payload to the currently focused modal Input rather than always to the primary editor. Mirrors the existing `Editor.pasteText` semantics: newlines stripped, tabs normalized, NFC normalization applied. ([#2127](https://github.com/can1357/oh-my-pi/issues/2127))
10
+ ### Fixed
11
+
12
+ - Fixed tmux/screen/zellij rewind/branch (`requestRender(true, { clearScrollback: true })`) permanently anchoring the input box to the pane top and overlaying scrollback after a streamed reply had grown past the viewport. `#emitFullPaint` only reset `#scrollbackHighWater` inside the `clearScrollback` branch and otherwise raised it monotonically, so inside multiplexers (where `\x1b[3J` is a no-op and `clearScrollback` is forced off) the streaming peak survived the rewind; on the next frame `#planLiveRegionPinnedRender` saw the stale high-water and anchored `renderViewportTop` past the actual content, repainting every visible row blank and parking the cursor at screen row 0 for the rest of the session. A full repaint with `clearViewport: true` re-emits the entire transcript from row 0, so `#scrollbackHighWater` is now assigned (not max-clamped) to the natural push count regardless of whether ED 3 was issued ([#2130](https://github.com/can1357/oh-my-pi/issues/2130)).
13
+
5
14
  ## [15.10.5] - 2026-06-08
6
15
 
7
16
  ### Added
@@ -13,6 +13,9 @@ export declare class Input implements Component, Focusable {
13
13
  setUseTerminalCursor(useTerminalCursor: boolean): void;
14
14
  getUseTerminalCursor(): boolean;
15
15
  handleInput(data: string): void;
16
+ /** Apply terminal paste semantics to text from non-bracketed paste transports
17
+ * (e.g. kitty's OSC 5522 enhanced clipboard read). Mirrors `Editor.pasteText`. */
18
+ pasteText(text: string): void;
16
19
  invalidate(): void;
17
20
  render(width: number): string[];
18
21
  }
@@ -271,6 +271,8 @@ export declare class TUI extends Container {
271
271
  */
272
272
  setEagerNativeScrollbackRebuild(enabled: boolean): void;
273
273
  setFocus(component: Component | null): void;
274
+ /** Component currently receiving keyboard input, if any. */
275
+ getFocused(): Component | null;
274
276
  /**
275
277
  * Show an overlay component with configurable positioning and sizing.
276
278
  * Returns a handle to control the overlay's visibility.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@oh-my-pi/pi-tui",
4
- "version": "15.10.5",
4
+ "version": "15.10.6",
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": "15.10.5",
41
- "@oh-my-pi/pi-utils": "15.10.5",
40
+ "@oh-my-pi/pi-natives": "15.10.6",
41
+ "@oh-my-pi/pi-utils": "15.10.6",
42
42
  "lru-cache": "11.5.1",
43
43
  "marked": "^18.0.4"
44
44
  },
@@ -187,6 +187,12 @@ export class Input implements Component, Focusable {
187
187
  }
188
188
  }
189
189
 
190
+ /** Apply terminal paste semantics to text from non-bracketed paste transports
191
+ * (e.g. kitty's OSC 5522 enhanced clipboard read). Mirrors `Editor.pasteText`. */
192
+ pasteText(text: string): void {
193
+ this.#handlePaste(text);
194
+ }
195
+
190
196
  #insertCharacter(text: string): void {
191
197
  const isWordChunk = [...segmenter.segment(text)].every(seg => getWordNavKind(seg.segment) !== "whitespace");
192
198
  // Undo coalescing: consecutive word typing coalesces into one undo unit.
package/src/tui.ts CHANGED
@@ -776,6 +776,11 @@ export class TUI extends Container {
776
776
  }
777
777
  }
778
778
 
779
+ /** Component currently receiving keyboard input, if any. */
780
+ getFocused(): Component | null {
781
+ return this.#focusedComponent;
782
+ }
783
+
779
784
  /**
780
785
  * Show an overlay component with configurable positioning and sizing.
781
786
  * Returns a handle to control the overlay's visibility.
@@ -3063,13 +3068,22 @@ export class TUI extends Container {
3063
3068
 
3064
3069
  this.#maxLinesRendered = options.clearViewport ? lines.length : Math.max(this.#maxLinesRendered, lines.length);
3065
3070
  if (options.clearScrollback) {
3066
- this.#scrollbackHighWater = 0;
3067
3071
  this.#suppressNextSuffixScroll = lines.length > height;
3068
3072
  }
3069
3073
  const pushedNow = Math.max(0, lines.length - height);
3070
- if (pushedNow > this.#scrollbackHighWater) {
3071
- this.#scrollbackHighWater = pushedNow;
3072
- }
3074
+ // A full repaint physically re-emits the entire transcript from row 0, so
3075
+ // the rows committed to native scrollback by this paint are exactly
3076
+ // `pushedNow`. Outside multiplexers an `\x1b[3J` above wiped pre-paint
3077
+ // scrollback as well, so the assignment matches reality. Inside
3078
+ // multiplexers `\x1b[3J` is a no-op and stale pre-paint rows remain in
3079
+ // pane history, but those belong to the previous logical transcript and
3080
+ // must drop out of the renderer's bookkeeping: leaving a stale
3081
+ // `#scrollbackHighWater` above `pushedNow` mis-anchors the pinned emitter
3082
+ // on every subsequent frame, pinning the input box to the top of the pane
3083
+ // after a rewind/branch shrinks the transcript (issue #2130). When
3084
+ // `clearViewport` is false (no current caller), keep the monotonic
3085
+ // behavior so deferred paints do not lower the tracker.
3086
+ this.#scrollbackHighWater = options.clearViewport ? pushedNow : Math.max(this.#scrollbackHighWater, pushedNow);
3073
3087
  this.#commit(lines, width, height, Math.max(0, this.#maxLinesRendered - height), cursorControl);
3074
3088
  }
3075
3089