Repository navigation
Done
Labels
enhancementNew feature or request
Description
Summary
Wave 1 leaf slice of #34: replace flat attributes and peer-named constructors on Profile with frozen, hashable capability dataclasses (Identity, QueryBehavior, ScreenBehavior, InputBehavior, UnicodeBehavior including East Asian ambiguous_width), and place pure host-terminal presets in src/libvt/profiles.py. Landing these peer-neutral axes first unblocks libvt.contrib.tmux.profile in Wave 2 without peer-name branches in Terminal or Screen.
Motivation
Profilemixes terminal identification strings, query replies, reset semantics, input flags, and peer-specific fields (tmux_window_rename) in one flat dataclass whileProfile.tmux()embeds tmux version rules insidesrc/libvt/config.py.src/libvt/_ucd.pyandsrc/libvt/screen.pyhard-code East Asian Ambiguous (EA=A) codepoints to1cell with no profile axis for2-column CJK legacy layouts (ambiguous_width: Literal[1, 2] = 1).- Upstream
tmuxpane quirks verified in Movetmuxtolibvt.contrib.tmuxand harden pre-0.1core APIs #34 (RISin?1049hkeepingalternate_onandsaved_grid, silentXTGETTCAP/CSI ? u/DECSTR, enabledDECRQSS, and parameterizedDA1) need orthogonal capability fields onProfilesoterminal.pynever inspects profile names.
Proposal
- Decompose
Profileinsrc/libvt/config.pyinto nested@dataclass(frozen=True, slots=True)capability groups (identity: Identity,queries: QueryBehavior,screen: ScreenBehavior,input: InputBehavior,unicode: UnicodeBehavior) using enums, literals, ints, bools, and byte/string tuples only (no callables, preservinghash()and equality). - Include
ambiguous_width: t.Literal[1, 2] = 1onUnicodeBehaviorand wirechar_width/display_widthandScreengrapheme-width measurement to consult it while keepingU+FFFDwidth1and Emoji presentation (VS16/RGI) width2. - Express
RISalternate-screen behavior,DECSTRsupport,XTGETTCAP/DECRQSS/CSI ? uquery replies, andESC k .. STtitle routing (allow_esc_k_title) as genericScreenBehaviorandQueryBehaviorfields rather thantmux_*-named booleans. - Add
src/libvt/profiles.pyhousing frozen host-terminal presets (XTERM_PROFILE,LINUX_CONSOLE_PROFILE,KITTY_PROFILE,GHOSTTY_PROFILE) built strictly fromProfiledata, leavingDEFAULT_PROFILEinsrc/libvt/config.py.
Alternatives
- Adding a
dialect: Literal["xterm", "tmux", ...]field onProfileand branching on it insidesrc/libvt/terminal.py: rejected because every new peer integration inlibvt.contrib.<peer>would require coreterminal.pyedits instead of composing existing capability fields.
References
- Design specification and roadmap: Move
tmuxtolibvt.contrib.tmuxand harden pre-0.1core APIs #34,0.0.xto0.1.0and beyond Roadmap #35 - Files touched at 6c33073:
src/libvt/config.py,src/libvt/_ucd.py,src/libvt/screen.py,src/libvt/terminal.py
Metadata
Metadata
Assignees
Labels
enhancementNew feature or request
Type
Projects
- StatusShow more project fieldsDone
Activity
0.1.0API waves aroundterminal.pyserialization #36tmuxinto decoupledlibvt.contrib.tmuxsubmodules #39libvt.__all__behind PEP 562 and gatepytest11imports #43