Skip to content

feat(core): 滚动区域 DECSTBM (#29) - #235

Merged
JavaZeroo merged 4 commits into
mainfrom
feat/scroll-region
Oct 30, 2026
Merged

JavaZeroo merged 4 commits into
mainfrom
feat/scroll-region

Conversation

@JavaZeroo

Copy link
Copy Markdown
Owner

stacked on #234(IL/DL),合并 #234 后我会把 base 改回 main。

内容

实现 DECSTBM 滚动区域:

  • CSI Pt ; Pb r 设置滚动区域(1 基,默认全屏),最小两行;
  • 区域内的换行在边界处只滚动区域内部(上移、末行清空),不进回滚缓冲;全屏区域仍走原有历史路径;
  • IL/DL 的边界从整屏改为区域底边;
  • 区域外的行不受影响,光标停在区域底边而不是越界。

行为说明(需确认)

DECSTBM 会把光标归位到区域左上角(xterm 约定)。原版 WindTerm 的归位行为尚未观察,属于待确认项;如果你希望先按别的方式处理请告知。

测试

edit_csi_test 新增:4 行屏幕设为区域 2..3,写入 a/b/c/d 后连续两次换行 → a,c,"",d,区域外第 1、4 行不变,光标停在区域底边。

本地 edit csi contracts passed。

Refs #29

The parser accepts CSI r, line feeds scroll inside the margins without touching history, and IL/DL stop at the region bottom.
@JavaZeroo
JavaZeroo changed the base branch from feat/insert-delete-lines to main October 30, 2026 05:01
… refs #29

DECSTBM is implemented, so the matrix compares those records and the expected counts assume every plan now yields a real comparison.


The reference terminal calls goto(0,0) after setting the margins and ignores an invalid region; matching it removes the two differential differences and keeps the region test honest.
…ed counts refs #29

With every capability compared the summary omits core_unsupported, so the expectation lists only the three observed buckets.
@JavaZeroo
JavaZeroo merged commit ae00f84 into main Oct 30, 2026
9 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant