Skip to content

feat(core): DECCKM/DECTCEM 模式位 (#28) - #232

Merged
JavaZeroo merged 4 commits into
mainfrom
feat/mode-foundation
Oct 30, 2026
Merged

JavaZeroo merged 4 commits into
mainfrom
feat/mode-foundation

Conversation

@JavaZeroo

Copy link
Copy Markdown
Owner

内容

补上 #28 计划中的模式位基础(状态层,本 PR 不接消费者):

序列 位 默认
CSI ? 1 h/l(DECCKM 应用光标键) bit 0 关
CSI ? 25 h/l(DECTCEM 光标可见) bit 1 开

Parser 暴露 mode_bits() / application_cursor_keys() / cursor_visible();其余私有 CSI 仍按原规则拒绝(strict 抛错、recovery 计数)。

测试

  • reply_test 新增 strict 模式断言:默认位正确、?1h+?25l 生效、?1l+?25h 复位;
  • alternate_mode_test 里两处"私有序列应被拒绝/忽略"的样例从 ?25l 换成仍未实现的 ?12l(因为 ?25l 现在是受支持模式)。

本地:reply_test、alternate_mode_test、experiments.core.test_recovery(35 tests)全部通过。

边界

  • 尚未接消费者:shell 键盘还不按 DECCKM 发送 ESC O A 等应用键序列,光标隐藏也还没影响绘制;这两项在下一片实现;
  • 不改变既有恢复语义。

Refs #28

Private ?1 and ?25 are parsed into two explicit mode bits with accessors, the strict-mode reply test covers them, and the unsupported private samples move to an unimplemented sequence.
…ection case refs #28

Cursor visibility is handled now, so the strict-mode negative sample moves to an unimplemented private mode.
The keyboard encoder takes the application-cursor flag, the shell passes the parser mode bit, and keyboard_test covers the SS3 forms plus the unchanged modified and editing keys.
The candidate terminal does not expose the mode bit yet, so the helper returns false there instead of referencing a method it lacks.
@JavaZeroo
JavaZeroo merged commit 5ce552a into main Oct 30, 2026
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