vterm.js 0.7.0 → 0.8.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.
package/README.md CHANGED
@@ -20,7 +20,7 @@ Part of the [vterm](https://github.com/beorn/vterm) monorepo.
20
20
  - **Synchronized output** — mode 2026
21
21
  - **Application cursor keys & keypad**
22
22
  - **Kitty keyboard protocol** — progressive-enhancement flags with a push/pop/set stack (`CSI u`)
23
- - **OSC sequences** — window title (OSC 0/2), hyperlinks (OSC 8), clipboard (OSC 52), colors
23
+ - **OSC sequences** — independent icon/window labels (OSC 0 sets both, OSC 1 icon, OSC 2 window), hyperlinks (OSC 8), clipboard (OSC 52), colors
24
24
  - **DCS sequences** — consumed and ignored, XTVERSION response
25
25
  - **Device attributes** — DA1/DA2/DA3 responses
26
26
  - **Device status reports** — DSR responses
@@ -35,6 +35,8 @@ Part of the [vterm](https://github.com/beorn/vterm) monorepo.
35
35
 
36
36
  ## Install
37
37
 
38
+ > Install from npm; a git install resolves the TypeScript source and runs only under Bun.
39
+
38
40
  ```bash
39
41
  npm install vterm.js
40
42
  ```
@@ -138,6 +140,8 @@ console.log(restored.getText()) // "Hello, Bold Green World!" — text and style
138
140
 
139
141
  **Soft-wrap history.** `Snapshot` carries `scrollbackSoftWrapped: boolean[]` alongside `scrollback` — bit `i` true means scrollback row `i` wraps into row `i+1` (one logical line split across rows); an absent array (older stored v1 snapshots) is treated as all-false. Phase-1 history re-links a wrapped row by emitting it at full width with no line break, so the receiver's own autowrap re-records the bit as the row scrolls back.
140
142
 
143
+ **Icon/window labels.** `Snapshot.title` remains the window title. New v1 snapshots include optional `iconLabel`, including empty strings; the binary codec preserves whether that field is present. Only `restore()` defaults legacy absence to `title` to preserve old CSI20 behavior; historical OSC0 versus OSC2 intent cannot be recovered. An own `undefined`, `null` or other non-string value is rejected. Older readers ignore the new JSON-header key and lose independent icon semantics. `getTitle()` and `title$` remain window-only. `includeTitle:true` emits a nonempty window title with OSC2, preserving the receiver's independent icon instead of the former OSC0 side effect. Default title omission and empty-title omission remain; ANSI replay does not transfer the icon label.
144
+
141
145
  ### Ops and taps
142
146
 
143
147
  `apply(op)` is the single public write entry — the same seam a session journal records and replays. An op is coarse, serializable data; **bytes stay the canonical encoding** (an `output` op is just bytes, deterministically re-parsed on replay — vterm never reifies a per-VT-action op):
package/dist/index.d.mts CHANGED
@@ -85,6 +85,13 @@ interface ScreenOptions {
85
85
  cols?: number;
86
86
  rows?: number;
87
87
  scrollbackLimit?: number;
88
+ /**
89
+ * The embedder renders or relays kitty graphics images, so this screen may
90
+ * claim them: graphics queries answer OK and the kittyGraphics mode is true.
91
+ * Default false — this screen stores no image, so it refuses queries and
92
+ * reports no capability (#31020).
93
+ */
94
+ kittyGraphicsImages?: boolean;
88
95
  /** Callback for DA1/DA2/DSR responses — write these back to the PTY */
89
96
  onResponse?: (data: string) => void;
90
97
  /**
@@ -204,6 +211,10 @@ interface Snapshot {
204
211
  originMode: boolean;
205
212
  autoWrap: boolean;
206
213
  charsetG0: boolean;
214
+ /** True when DEC Special Graphics is designated as G1. Absent in older snapshots: ASCII. */
215
+ charsetG1?: boolean;
216
+ /** True when SO has invoked G1 into GL. Absent in older snapshots: SI/G0. */
217
+ activeG1?: boolean;
207
218
  };
208
219
  attrs: ScreenAttrsSnapshot;
209
220
  modes: {
@@ -242,6 +253,8 @@ interface Snapshot {
242
253
  };
243
254
  tabStops: number[];
244
255
  title: string;
256
+ /** Independent icon label. Legacy absence restores from title; a supplied value must be a string. */
257
+ iconLabel?: string;
245
258
  clipboard: string;
246
259
  cwd: string;
247
260
  notifications: string[];
@@ -268,6 +281,10 @@ interface Snapshot {
268
281
  };
269
282
  unicode: {
270
283
  charsetG0: boolean;
284
+ /** True when DEC Special Graphics is designated as G1. Absent in older snapshots: ASCII. */
285
+ charsetG1?: boolean;
286
+ /** True when SO has invoked G1 into GL. Absent in older snapshots: SI/G0. */
287
+ activeG1?: boolean;
271
288
  lastChar: string;
272
289
  pendingRegionalIndicator: string | null;
273
290
  afterZWJ: boolean;
@@ -564,7 +581,7 @@ declare function createScreen(options?: ScreenOptions): Screen;
564
581
  interface SerializeOptions {
565
582
  /** Emit scrollback history rows before the screen paint. Default: true. */
566
583
  includeScrollback?: boolean;
567
- /** Emit the window title (OSC 0) when non-empty. Default: false. */
584
+ /** Emit only the window title (OSC 2) when non-empty, preserving the receiver's icon label. Default: false. */
568
585
  includeTitle?: boolean;
569
586
  /** Emit OSC 8 hyperlinks for cell and pending-pen urls. Default: true. */
570
587
  hyperlinks?: boolean;