Repository navigation
Expand file tree
/
Copy pathCHANGES
More file actions
1160 lines (902 loc) · 51.8 KB
/
Copy pathCHANGES
File metadata and controls
1160 lines (902 loc) · 51.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# Changelog
## libvt 0.0.1a7 (Yet to be released)
<!-- KEEP THIS PLACEHOLDER - DO NOT REMOVE OR MODIFY THIS LINE -->
_Notes on the upcoming release will go here._
<!-- END PLACEHOLDER - ADD NEW CHANGELOG ENTRIES BELOW THIS LINE -->
### What's new
#### Recorder protocol, target protocol, and state replacement (#203)
Pass any {class}`~libvt.recorder.TerminalRecorder` implementation to
{class}`~libvt.terminal.Terminal` to observe normalized input spans and
external resizes without monkey-patching. Call
{meth}`~libvt.terminal.Terminal.replace_from` to replace emulated screen, mode,
and parser state in place while preserving host callbacks, theme settings, and
sync identity.
Implement {class}`~libvt.testing.SupportsVtTarget` (`__vt_target__`) on custom
wrappers passed to {func}`~libvt.testing.vt_screen` and
{func}`~libvt.testing.serialize_vt_snapshot`.
{class}`~libvt.aio.AsyncTerminalStream`, {class}`~libvt.aio.PtySession`, and
{class}`~libvt.contrib.tmux.capture.TmuxCaptureResult` implement this protocol
directly. {func}`~libvt.modes.is_private_mode_supported` exposes profile mode
support queries, and {class}`~libvt.snapshot.SnapshotDict` types the dictionary
returned by {meth}`~libvt.snapshot.Snapshot.to_dict`.
### Documentation
#### Split API reference into per-module pages
Add dedicated API reference pages for {mod}`libvt.views`,
{mod}`libvt.snapshot`, {mod}`libvt.format`, and {mod}`libvt.recorder`, break
{mod}`libvt.aio` and {mod}`libvt.contrib` (including `tmux` submodules and
`syrupy`) into per-module directories, and add Sphinx `rediraffe` redirects for
moved API URLs.
## libvt 0.0.1a6 (2026-12-05)
`libvt` 0.0.1a6 adds soft-wrapped logical-line reading and `wait_for()`
matching ({attr}`~libvt.snapshot.Snapshot.unwrapped_text`), `os.PathLike`
snapshot scrubbers, prepared VT diff baselines and nested container diffs,
initial PTY encoding and event recording, `StopOn.PROGRAM_STATUS` stepping,
tmux process replacement and session-scope tracking, paired untrimmed tmux
capture bundles, exact {class}`~libvt.recorder.FlightRecorder` byte bounds,
strided buffer support across parser, PTY, and tmux control helpers, and
fixes for async stream teardown, PTY process-group cleanup, VT replay
checkpoints, Kitty key releases, mouse mode selection, and nested region
slicing.
### What's new
#### Step to a program status change (#181)
Pass `stop=StopOn.PROGRAM_STATUS` to `Terminal.feed_until()` to observe a
status transition before processing the rest of a read.
#### Choose a PTY's initial encoding and retain its first events (#164)
Pass `encoding="latin-1"` and `record_events=True` to
{func}`~libvt.aio.open_pty` to read a legacy program's first bytes and
retrieve its events. {meth}`~libvt.terminal.Terminal.from_size` and the
`vt_factory` and `vt_pty` fixtures accept the same settings.
#### Refresh tmux panes after process replacement notices (#167)
Use {meth}`~libvt.contrib.tmux.control.TmuxPaneSync.watch_process` to
refresh a pane when tmux reports a changed PID or dead state. The
observer updates its existing terminal and advances its epoch. A passive
observer can receive replacement bytes before the notification.
#### Scrub filesystem paths with path objects (#150)
{func}`~libvt.testing.vt_screen`, {func}`~libvt.testing.serialize_vt_snapshot`,
and {meth}`~libvt.contrib.syrupy.VtSnapshotExtension.configure` accept
{class}`os.PathLike` values such as pytest's `tmp_path`. A
{class}`pathlib.PureWindowsPath` matches both path separators and either case
of a drive letter. Use an explicit regex for paths inside URIs. When using
`region=`, pass the source frame to account for cropped URI text.
#### Read soft-wrapped rows as logical lines (#152)
Use {attr}`~libvt.snapshot.Snapshot.unwrapped_text`,
{attr}`~libvt.terminal.Terminal.unwrapped_text`,
{attr}`~libvt.screen.Screen.unwrapped_text`, or
{attr}`~libvt.views.RegionView.unwrapped_text` to join soft wraps while
retaining hard line breaks. Pass `unwrap=True` to
{meth}`~libvt.snapshot.Snapshot.format`, {class}`~libvt.format.Formatter`,
or {func}`libvt.render <libvt.terminal.render>` for plain text or HTML.
### Fixes
#### Diagnose a bare PTY command (#165)
Pass `open_pty([executable])` for a command with no arguments. A bare
command string now raises `TypeError` before PTY allocation.
#### Report hidden continuation state in tmux captures (#172)
{attr}`~libvt.contrib.tmux.capture.CaptureCompleteness.unexposed_fields`
includes the preceding graphic for REP, the active grapheme, and the
partial UTF-8 prefix. These fields describe continuity beyond the
captured frame.
#### Keep the tmux cursor when entering the alternate screen (#173)
A terminal using {func}`~libvt.contrib.tmux.profile.tmux_profile` carries
the cursor position and pending wrap into the blank alternate screen
on `?47h`, `?1047h`, and `?1049h`. Custom profiles can set
{attr}`~libvt.config.ScreenBehavior.alternate_entry_preserves_cursor`.
#### Resume parsing after a callback raises (#175)
A callback for a completed control may raise. Once its caller handles the
exception, the next input packet starts in the completed control’s final
parser state.
#### Keep the background of concealed cells in HTML (#178)
The HTML formatter hides the glyph and its decorations for `SGR 8` while
preserving the cell background and occupied width.
#### Parse chords with a literal plus key (#187)
{meth}`~libvt.input.KeyEvent.parse` accepts `"ctrl++"` and other chords that
end with a literal plus key.
#### Report invalid CLI arguments (#188)
`python -m libvt` reports unreadable input on stderr. The `render`
command identifies an invalid `--rows` or `--cols` before reading input.
Both errors exit with status 2.
#### Select terminal snapshots in filtered updates (#189)
`pytest -m syrupy_snapshot --snapshot-update` includes tests using only
`vt_snapshot`. The fixture is also available when the project explicitly
loads the Syrupy and libvt plugin modules in `conftest.py`.
#### Encode Kitty F3 and special-key releases (#176)
Kitty disambiguation and event reporting use the F3 tilde form to
distinguish it from a cursor report. Enter, Tab, and Backspace release
events require the report-all-keys flag.
#### Preserve graphemes across same-size resizes (#179)
{meth}`~libvt.terminal.Terminal.resize` preserves the current grapheme when
the active screen keeps its dimensions. A combining mark arriving after a
duplicate size notification still joins its base character.
#### Capture a pane with its server's version (#158)
On tmux 3.2 and later, a captured pane answers `XTVERSION` with the
selected server's full release, including suffixes such as `3.6b`.
Earlier releases leave the query unanswered. An explicit `profile=`
still takes precedence.
{meth}`~libvt.contrib.tmux.control.TmuxPaneSync.begin_attach` reports the
pause requirement before sending a command to a server older than 3.2.
#### Identify uncertain emoji columns in tmux captures (#174)
When an emoji presentation selector widens captured text on an
unknown tmux release or one before 3.5,
{attr}`~libvt.contrib.tmux.capture.CaptureCompleteness.exact_cells`
is false and `unexposed_fields` lists `grapheme_widths`. Pass
`tmux_version=` when decoding raw output to identify the server.
#### Restore viewport state when replaying VT snapshots (#180)
{meth}`~libvt.snapshot.Snapshot.format` with
{attr}`~libvt.format.OutputFormat.VT` restores scroll margins, cell
protection, and the active SGR, OSC 8, and DECSCA pen. The formatter paints
stored glyphs in their recorded widths and preserves pending wrap where it
can reprint the captured margin glyph in place.
#### Read strided terminal input (#186)
Pass a sliced, reversed, or multidimensional `memoryview` to the parser,
terminal, recorder, explainer, PTY writes, or `tmux` control-mode helpers.
Each reads the logical bytes. Step offsets count those bytes.
#### Keep retained live rows and nested regions in bounds (#183)
{class}`~libvt.views.RowView` uses the current width for a live row's
length, indexing, and rendering. Retained slices clip their selected columns
to the current width. Frozen rows keep their captured dimensions.
{class}`~libvt.views.RegionView` accepts two-axis nested indexing in its own
coordinates, clipping live regions to their retained rows after a resize and
preserving captured dimensions for snapshot regions. Public read-model
properties now cover {attr}`~libvt.views.RegionView.columns`,
{attr}`~libvt.views.RowView.columns`, {attr}`~libvt.views.RowView.used`,
{attr}`~libvt.views.RowView.text_used`,
{attr}`~libvt.views.RowView.full_row`, {attr}`~libvt.screen.Screen.profile`,
{attr}`~libvt.screen.Screen.is_alt`, and
{attr}`~libvt.snapshot.Snapshot.profile`.
#### Repeat the last printed character on the Ghostty profile (#185)
After a cursor movement or style change, `GHOSTTY_PROFILE` repeats the
last spacing character at the new cursor position. A hard reset clears it.
#### Preserve a deferred wrap across tabulation (#184)
A forward tab at the right margin keeps the last character in place and
wraps the next printable character. The Ghostty and xterm profiles also
retain a pending wrap across backward tabulation.
#### Select mouse tracking and coordinates independently (#177)
A new tracking or coordinate request replaces the selected mode in its
group. {class}`~libvt.config.InputBehavior` controls whether resetting
an inactive SGR encoding clears the selection, as in `GHOSTTY_PROFILE`.
Classic releases retain modifier bits. X10 reports left, middle and
right button presses without modifiers.
#### Share foreground input reads (#159)
Concurrent foreground waits and direct reads now share one input read.
Await the stream's close before handing the reader to another consumer.
#### Observe consecutive synchronized frames in one read (#192)
A wait on {class}`~libvt.aio.AsyncTerminalStream` or
{class}`~libvt.aio.PtySession` now observes each committed frame when
one read contains several synchronized updates. A transient prompt can
match before the next update replaces it.
#### Close the writer after input failure or cancellation (#160)
Closing an async stream now closes its writer even when the input pump
fails. Concurrent close calls share cleanup, and a cancelled caller receives
its cancellation after cleanup finishes.
#### Route unsolicited replies after a stream handoff (#168)
After the previous stream closes, a prepared
{class}`~libvt.aio.AsyncTerminalStream` with a writer claims terminal
replies when it starts, pumps once, or sends data. It queues pending
replies before new input.
#### Close Linux PTY groups after the leader exits (#163)
On Linux with group pidfd signaling, closing
{class}`~libvt.aio.PtySession` signals surviving group members after
the direct child exits. When the pidfd handoff is unavailable, close
signals the group while the direct child runs.
{attr}`~libvt.aio.PtySession.closed_before_eof` records whether close
began before the terminal reached EOF.
#### Preserve erased background colors in tmux captures (#171)
Capture bundles on tmux 3.4 and later pair written rows with untrimmed
cells to recover trailing styles and retain explicitly written spaces.
Bounded history and saved primary screens use the same pairing.
{attr}`~libvt.contrib.tmux.capture.CaptureCompleteness.exact_cells` is false
when the available capture leaves the trailing cells uncertain.
Missing requested rows are reported as `capture_rows`.
#### Refresh the live tmux frame after a pane resize (#169)
{meth}`~libvt.contrib.tmux.control.TmuxPaneSync.handle_event` requests a
native capture when a layout notification changes the observed pane's
dimensions. The same terminal receives the new frame and advances its
epoch. See {ref}`tmux-row-bookmarks` to check whether an absolute-row
bookmark is still valid.
#### Report panes outside the tmux client's session (#166)
A live or paused {class}`~libvt.contrib.tmux.control.TmuxPaneSync` enters
`CHECKING_SCOPE` when it rechecks session membership. If the pane is
outside the client's session, the sync enters `OUT_OF_SCOPE` and keeps
its last screen.
#### Keep erased viewport text separate from scrollback (#149)
Widening the terminal after an in-place display erase leaves fresh text
and blank rows in view. Scrollback retains the earlier text as a separate
line. The Ghostty profile retains incoming wraps across the applicable
display or line erases and alignment tests. Custom profiles can select
that behavior with `erase_severs_history_wrap=False` on
{class}`~libvt.config.ScreenBehavior`.
#### Pair boxed snapshot rows by viewport index (#151)
{func}`~libvt.testing.format_vt_diff_lines` compares screen rows at matching
viewport indices and lists changed or reordered style spans.
#### Accept prepared VT diff baselines (#191)
{func}`~libvt.testing.vt_screen` accepts a prepared single-frame view in
`diff=`. The baseline inherits the current view's options and applies
its own region, display options, and scrubbers.
### Documentation
#### Assert effective colors alongside screen goldens (#190)
The {doc}`/topics/testing` guide shows how to resolve a cell's color
against the palette in its committed snapshot.
#### Request Kitty key events with their associated text (#176)
The {doc}`/topics/protocols-and-input` guide shows how to request a key
press with its generated text and report its release.
#### Choose mouse coordinates and wheel reports (#177)
The {doc}`/topics/protocols-and-input` guide shows classic coordinate
limits, SGR cell and pixel coordinates, and wheel presses.
### Development
#### Design review and issue skills (#155)
Use `REVIEW.md` to check API ownership, terminal behavior, and regression
tests. The `libvt-study-issue` and `libvt-fix-issue` skills follow that
policy for issue investigation and fixes from a checkout.
#### Run native tmux captures concurrently (#156)
Each pane or window integration test opens its own tmux socket. One
worker can finish and stop its server while another is still capturing.
#### Compare written spaces in the Ghostty oracle (#157)
The compiled Ghostty comparison preserves spaces printed by the
application. An erase-to-end-of-line control still leaves unused cells
out of the extracted text.
### Breaking changes
#### Report outbound writes interrupted by close (#162)
{meth}`~libvt.aio.AsyncTerminalStream.drain` and
{meth}`~libvt.aio.PtySession.drain` raise `OSError` with `errno.ECANCELED`
when a local close aborts queued writes.
For a stream, await `drain()` before closing to flush queued input. For a
PTY, set `write_high_water=0` and await `drain()` to empty the outbound
queue.
```python
# Before
stream.send(b"done\r")
await stream.aclose()
# After
stream.send(b"done\r")
await stream.drain()
await stream.aclose()
```
#### Set an exact flight recorder byte limit (#182)
`FlightRecorder(max_bytes=8)` retains the last eight bytes, including across
multiple writes. Zero keeps only the total byte count. Negative capacities
raise `ValueError`.
```python
# Before
rec = FlightRecorder(max_bytes=-1) # retained 64 bytes
# After
rec = FlightRecorder(max_bytes=64)
```
#### Read missing tmux pane metadata (#170)
{attr}`~libvt.contrib.tmux.capture.TmuxPaneMetadata.bracketed_paste_flag`
is `None` when the server supplies neither a direct paste flag nor a
nonempty list of parsed private modes.
Use `flag is False` for a confirmed disabled mode and `flag is None`
for an unknown mode.
An empty tab ruler now restores a pane with every tab stop cleared.
When a captured row contains a stored tab, `exact_cells` is false.
The server exposes today's stops and omits the width of the stored tab.
#### Regenerate stored tmux capture bundles (#171)
Bundles on tmux 3.4 and later require `UNTRIMMED` after `CAPTURE` and
`SAVED_UNTRIMMED` after `SAVED` when the command requests the saved
primary screen. Generate the command and parse its stdout with the same
{class}`~libvt.contrib.tmux.capture.TmuxCaptureCommand`.
#### Route shared `tmux` command replies to their pane (#161)
{meth}`~libvt.contrib.tmux.control.TmuxPaneSync.begin_attach`,
{meth}`~libvt.contrib.tmux.control.TmuxPaneSync.resync`, and
{meth}`~libvt.contrib.tmux.control.TmuxPaneSync.handle_event` can return a
reply marker and command batch on two lines. Send the complete string with
a final newline. On a shared control client, a command failure puts only
the requesting pane sync in `FAILED`.
#### Scrub each captured viewport row (#149)
{func}`~libvt.testing.serialize_vt_snapshot` and
{func}`~libvt.testing.vt_screen` match scrubbers within individual captured
rows. To scrub a temporary path, choose a `TMPDIR` and viewport that keep
the path on one row. Include padding in fixed-width field patterns to
keep dividers at their captured columns.
```python
# Before
scrubbers = [(r"pid=\d+", "pid=<PID>")]
# After
scrubbers = [(r"pid=\d+ +", "pid=<PID> ")]
```
See {ref}`topics-testing` for runnable examples.
#### Refresh persisted boxed VT expectations (#151)
Syrupy stores nested terminal frames in separate sections and labels their
diffs by key path. Boxed snapshots record display columns when frame text
admits more than one cell layout. Review the changed output and update
affected expectations with
`pytest --snapshot-update`.
#### Match logical lines in terminal waits (#152)
{meth}`~libvt.aio.AsyncTerminalStream.wait_for` and
{meth}`~libvt.aio.PtySession.wait_for` match strings across soft wraps.
To match physical rows, pass a callable that inspects the captured text.
```python
# Before
await session.wait_for("hello wo\nrld")
# After
await session.wait_for(lambda snap: "hello wo\nrld" in snap.text)
```
## libvt 0.0.1a5 (2026-11-30)
`libvt` 0.0.1a5 adds rectangular grid blitting, display-column text writes, and
standalone snapshots on {class}`~libvt.screen.Screen`
({meth}`~libvt.screen.Screen.blit`, {meth}`~libvt.screen.Screen.put_text`, and
{meth}`~libvt.screen.Screen.snapshot`), plus multi-pane `tmux` window layout
parsing, scene compositing, and atomic capture batches in
{mod}`libvt.contrib.tmux.window`.
### What's new
#### Compose a screen from snapshots and text (#137)
Use {meth}`~libvt.screen.Screen.blit` to copy a rectangular region from a
screen or snapshot, retaining cell styles, hyperlinks, and written spaces.
Place text by display column with {meth}`~libvt.screen.Screen.put_text`,
then freeze the result with {meth}`~libvt.screen.Screen.snapshot`.
#### Capture a split `tmux` window as one snapshot (#137)
Capture a detached window from `tmux` command output, or combine existing
pane snapshots with {func}`~libvt.contrib.tmux.window.composite_tmux_window`.
The snapshot includes split borders, pane border labels, and the active pane's
cursor. A zoomed pane fills the window.
## libvt 0.0.1a4 (2026-11-29)
`libvt` 0.0.1a4 adds tool-agnostic boxed VT and `SGR` snapshot serialization,
regime-aware dynamic-value scrubbing, and compact failure diffs in core
{mod}`libvt.testing` ({func}`~libvt.testing.serialize_vt_snapshot`,
{func}`~libvt.testing.vt_screen`, and
{func}`~libvt.testing.format_vt_diff_lines`) with zero runtime dependencies. It
also adds optional `libvt[pytest]` and `libvt[syrupy]` extras, pairing
{mod}`libvt.pytest_plugin` fixtures with {mod}`libvt.contrib.syrupy`'s
{class}`~libvt.contrib.syrupy.VtSnapshotExtension` and conditional
{fixture}`vt_snapshot` `.ambr` fixture. See {ref}`topics-snapshots` and
{ref}`topics-testing` for details and runnable examples.
### What's new
#### `libvt.testing`: Boxed VT and `SGR` snapshot serialization (#66, #67)
{func}`~libvt.testing.serialize_vt_snapshot`,
{func}`~libvt.testing.vt_screen` ({class}`~libvt.testing.VtScreenView`), and
{func}`~libvt.testing.format_vt_diff_lines` serialize terminal screens,
snapshots, region slices, `tmux` captures, and duck-typed pane objects into
escape-free Unicode viewport boxes with run-length `styles:` spans,
regime-aware regex scrubbing, and TTY or ASCII-caret failure diffs with no
runtime or snapshot-tool dependencies. See {ref}`topics-snapshots` and
{ref}`topics-testing` for details.
#### `libvt.pytest_plugin`: Fixture documentation and `libvt[pytest]` extra (#66, #67)
Install `libvt[pytest]` for {mod}`libvt.pytest_plugin`'s {fixture}`vt_terminal`,
{fixture}`vt_factory`, {fixture}`vt_recorder`, {fixture}`vt_parser`, and
{fixture}`vt_pty` fixtures while keeping core `libvt` runtime `dependencies`
empty and {mod}`libvt.pytest_plugin` free of third-party snapshot-tool
dependencies.
#### `libvt.contrib.syrupy`: Optional `.ambr` adapter and conditional `vt_snapshot` fixture (#66, #67)
Install `libvt[syrupy]` for `.ambr` golden-file testing.
{class}`~libvt.contrib.syrupy.VtSnapshotExtension` adapts {mod}`libvt.testing`
to `syrupy`, and `libvt_syrupy` registers {fixture}`vt_snapshot` automatically
when `syrupy` is active in `pytest` while omitting it from `pytest --fixtures`
when `syrupy` is uninstalled or disabled (`-p no:syrupy`).
### Development
CI runs ty on the terminal package, test suite and development scripts at the supported Python targets. ([#70](https://github.com/tmux-python/libvt/pull/70))
## libvt 0.0.1a3 (2026-11-29)
`libvt` 0.0.1a3 adds mode-40-gated `80`/`132`-column switching
({class}`~libvt.config.DeccolmBehavior`), `IBM PC` / `CP437` (`'U'`) graphic
charset designations, and opt-in ISO-2022 `DOCS` wire-encoding transitions for
legacy terminal streams. It also adds column-padded `display_lines` export and
stateless {meth}`Snapshot.viewport <libvt.snapshot.Snapshot.viewport>`
scrollback paging, and expands {mod}`libvt.contrib.tmux` with
cursor/keypad/key-mode metadata, bounded `history_lines` capture,
`%layout-change` resizing, and in-place
{meth}`TmuxPaneSync.resync <libvt.contrib.tmux.control.TmuxPaneSync.resync>`.
See {ref}`topics-migrating-from-pyte` for migration details and runnable
examples.
### What's new
#### Mode-gated 80/132-column switching, `CP437` charset, and wire-encoding transitions (#58)
{class}`~libvt.modes.Mode` adds {attr}`~libvt.modes.Mode.DECCOLM` (`?3`),
{attr}`~libvt.modes.Mode.ALLOW_80_132` (`?40`), and
{attr}`~libvt.modes.Mode.DECNCSM` (`?95`), governed by
{attr}`ScreenBehavior.deccolm <libvt.config.ScreenBehavior.deccolm>`
({class}`~libvt.config.DeccolmBehavior`).
{data}`~libvt.config.DEFAULT_PROFILE` uses
{attr}`~libvt.config.DeccolmBehavior.GATED_BY_MODE_40` with `?40` initially
reset (`?3h` selects `132` columns and `?3l` selects `80` columns once `?40h`
is enabled), {func}`~libvt.contrib.tmux.profile.tmux_profile` uses
{attr}`~libvt.config.DeccolmBehavior.CLEAR_ONLY` so `tmux` retains
authoritative pane geometry, and {data}`~libvt.profiles.LINUX_CONSOLE_PROFILE`
uses {attr}`~libvt.config.DeccolmBehavior.IGNORE`.
`G0`–`G3` character-set designations ({type}`~libvt.config.Charset`) add `'U'`
(`IBM PC` / `CP437` `0xA0`–`0xFF` graphic mapping in `"latin-1"` parser mode).
{class}`~libvt.parser.Parser` adds {meth}`~libvt.parser.Parser.set_encoding`
and `allow_encoding_switch`, wired to
{attr}`ScreenBehavior.allow_encoding_switch <libvt.config.ScreenBehavior.allow_encoding_switch>`
(`False` by default; `True` on {data}`~libvt.profiles.LINUX_CONSOLE_PROFILE`)
for ISO-2022 `DOCS` (`ESC % G` / `ESC % @`) transitions,
{func}`~libvt.codec.explain` disassembles `ESC % G` and `ESC % @`, and
{meth}`Terminal.feed_str <libvt.terminal.Terminal.feed_str>` raises
{exc}`ValueError` when the wire encoding is `"latin-1"`.
#### Full-width display export and stateless snapshot history viewports (#59)
{class}`~libvt.terminal.Terminal`, {class}`~libvt.snapshot.Snapshot`,
{class}`~libvt.screen.Screen`, and {class}`~libvt.views.RegionView` add
`display_lines` (paired with
{attr}`RowView.display_text <libvt.views.RowView.display_text>`) returning
visible rows padded with trailing spaces to exact terminal-column width while
replacing wide glyphs clipped at slice boundaries with `" "`.
{meth}`Snapshot.viewport <libvt.snapshot.Snapshot.viewport>` returns an
immutable `(rows, cols)` {class}`~libvt.views.RegionView` shifted upward into
retained primary scrollback by `offset` rows without mutating live terminal
state or blending primary history into alternate-screen snapshots. See
{ref}`topics-migrating-from-pyte` for details.
#### Extended `tmux` pane metadata, layout resize, and in-place resync (#60)
{data}`~libvt.contrib.tmux.capture.TMUX_METADATA_FORMAT` and
{class}`~libvt.contrib.tmux.capture.TmuxPaneMetadata` capture `cursor_shape`,
`cursor_blinking`, `keypad_flag`, and `modify_other_keys` (`pane_key_mode`);
{class}`~libvt.contrib.tmux.capture.TmuxCaptureResult` exposes `metadata` and
`post_metadata`; {func}`~libvt.contrib.tmux.capture.build_tmux_capture_command`,
{func}`~libvt.contrib.tmux.capture.decode_tmux_capture`, and
{class}`~libvt.contrib.tmux.control.TmuxPaneSync` accept bounded `history_lines`
(`-S 0` / `-S -N`) and enable `capture-pane -F` on `tmux >= 3.7` (with
{func}`~libvt.contrib.tmux.profile.parse_tmux_version` accepting `"master"` and
`-<suffix>` tags). `TmuxPaneSync` resizes live panes from V1 and V2 JSON
`%layout-change` notifications and adds
{meth}`~libvt.contrib.tmux.control.TmuxPaneSync.resync` (also triggered on
`%pause` / `%continue` recovery) updating `sync.terminal` in place while
advancing its epoch for {class}`~libvt.snapshot.SyncToken` consumers.
### Documentation
- Expand {ref}`topics-migrating-from-pyte` with a `pyte` compatibility matrix,
documented omissions, and runnable doctests for coordinate indexing, legacy
encodings, `display_lines`, {meth}`~libvt.snapshot.Snapshot.viewport` paging,
dirty-row deltas, query replies, and `tmux` observation (#59).
## libvt 0.0.1a2 (2026-11-28)
`libvt` 0.0.1a2 splits {class}`~libvt.config.Profile` into capability groups
with {mod}`libvt.profiles` host presets, moves `tmux` support into decoupled
{mod}`libvt.contrib.tmux` submodules (adding
{class}`~libvt.contrib.tmux.control.TmuxControlParser` and sans-I/O
{class}`~libvt.contrib.tmux.control.TmuxPaneSync`), and narrows top-level
{mod}`libvt` behind lazy PEP 562 imports. It also converts
{class}`~libvt.events.Event` to an open base class with `OSC 633` shell
integration and `OSC 9`/`99`/`777` {class}`~libvt.events.Notification` events,
holds {attr}`Snapshot.appearance <libvt.snapshot.Snapshot.appearance>` across
`?2026` redraws, adds stateful `XTSMGRAPHICS`, `XTSAVE`/`XTRESTORE`, Kitty
alternate-key and associated-text encoding, and bidirectional
{class}`~libvt.aio.AsyncSession` writes, and certifies `PyPy 3.12` in CI. See
{doc}`topics/protocols-and-input`, {doc}`topics/sync-and-asyncio`, and
{doc}`migration` for upgrade details.
### Breaking changes
#### Curated PEP 562 `libvt` root namespace (#43)
Top-level {mod}`libvt` narrows `libvt.__all__` to a curated quickstart surface
({class}`~libvt.style.Appearance`, {class}`~libvt.views.Cell`,
{class}`~libvt.events.Event`, {exc}`~libvt.exc.LibVtError`,
{class}`~libvt.config.Limits`, {class}`~libvt.config.Policy`,
{class}`~libvt.config.Profile`, {exc}`~libvt.exc.ProtocolError`,
{class}`~libvt.screen.Screen`, {class}`~libvt.snapshot.Snapshot`,
{class}`~libvt.style.Style`, {class}`~libvt.terminal.Terminal`, `__version__`,
{func}`~libvt.terminal.render`, and {func}`~libvt.terminal.strip`) resolved
lazily via PEP 562 so `import libvt` and `pytest11` plugin discovery do not load
emulator modules or Unicode lookup tables. Import specialized classes and
helpers from their owning submodules:
```python
# Before
from libvt import AnsiColor, KeyEvent, Mode, Parser, explain
# After
from libvt.codec import explain
from libvt.input import KeyEvent
from libvt.modes import Mode
from libvt.parser import Parser
from libvt.style import AnsiColor
```
#### Passive-observer `Policy.emit_replies` and `ClipboardReadPolicy` (#40)
{class}`~libvt.config.Policy` removes `allow_checksum_report` and replaces
`allow_clipboard_read: bool` with
{attr}`~libvt.config.Policy.clipboard_read`
({class}`~libvt.config.ClipboardReadPolicy`, defaulting to
{attr}`~libvt.config.ClipboardReadPolicy.IGNORE`):
```python
# Before
from libvt.config import Policy
pol = Policy(allow_clipboard_read=True)
# After
from libvt.config import ClipboardReadPolicy, Policy
pol = Policy(clipboard_read=ClipboardReadPolicy.EMIT_EVENT)
```
#### Decoupled `libvt.contrib.tmux` submodules and core `tmux` removal (#39)
`libvt.tmux`, `Terminal.from_tmux_capture()`, `Snapshot.from_tmux_capture()`,
`Profile.tmux()`, {data}`~libvt.contrib.tmux.profile.TMUX_PROFILE`, and
{data}`~libvt.contrib.tmux.profile.TMUX_CAPTURE_POLICY` move into
decoupled {mod}`libvt.contrib.tmux` submodules
({mod}`libvt.contrib.tmux.profile`, {mod}`libvt.contrib.tmux.capture`, and
{mod}`libvt.contrib.tmux.control`) with {func}`~libvt.contrib.tmux.profile.tmux_profile`
accepting `sixel` and `clipboard` `DA1` flags:
```python
# Before
from libvt import TMUX_PROFILE, Terminal
term = Terminal.from_tmux_capture(lines, metadata=meta)
# After
from libvt.contrib.tmux.capture import decode_tmux_capture
from libvt.contrib.tmux.profile import TMUX_PROFILE, tmux_profile
term = decode_tmux_capture(lines, metadata=meta).terminal
```
#### Open `Event` base class and consolidated `TitleChanged` (#38)
{class}`~libvt.events.Event` is now an open keyword-only base class
(`kw_only=True, match_args=False`) rather than a closed union alias,
`WindowRenamed` folds into {class}`~libvt.events.TitleChanged` with
{class}`~libvt.events.TitleTarget`
({attr}`~libvt.events.TitleTarget.TMUX_WINDOW_NAME`), and
{class}`~libvt.events.WorkingDirectoryChanged` adds a
{attr}`~libvt.events.WorkingDirectoryChanged.source`
({class}`~libvt.events.CwdSource`) discriminator. Import
{type}`~libvt.events.KnownEvent` when static exhaustiveness over built-in core
events is required:
```python
# Before
from libvt.events import TitleChanged, WindowRenamed
match ev:
case WindowRenamed(name):
...
case TitleChanged(title):
...
# After
from libvt.events import TitleChanged, TitleTarget
match ev:
case TitleChanged(title=name, target=TitleTarget.TMUX_WINDOW_NAME):
...
case TitleChanged(title=title):
...
```
#### Capability-grouped `Profile` and `libvt.profiles` host presets (#37)
{class}`~libvt.config.Profile` replaces its flat attributes with frozen,
hashable capability dataclasses ({class}`~libvt.config.Identity`,
{class}`~libvt.config.QueryBehavior`, {class}`~libvt.config.ScreenBehavior`,
{class}`~libvt.config.InputBehavior`, and
{class}`~libvt.config.UnicodeBehavior`), and moves host-terminal presets
({data}`~libvt.profiles.XTERM_PROFILE` and
{data}`~libvt.profiles.LINUX_CONSOLE_PROFILE`, joined by
{data}`~libvt.profiles.GHOSTTY_PROFILE` and
{data}`~libvt.profiles.KITTY_PROFILE`) into {mod}`libvt.profiles`:
```python
# Before
from libvt.config import LINUX_CONSOLE_PROFILE, Profile
prof = Profile(reflow_on_resize=False, cursor_rgb=(1, 2, 3))
# After
from libvt.config import Profile, QueryBehavior, ScreenBehavior
from libvt.profiles import LINUX_CONSOLE_PROFILE
prof = Profile(
queries=QueryBehavior(cursor_rgb=(1, 2, 3)),
screen=ScreenBehavior(reflow_on_resize=False),
)
```
### What's new
#### `tmux` control-mode byte parser and sans-I/O pane sync (#27)
{mod}`libvt.contrib.tmux.control` adds
{class}`~libvt.contrib.tmux.control.TmuxControlParser` (streaming raw-byte
framing for `tmux -C` / `-CC` `%begin`/`%end`/`%error` command blocks,
`%output` / `%extended-output` octal payloads without split-UTF-8 loss,
`%pause`/`%continue`, `%layout-change`, `%subscription-changed`, and `%exit`
into {type}`~libvt.contrib.tmux.control.TmuxControlEvent` records) and
{class}`~libvt.contrib.tmux.control.TmuxPaneSync` (sans-I/O two-phase
`refresh-client -A '%N:pause'` barrier + atomic `capture-pane` /
`capture-pane -P -p -C` / `refresh-client -A '%N:continue'` handoff into live
`%output` streaming). See {ref}`topics-sync-and-asyncio` for details.
#### Desktop notifications for `OSC 9`, Kitty `OSC 99`, and `OSC 777` (#31)
{class}`~libvt.terminal.Terminal` parses iTerm2 `OSC 9` (filtering ConEmu
`9;1`–`9;12` subcommands), chunked Kitty `OSC 99` (`d=0`/`d=1`, `e=0`/`e=1`
Base64, `p=title`/`p=body`/`p=?`, `u=0..2`), and rxvt `OSC 777 ; notify`
sequences into sanitized {class}`~libvt.events.Notification` events
({class}`~libvt.events.NotificationSource`,
{class}`~libvt.events.NotificationUrgency`, included in
{type}`~libvt.events.KnownEvent`), gated on
{attr}`~libvt.config.Policy.allow_notifications`,
{attr}`~libvt.config.Policy.allow_notification_queries`,
{attr}`~libvt.config.Limits.max_pending_notifications`, and
{attr}`~libvt.config.Limits.max_notification_bytes`.
#### Stateful `XTSMGRAPHICS` color and geometry registers (#28)
{class}`~libvt.terminal.Terminal` implements stateful `XTSMGRAPHICS`
(`CSI ? Pi ; Pa ; Pv S`) `SIXEL` color-register (`Pi = 1`) and pixel-geometry
(`Pi = 2`) read, reset, set, and maximum queries (`Pa = 1..4`) gated on
{attr}`~libvt.config.Policy.track_graphics` and
{class}`~libvt.config.QueryBehavior`
({attr}`~libvt.config.QueryBehavior.xtsmgraphics_enabled`,
{attr}`~libvt.config.QueryBehavior.xtsmgraphics_geometry_enabled`,
{attr}`~libvt.config.QueryBehavior.xtsmgraphics_set_enabled`,
{attr}`~libvt.config.QueryBehavior.sixel_color_registers`, and
{attr}`~libvt.config.QueryBehavior.max_sixel_color_registers`), with host
presets in {mod}`libvt.profiles` and
{func}`~libvt.contrib.tmux.profile.tmux_profile` configured to match upstream
terminal behavior.
#### Kitty alternate keys and associated text (#30)
{class}`~libvt.input.KeyEvent` adds optional single-character
{attr}`~libvt.input.KeyEvent.shifted_key` and
{attr}`~libvt.input.KeyEvent.base_key` fields (with US-ASCII shifted keys
populated by {meth}`~libvt.input.KeyEvent.parse`), and
{func}`~libvt.input.encode_input` formats Kitty keyboard protocol flags
{attr}`~libvt.input.KittyKeyboardFlags.REPORT_ALTERNATE_KEYS` (`4`) and
{attr}`~libvt.input.KittyKeyboardFlags.REPORT_ASSOCIATED_TEXT` (`16`) into
`CSI key[:shifted[:base]] ; [mods[:event]] ; [text-codepoints] u` sequences.
#### `PyPy 3.12` CI certification and `TerminalTimeoutError` reduction fix (#32)
{exc}`~libvt.exc.TerminalTimeoutError` preserves `errno`, `strerror`, and
filenames across `pickle` protocols `0`–`5` when `args` is replaced with a
custom two-element tuple, and CI certifies `PyPy 3.12` (`UV_PYTHON=pypy@3.12`)
across `array('Q')` / `memoryview` rows, moving-GC cycles, and JIT throughput
benchmarks.
#### `XTSAVE`/`XTRESTORE`, legacy input modes, and `AsyncSession` (#29, #42)
{class}`~libvt.terminal.Terminal` implements `XTSAVE` (`CSI ? Pm s`) and
`XTRESTORE` (`CSI ? Pm r`) single-slot DEC private mode save/restore (gated on
{attr}`~libvt.config.ScreenBehavior.xtsave_enabled`), plus DEC modes `?8`
({attr}`~libvt.modes.Mode.AUTO_REPEAT`), `?66`
({attr}`~libvt.modes.Mode.APPLICATION_KEYPAD`, reconciled with `ESC =` /
`ESC >`), and `?67` ({attr}`~libvt.modes.Mode.BACKARROW_IS_BS`).
{class}`~libvt.input.MouseTracker` deduplicates same-cell `?1002` drag motion
outside stateless {meth}`~libvt.terminal.Terminal.encode`, and
{class}`~libvt.aio.AsyncTerminalStream` adds non-blocking outbound
{meth}`~libvt.aio.AsyncTerminalStream.send`,
{meth}`~libvt.aio.AsyncTerminalStream.send_event`,
{meth}`~libvt.aio.AsyncTerminalStream.send_key`,
{meth}`~libvt.aio.AsyncTerminalStream.paste`,
{meth}`~libvt.aio.AsyncTerminalStream.drain`, and
{meth}`~libvt.aio.AsyncTerminalStream.write_eof` methods under the shared
{class}`~libvt.aio.AsyncSession` protocol.
#### Committed `Snapshot.appearance`, `set_theme()`, and `DECSCNM` (`?5`) (#41)
{class}`~libvt.style.Appearance` captures active color scheme, default
foreground/background/cursor RGBs, `OSC 4` palette overrides, and DEC mode `?5`
({attr}`~libvt.modes.Mode.DECSCNM`) reverse video on
{attr}`~libvt.snapshot.Snapshot.appearance` and
{attr}`~libvt.snapshot.ScreenDelta.appearance_changed`, held atomically across
`?2026` synchronized updates and rendered in {class}`~libvt.format.Formatter`
HTML and VT output. {meth}`~libvt.terminal.Terminal.set_theme` updates host
theme defaults without clobbering guest `OSC 4` / `OSC 10`–`12` overrides and
emits `CSI ? 997 ; Ps n` when `?2031`
({attr}`~libvt.modes.Mode.COLOR_SCHEME_UPDATES`) is enabled.
#### Passive observer policy, `OSC 52` read events, and `at_ground_state` (#40)
{attr}`~libvt.config.Policy.emit_replies` (paired with
{data}`~libvt.contrib.tmux.profile.TMUX_OBSERVER_POLICY`) suppresses automatic
query and notification response bytes on passive observer streams without
mutating screen or event behavior. `OSC 52 ; <sel> ; ?` emits
{class}`~libvt.events.ClipboardReadRequested` under
{attr}`~libvt.config.ClipboardReadPolicy.EMIT_EVENT` for explicit responses via
{meth}`~libvt.terminal.Terminal.enqueue_reply`, and
{attr}`~libvt.parser.Parser.at_ground_state` /
{attr}`~libvt.terminal.Terminal.at_ground_state` report safe stream-splicing
boundaries.
#### `OSC 633` shell integration and dual `133`/`633` prompt deduplication (#38)
{class}`~libvt.terminal.Terminal` normalizes VS Code `OSC 633` markers (`A`–`D`
into {class}`~libvt.events.PromptZone` and {class}`~libvt.events.PromptMark`,
deduplicating same-cell `OSC 133` + `OSC 633` emissions while backfilling exit
codes; `633 ; E` into {class}`~libvt.events.ShellCommandReported`; and
`633 ; P` into {class}`~libvt.events.WorkingDirectoryChanged` or
{class}`~libvt.events.ShellPropertyChanged`). See
{doc}`topics/protocols-and-input` for details.
#### East Asian Ambiguous width and alternate-screen `RIS` axes (#37)
{attr}`~libvt.config.UnicodeBehavior.ambiguous_width` configures Unicode
`East_Asian_Width=A` characters (`1` cell by default, `2` cells for CJK legacy
layouts while keeping `U+FFFD` at width `1`), and
{attr}`~libvt.config.ScreenBehavior.ris_alt_screen` lets profiles preserve an
active alternate screen and saved primary buffer across `RIS` (`ESC c`).
## libvt 0.0.1a1 (2026-11-24)
`libvt` 0.0.1a1 adds `OSC 4` and `OSC 10`–`12` palette and dynamic color
queries, `XTMODKEYS` and `?1007` alternate-scroll input encoding,
cell-calibrated `?1016` pixel mouse coordinates, and chained `tmux` capture
bundles (`-N -T -F`). It also buffers outbound POSIX PTY writes above kernel
`TTYHOG` limits, expires stalled `?2026` holds on `EOF` and close, retains
`SIXEL` and Kitty graphics across `DECSTBM` scrolls and resize reflow, and
isolates per-terminal {class}`~libvt.snapshot.SyncToken` watermarks. See
{doc}`topics/protocols-and-input`, {doc}`topics/sync-and-asyncio`, and
{doc}`migration` for upgrade details.
### Breaking changes
#### Cell-calibrated `MouseEvent.pixel_x` and `pixel_y` defaults (#26)
{attr}`~libvt.input.MouseEvent.pixel_x` and
{attr}`~libvt.input.MouseEvent.pixel_y` now default to `None`
(`int | None = None`) instead of `0` so `?1016` SGR-Pixel encoding derives
cell-center pixel coordinates from `row`, `col`, and
{class}`~libvt.config.Profile` cell geometry unless explicit pixel coordinates
are supplied:
```python
# Before
ev = MouseEvent(button=MouseButton.LEFT, action=MouseAction.PRESS, row=2, col=3)
assert (ev.pixel_x, ev.pixel_y) == (0, 0)
# After
ev = MouseEvent(button=MouseButton.LEFT, action=MouseAction.PRESS, row=2, col=3)
assert (ev.pixel_x, ev.pixel_y) == (None, None) # encodes cell center (28, 40)
```
#### Scoped `CSI 5:3 m` overline decoding (#18)
{func}`~libvt.parser.parse_sgr` and live {meth}`~libvt.terminal.Terminal.feed`
ignore `CSI 5:3 m` (`5` with colon subparameter `3`, neither enabling overline
nor blink), matching `tmux` and `Ghostty` input parsing, while
{func}`~libvt.tmux.decode_tmux_capture` continues decoding `tmux`
`grid_string_cells_code`'s `5:3m` overline serialization:
```python
# Before
style = parse_sgr(CsiParams((5, 3), colon_mask=0b10)) # overline=True
# After
style = parse_sgr(CsiParams((53,))) # standard SGR 53 overline
res = decode_tmux_capture(["\x1b[5:3mOV\x1b[0m"], rows=1, cols=4)
```
#### Opaque per-terminal sync watermarks (#22)
{class}`~libvt.snapshot.SyncToken` keeps its watermark state private, disallows
direct instantiation, and renders a compact `repr()`. Read snapshot state from
{attr}`~libvt.snapshot.ScreenDelta.snapshot` rather than inspecting token
attributes directly:
```python
# Before
cur = tok.cursor
# After
delta = term.changes_since(tok)
cur = delta.snapshot.cursor
```
### What's new
#### `OSC 4`/`12` queries, `XTMODKEYS`, `?1007`, and pixel `?1016` (#26)
{class}`~libvt.terminal.Terminal` answers `OSC 4` / `OSC 104` 256-palette
overrides and queries, semicolon-chained `OSC 10`–`12` / `OSC 110`–`112`
foreground, background, and cursor color queries
({attr}`~libvt.config.Profile.cursor_rgb`), `DECRQM` across all ANSI and DEC
modes, `XTSMGRAPHICS` (`CSI ? Pi ; Pa ; Pv S` returning `\x1b[?{pi};3S`), and
`XTMODKEYS` (`CSI > 4 ; pv m` and `CSI ? 4 m` via
{attr}`~libvt.terminal.Terminal.modify_other_keys` and
{attr}`~libvt.screen.Screen.modify_other_keys`), while consuming `OSC 9`,
`OSC 99`, and `OSC 777` notifications silently.
{func}`~libvt.input.encode_input` and {meth}`~libvt.terminal.Terminal.encode`
encode `XTMODKEYS` levels `1` and `2`, default-enabled `?1007`
({attr}`~libvt.modes.Mode.ALTERNATE_SCROLL`) wheel-to-arrow presses on the
alternate screen, and cell-calibrated `?1016`
({attr}`~libvt.input.MouseEvent.pixel_x` /
{attr}`~libvt.input.MouseEvent.pixel_y`) mouse coordinates, while
{meth}`~libvt.terminal.Terminal.resize`, {func}`~libvt.aio.open_pty`, and
{meth}`~libvt.aio.PtySession.resize` report pixel dimensions in `?2048` and
`TIOCSWINSZ`.
#### Chained `tmux` capture bundles and `-N -T -F` wide-wrap decoding (#18)
{func}`~libvt.tmux.build_tmux_capture_command` and
{class}`~libvt.tmux.TmuxCaptureCommand` construct single-invocation `tmux`
command chains bracketing `capture-pane -S - -E - -e -p -N -T -F` (`-e -p -N
-T` + `-e -p -J` on `3.4`–`3.7`, `-e -p -N` + `-e -p -J` on `3.3a`) with
`display-message` metadata headers and footers so pane output cannot drift
mid-capture and trailing blank viewport lines survive line-splitting wrappers.
{func}`~libvt.tmux.decode_tmux_capture`,
{meth}`~libvt.terminal.Terminal.from_tmux_capture`, and
{meth}`~libvt.snapshot.Snapshot.from_tmux_capture` accept `trim_trailing=True`
to preserve explicit trailing spaces and disambiguate `GRID_FLAG_PADDING`
wide-wrap spacers in a single pass.
### Fixes
#### `BCE` hyperlinks, `SU` scrollback, `DEL` UTF-8 flush, and profiles (#25)
{class}`~libvt.terminal.Terminal` strips `OSC 8` hyperlinks from `BCE` blank
fills, pushes primary-screen `SU` (`CSI Ps S`) lines into scrollback when
unbounded horizontally, ignores non-`m` `CSI` sequences carrying `:`
subparameters while restricting {func}`~libvt.parser.parse_sgr` colons to
well-formed `4`/`38`/`48`/`58` groups, and flushes incomplete multi-byte UTF-8
sequences on `0x7F` (`DEL`) in {class}`~libvt.parser.Parser`. `DECSLRM` partial
scrolls preserve wide glyphs wholly inside `[left, right]`, and
{class}`~libvt.format.Formatter` restores `IRM`, `DECOM`, `DECLRMM`, and
`DECSCUSR` after rendering cells while padding `wrapped=True` rows to `cols`.
{class}`~libvt.config.Profile` splits {data}`~libvt.config.DEFAULT_PROFILE` and
{data}`~libvt.profiles.XTERM_PROFILE` (VT510 `DECSTR` mode set, shared primary
`DECSC`/`?1049h` save slot with isolated alternate `DECSC` slot, and
`SS2`/`SS3` single-shift preservation) from {data}`~libvt.config.TMUX_PROFILE`
({attr}`~libvt.config.Profile.declrmm_enabled` `False` so `CSI 5;10 s` saves
the cursor, {attr}`~libvt.config.Profile.top_margin_scrolls_to_history` `True`,
and {attr}`~libvt.config.Profile.separate_alt_save_cursor` `True`).
#### Buffered PTY writes, `?2026` EOF expiry, and frame-commit wakeups (#24)
{class}`~libvt.aio.PtySession` queues synchronous
{meth}`~libvt.aio.PtySession.send`, {meth}`~libvt.aio.PtySession.paste`, and
terminal query auto-replies onto a single bounded FIFO drained via
`loop.add_writer` with {meth}`~libvt.aio.PtySession.drain` high-water
backpressure, keeping bracketed pastes atomic above kernel `TTYHOG` limits
while flushing `?2048` replies inside {meth}`~libvt.aio.PtySession.resize` and
closing `master_fd` inside non-awaiting `finally` guards.
{class}`~libvt.aio.AsyncTerminalStream` and {class}`~libvt.aio.PtySession`
drive {meth}`~libvt.aio.AsyncTerminalStream.wait_for` and