docs(design): KAL_TERM_CONTROL — terminal mode word gains control keystrokes, with the cross-repo plan - #37
Open
Sunrisepeak wants to merge 1 commit into
Open
Sunrisepeak wants to merge 1 commit into
Sunrisepeak wants to merge 1 commit into
Conversation
… keystrokes, with the cross-repo plan A design proposal, no implementation. Full design and task graph in .agents/docs/2026-09-18-kal-term-control-design.md; arising from consumer report mcpplibs/openkal-musl#36 (a program cannot enter raw mode or keep Ctrl+C from killing it). * The position pair. KAL_TERM_CONTROL (mode word bit 2): 1 = the environment consumes reserved control keystrokes, 0 = every keystroke is a byte, including 0x03. KAL_TERM_PROP_CONTROL (props word bit 2): the implementation distinguishes the position. * Why a third bit and not a fold into LINE_EDIT. readline turns line editing off and keeps control-key interruption on every platform (ICANON off + ISIG on; ENABLE_LINE_INPUT off + ENABLE_PROCESSED_INPUT on); the orthogonal bit is the native shape and the only 7.1-conformant one. * Why the props bit is not optional. For this position alone, clause 6.2's unassigned-reads-zero does not match released behaviour (openkal-linux preserves ISIG): a program that needs the keystrokes-are-data guarantee shall enquire kal_terminal_props first. Recorded as the normative exception, closed by the claim-is-a-claim principle of clause 7.11. * The dependency graph. openkal 0.14 (hard first) -> mcpp-index registration -> openkal-linux/windows/macos in parallel -> openkal-musl last (largest change: the ioctl dispatcher routes to kal_terminal_* and cfmakeraw becomes correct for free). Documents and comments carry no emoji.
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.
设计提案,不含实现。完整设计与任务依赖图:
.agents/docs/2026-09-18-kal-term-control-design.md。起因
消费者报告 mcpplibs/openkal-musl#36:程序无法进入 raw mode,也无法阻止 Ctrl+C 杀死自己。分析结论:使用侧无责;3/4 是 openkal-musl 端口缺陷,1/4 暴露规范缺口——三平台(Linux/macOS
ISIG、WindowsENABLE_PROCESSED_INPUT)都有本机开关一一对应"控制键是否作为数据上交",缺的只是规范里的一个词汇。方案要点
KAL_TERM_CONTROL(位 2):1 = 环境消费控制键(默认);0 = 保证每个键以字节到达,包括 0x03。KAL_TERM_PROP_CONTROL:必选。因为恰好对这个位,条款 6.2"未分配读 0"与已发布实现的真实行为(保留 ISIG)不符;依赖保证的程序须先查 props——写入条款 6.2 的规范性例外,由 7.11"声称即能做"原则收口。cfmakeraw本就清 ISIG,端口映射后现有全屏程序自动正确。任务依赖图
非目标:不改写 openkal 的"无信号"模型;SIG_IGN 静默 no-op 为 openkal-musl 侧独立修复,不在本设计内。
规范文档地址与逐条符合性核对见设计稿 §2.4。