You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
read on ConPTY active console: read -n1 hangs; plain read needs a second Enter to consume already-queued input #806
Activity
caomengxuan666 commentedon Oct 18, 2026
二分结论与修复面(PR #816):
引擎侧(本 PR 修复)——活动控制台 deadline 读三面:
wait_readable只 peek 队头记录:提交 Enter 的 key-RELEASE 卡队头时,其后可消费 key-down 永远不可见,read -t 2 -n1烧满 deadline 返 142(GNU select 0.2s 取键)。现批量 peek。ReadFile(1)把整行吸进 conhost pending 只吐首字节,门见空队列→142 且a="h",孤儿ello\r漏进下一个 reader(行被劈半)。one-char 下每键都是门可见 raw 记录,deadline 切割与 GNU select 对齐、行原子。宿主侧(niubash 跟进票素材,随 PR 归档提案 patch)——无 -t 的两面(
read -n1挂死、排队行丢首字节[ello])在引擎 standalone 上全部 GNU 一致(ConPTY/winpty 双后端 × debug/release × REPL/-i/-c 形,修复前 12/12 腿即绿),复现点在宿主 PasteChunkEditMode 的提交 Enter lookahead:它从内核队列吃走 typeahead 键存进程内 pushback 到下一个提示符,而命令拥有终端期间引擎 read 只读内核队列。实证:read 阻塞时新键z能完成读(K=[z]),被扣的键永不到达;宿主补丁(typed-submit 时 drain-then-prepend 写回控制台队列)后产品 A/C/G 三腿全绿、编辑器 typeahead 面不变(无 read 消费时键照常落回下一行编辑缓冲)。验收对照:
tests/interactivemarker 断言 10 腿(修复前 4 腿在 74e60b0 红)+ WSL GNU 5.3.0 pty oracle 差分表(见 PR)+ read 家族回归全绿(#701/#238 面不动)。Merge pull request #816 from unixwin/fix/806-read-conpty
Merge pull request #836 from unixwin/fix/806-nits
Merge master into fix/720-713 — failglob probe-fix is the same patch …
fix(read): canonical-console VEOF translation for Ctrl-D (niubash#684)