Repository navigation
feat(qt): retain source frame and paint display projection in formal Qt path (#29) - #310
Merged
Merged
Conversation
#29) The formal Qt path now keeps the retained source frame: SessionModel::resize uses Screen::resize_preserving, and TerminalWidget paints the independent display page from HistoryViewport::project. The protocol cursor stays a retained source position; display_cursor maps it to the caret cell used by painting, IME geometry and the preedit preview, and selection/hit consume the same page with its layout revision. Unsupported retained atoms fall back to the physical viewport page instead of hiding output. Add display_cursor_core and qt_terminal_modes_retained (real child -> fixed ConPTY -> core -> widget, public width-only 80x24 -> 60x24 resize). The new entry passes 12/12 contract checks: B/C/D stay retained, the reflowed display row 8 matches the native reflow byte for byte, CUP follows the confirmed retained-row contract, the display caret is the retained source cursor, and the display hit-test returns the retained source cell. Qt formal-path CTest 5/5, core CTest 36/36 with the new gate. The old six-stage --resize repro keeps its exact failure and is not used as a passing oracle; simultaneous width+height original viewport/scroll evidence remains the explicit next prerequisite. #27/#29 stay open. Co-authored-by: JavaZeroo <[email protected]>
This was referenced Nov 3, 2026
Open
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题与最终行为
承接 #29(接续 #27 / #308 / #309),把已确认的保留事务 + 独立显示投影接入正式 Qt 路径:
SessionModel::resize改走Screen::resize_preserving:变窄保留源 Cell、行身份与软续接,不再物理裁剪正文。TerminalWidget按当前宽度绘制HistoryViewport::project的显示页;协议光标保持源坐标,新增display_cursor只把它翻译为显示光标,供光标下划线、IME 候选位置与预编辑预览;选择/命中继续消费同一份ViewMapping,并用页面 layout revision 拒绝过期页。行为出口:新增
qt_terminal_modes_retained(真实 child → 固定 ConPTY → core → widget,公开 Qt resize 80×24→60×24 只缩宽)通过 12/12 契约检查:B/C/D 保留在源行;显示页第 8 行与原生重排逐字节一致,第 11 行重排CD;CUP 写入按已确认的保留行合同落在显示第 12 行;显示光标为保留源光标[0,2];命中(8,19)经 layout revision 返回源B格与列 79。Qt 正式路径 CTest 5/5,核心 CTest 36/36(含新display_cursor_core)。旧六阶段
--resize诊断保持原失败:stage 6 failed: core resize is not synchronized with the literal native B/CD rows,exit 1;未弱化、未设WILL_FAIL、不进默认 CI。该断言以原生 ConPTY 重排网格为产品 oracle,与已确认的保留行坐标层冲突;同时缩宽+缩高的原版视口/滚动与后续 CUP 仍是未决前置,本 PR 不据此改写旧失败。验证
display_cursor_core(显示光标契约:宽/窄重排、软续接片段、空硬行、尾部 padding、宽字后光标、截断页、继续输出);qt_terminal_modes_retained(真实链 12 项检查 + 原生/显示 hex 记录);qt_terminal_modes旧入口与旧--resize失败保留。experiments/shell/results/2026-11-03-qt-retained-display/validation.json。ctest -C Release -R '^(qt_cpp_(shell|resize)|qt_unicode_input|qt_terminal_modes(_retained)?)$'5/5;ctest -R "_core$"36/36;run_smoke.py ... --retained-contractexit 0;run_smoke.py ... --resizeexit 1(保留)。qt_terminal_modes_retained;旧 repro 仍只在显式配置运行。性能影响
未测量,不声明性能。绘制每次重建有界显示页(≤200 源行);没有帧率、内存或时延数字。
来源与限制