restty 0.1.29 → 0.1.30

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.
@@ -114138,19 +114138,24 @@ function createRuntimeReporting(options) {
114138
114138
  };
114139
114139
  }
114140
114140
 
114141
- // src/runtime/create-runtime/runtime-app-api.ts
114142
- var DEFAULT_MAX_SCROLLBACK = 2000;
114143
- var MAX_SCROLLBACK_U32 = 4294967295;
114144
- function normalizeMaxScrollback(value) {
114141
+ // src/runtime/max-scrollback.ts
114142
+ var DEFAULT_MAX_SCROLLBACK_BYTES = 1e7;
114143
+ var MAX_MAX_SCROLLBACK_BYTES = 256000000;
114144
+ function normalizeMaxScrollbackBytes(value) {
114145
114145
  if (!Number.isFinite(value))
114146
- return DEFAULT_MAX_SCROLLBACK;
114146
+ return DEFAULT_MAX_SCROLLBACK_BYTES;
114147
114147
  const asInt = Math.trunc(value);
114148
114148
  if (asInt <= 0)
114149
114149
  return 0;
114150
- if (asInt >= MAX_SCROLLBACK_U32)
114151
- return MAX_SCROLLBACK_U32;
114150
+ if (asInt >= MAX_MAX_SCROLLBACK_BYTES)
114151
+ return MAX_MAX_SCROLLBACK_BYTES;
114152
114152
  return asInt;
114153
114153
  }
114154
+ function resolveMaxScrollbackBytes(options) {
114155
+ return normalizeMaxScrollbackBytes(options.maxScrollbackBytes ?? options.maxScrollback);
114156
+ }
114157
+
114158
+ // src/runtime/create-runtime/runtime-app-api.ts
114154
114159
  function createRuntimeAppApi(options) {
114155
114160
  const {
114156
114161
  session,
@@ -114211,7 +114216,7 @@ function createRuntimeAppApi(options) {
114211
114216
  resizeWasActive: false,
114212
114217
  nextBlinkTime: performance.now() + CURSOR_BLINK_MS
114213
114218
  };
114214
- const maxScrollback = normalizeMaxScrollback(options.maxScrollback);
114219
+ const maxScrollbackBytes = resolveMaxScrollbackBytes(options);
114215
114220
  function updateFps() {
114216
114221
  internalState.frameCount += 1;
114217
114222
  const now = performance.now();
@@ -114493,7 +114498,7 @@ function createRuntimeAppApi(options) {
114493
114498
  updateGrid();
114494
114499
  const cols = gridState.cols || 80;
114495
114500
  const rows = gridState.rows || 24;
114496
- const wasmHandle = instance.create(cols, rows, maxScrollback);
114501
+ const wasmHandle = instance.create(cols, rows, maxScrollbackBytes);
114497
114502
  if (!wasmHandle) {
114498
114503
  throw new Error("restty create failed (restty_create returned 0)");
114499
114504
  }
@@ -115761,6 +115766,7 @@ function createResttyApp(options) {
115761
115766
  resetTerminalResizeScheduler,
115762
115767
  getSelectionText: getSelectionText2,
115763
115768
  initialPreferredRenderer: options.renderer ?? "auto",
115769
+ maxScrollbackBytes: options.maxScrollbackBytes,
115764
115770
  maxScrollback: options.maxScrollback
115765
115771
  });
115766
115772
  return runtimeAppApi.createPublicApi({
package/dist/internal.js CHANGED
@@ -100,7 +100,7 @@ import {
100
100
  updateGridState,
101
101
  updateImePosition,
102
102
  updateSelection
103
- } from "./chunk-p9e8t0ks.js";
103
+ } from "./chunk-w0c4b651.js";
104
104
  export {
105
105
  updateSelection,
106
106
  updateImePosition,
package/dist/restty.js CHANGED
@@ -8,7 +8,7 @@ import {
8
8
  isBuiltinThemeName,
9
9
  listBuiltinThemeNames,
10
10
  parseGhosttyTheme
11
- } from "./chunk-p9e8t0ks.js";
11
+ } from "./chunk-w0c4b651.js";
12
12
  export {
13
13
  parseGhosttyTheme,
14
14
  listBuiltinThemeNames,
@@ -68,6 +68,7 @@ type CreateRuntimeAppApiOptions = {
68
68
  runBeforeRenderOutputHook: (text: string, source: string) => string | null;
69
69
  getSelectionText: () => string;
70
70
  initialPreferredRenderer: PreferredRenderer;
71
+ maxScrollbackBytes?: number;
71
72
  maxScrollback?: number;
72
73
  CURSOR_BLINK_MS: number;
73
74
  RESIZE_ACTIVE_MS: number;
@@ -0,0 +1,9 @@
1
+ export declare const DEFAULT_MAX_SCROLLBACK_BYTES = 10000000;
2
+ export declare const MAX_MAX_SCROLLBACK_BYTES = 256000000;
3
+ type MaxScrollbackOptions = {
4
+ maxScrollbackBytes?: number;
5
+ maxScrollback?: number;
6
+ };
7
+ export declare function normalizeMaxScrollbackBytes(value: number | undefined): number;
8
+ export declare function resolveMaxScrollbackBytes(options: MaxScrollbackOptions): number;
9
+ export {};
@@ -256,7 +256,15 @@ export type ResttyAppOptions = {
256
256
  beforeRenderOutput?: (payload: ResttyAppInputPayload) => string | null | void;
257
257
  /** Optional render-stage shader chain. */
258
258
  shaderStages?: ResttyShaderStage[];
259
- /** Maximum scrollback buffer size in bytes passed to the WASM terminal (default 2000). */
259
+ /**
260
+ * Maximum scrollback buffer size in bytes passed to the WASM terminal.
261
+ * Default is 10_000_000 (10MB).
262
+ */
263
+ maxScrollbackBytes?: number;
264
+ /**
265
+ * Deprecated alias for maxScrollbackBytes.
266
+ * If both are set, maxScrollbackBytes takes precedence.
267
+ */
260
268
  maxScrollback?: number;
261
269
  };
262
270
  /**
package/dist/xterm.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createRestty
3
- } from "./chunk-p9e8t0ks.js";
3
+ } from "./chunk-w0c4b651.js";
4
4
 
5
5
  // src/xterm/app-options.ts
6
6
  function createCompatAppOptions(userAppOptions, emitData) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "restty",
3
- "version": "0.1.29",
3
+ "version": "0.1.30",
4
4
  "description": "Browser terminal rendering library powered by WASM, WebGPU/WebGL2, and TypeScript text shaping.",
5
5
  "keywords": [
6
6
  "terminal",