Repository navigation
Expand file tree
/
Copy pathMIGRATION
More file actions
205 lines (159 loc) · 6.57 KB
/
Copy pathMIGRATION
File metadata and controls
205 lines (159 loc) · 6.57 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
# Migration notes
Migration and deprecation notes for `libvt` are recorded here; see
{ref}`changelog` as well.
`libvt` is in pre-alpha (`0.0.1a2`) and pre-1.0; pin `libvt>=0.0.1a2,<0.1` in
downstream projects (and `>=0.x,<0.y` once `0.1.0` is released).
---
## Upcoming Release
<!-- KEEP THIS PLACEHOLDER - DO NOT REMOVE OR MODIFY THIS LINE -->
_Detailed migration steps for the next version will be posted here._
<!-- END PLACEHOLDER - ADD NEW MIGRATION ENTRIES BELOW THIS LINE -->
## libvt 0.0.1a2 (2026-11-28)
### Curated PEP 562 `libvt` root exports (#43)
Top-level {mod}`libvt` now exports only {class}`~libvt.style.Appearance`,
{class}`~libvt.screen.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.terminal.Snapshot`, {class}`~libvt.style.Style`,
{class}`~libvt.terminal.Terminal`, `__version__`,
{func}`~libvt.terminal.render`, and {func}`~libvt.terminal.strip` via lazy PEP
562 attribute lookup. Import modes, styles, events, parsers, input encoders, and
sequence explainers from their owning submodules:
```python
# Before
from libvt import AnsiColor, KeyEvent, Mode, Parser, StopOn, 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
from libvt.terminal import StopOn
```
### `Policy.clipboard_read` and `allow_checksum_report` removal (#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`). Under
{attr}`~libvt.config.ClipboardReadPolicy.EMIT_EVENT`, `OSC 52 ; <sel> ; ?`
emits {class}`~libvt.events.ClipboardReadRequested` without fabricating empty
reply bytes; supply host clipboard replies explicitly via
{meth}`~libvt.terminal.Terminal.enqueue_reply`:
```python
# Before
pol = Policy(allow_clipboard_read=False, allow_checksum_report=False)
# After
from libvt.config import ClipboardReadPolicy, Policy
pol = Policy(clipboard_read=ClipboardReadPolicy.IGNORE)
```
### `libvt.contrib.tmux` submodules and `from_tmux_capture` removal (#39)
`tmux` profiles, `capture-pane` decoders, and `-CC` control-mode unescaping now
live in decoupled {mod}`libvt.contrib.tmux.profile`,
{mod}`libvt.contrib.tmux.capture`, and {mod}`libvt.contrib.tmux.control`
submodules (re-exported lazily on {mod}`libvt.contrib.tmux`), and core
{class}`~libvt.terminal.Terminal` / {class}`~libvt.terminal.Snapshot` no longer
carry `from_tmux_capture` constructors:
```python
# Before
from libvt import Profile, Snapshot, Terminal
from libvt.tmux import build_tmux_capture_command, unescape_tmux_control_output
prof = Profile.tmux("3.9")
term = Terminal.from_tmux_capture(lines, metadata=meta)
snap = Snapshot.from_tmux_capture(lines, metadata=meta)
# After
from libvt.contrib.tmux.capture import (
build_tmux_capture_command,
decode_tmux_capture,
)
from libvt.contrib.tmux.control import unescape_tmux_control_output
from libvt.contrib.tmux.profile import tmux_profile
prof = tmux_profile("3.9")
res = decode_tmux_capture(lines, metadata=meta)
term, snap = res.terminal, res.snapshot
```
### Open `Event` hierarchy and `WindowRenamed` consolidation (#38)
All event classes in {mod}`libvt.events` inherit from the open keyword-only
{class}`~libvt.events.Event` base class (`kw_only=True, match_args=False`), and
`WindowRenamed` is replaced by {class}`~libvt.events.TitleChanged` with
{attr}`~libvt.events.TitleTarget.TMUX_WINDOW_NAME`
({class}`~libvt.events.TitleTarget`). Switch positional `match` patterns to
keyword attributes, and annotate closed core-event handlers with
{type}`~libvt.events.KnownEvent`:
```python
# Before
from libvt.events import Event, TitleChanged, WindowRenamed
match event:
case WindowRenamed(name):
handle_tmux_rename(name)
case TitleChanged(title):
handle_title(title)
# After
from libvt.events import KnownEvent, TitleChanged, TitleTarget
match event:
case TitleChanged(title=name, target=TitleTarget.TMUX_WINDOW_NAME):
handle_tmux_rename(name)
case TitleChanged(title=title):
handle_title(title)
```
### Capability-grouped `Profile` and `libvt.profiles` presets (#37)
{class}`~libvt.config.Profile` organizes configuration into
{class}`~libvt.config.Identity`, {class}`~libvt.config.QueryBehavior`,
{class}`~libvt.config.ScreenBehavior`, {class}`~libvt.config.InputBehavior`,
and {class}`~libvt.config.UnicodeBehavior`, and host presets live in
{mod}`libvt.profiles`:
```python
# Before
from libvt.config import XTERM_PROFILE, Profile
prof = Profile(cell_width_px=10, cell_height_px=20)
term = Profile.linux_console()
# After
from libvt.config import Profile, ScreenBehavior
from libvt.profiles import LINUX_CONSOLE_PROFILE, XTERM_PROFILE
prof = Profile(screen=ScreenBehavior(cell_width_px=10, cell_height_px=20))
```
## libvt 0.0.1a1 (2026-11-24)
### `MouseEvent.pixel_x` and `pixel_y` default to `None` (#26)
{attr}`~libvt.input.MouseEvent.pixel_x` and
{attr}`~libvt.input.MouseEvent.pixel_y` now have type `int | None = None` so
`?1016` SGR-Pixel encoding derives cell-center coordinates when omitted; pass
`pixel_x=0, pixel_y=0` explicitly when origin `(0, 0)` pixels are intended:
```python
# Before
ev = MouseEvent(button=MouseButton.LEFT, action=MouseAction.PRESS, row=2, col=3)
# After (explicit origin pixels)
ev = MouseEvent(
button=MouseButton.LEFT,
action=MouseAction.PRESS,
row=2,
col=3,
pixel_x=0,
pixel_y=0,
)
```
### `CSI 5:3 m` overline scoped to `tmux` capture decoding (#18)
{func}`~libvt.parser.parse_sgr` and live {meth}`~libvt.terminal.Terminal.feed`
no longer treat `CSI 5:3 m` as overline (or blink); emit standard `CSI 53 m` on
live VT streams and pass `tmux capture-pane -e` output through
{func}`~libvt.tmux.decode_tmux_capture` or
{meth}`~libvt.terminal.Terminal.from_tmux_capture`:
```python
# Before
term.feed(b"\x1b[5:3moverline\x1b[0m")
# After
term.feed(b"\x1b[53moverline\x1b[0m")
cap_term = Terminal.from_tmux_capture(["\x1b[5:3moverline\x1b[0m"])
```
### Opaque `SyncToken` watermarks (#22)
{class}`~libvt.terminal.SyncToken` no longer exposes internal watermark fields
or direct construction; obtain tokens from
{meth}`~libvt.terminal.Terminal.sync_token` or
{attr}`~libvt.terminal.ScreenDelta.token` and inspect terminal state via
{attr}`~libvt.terminal.ScreenDelta.snapshot`:
```python
# Before
cur = tok.cursor
# After
delta = term.changes_since(tok)
cur = delta.snapshot.cursor
```