Commit e86573a
fix: 修复 -r 模式下键盘输入无响应
两个根因:
1. earlyInput 的 readableHandler 残留在 stdin 上
setAppCallbacks() 在反编译项目中从未被调用,导致
stopCapturingEarlyInput() 是 no-op,readableHandler
在 Ink 的 handleReadable 之前消费所有 stdin 数据。
修复:在 handleSetRawMode(true) 时移除非自身的 readable listeners。
2. React 19 layout effect cleanup 顺序问题
React 19 先运行新树的 layout effects,再清理旧树。
当旧树(showSetupDialog)比新树(launchResumeChooser)
有更多 useInput hooks 时,旧树 cleanup 把
rawModeEnabledCount 降到 0,错误关闭 raw mode。
修复:当 count=0 但仍有活跃 EventEmitter listeners 时恢复 count。
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent 3e1c6bc commit e86573a
2 files changed
Lines changed: 26 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
315 | 315 | | |
316 | 316 | | |
317 | 317 | | |
318 | | - | |
319 | | - | |
| 318 | + | |
| 319 | + | |
320 | 320 | | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
321 | 333 | | |
322 | 334 | | |
323 | 335 | | |
| |||
363 | 375 | | |
364 | 376 | | |
365 | 377 | | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
366 | 389 | | |
367 | 390 | | |
368 | 391 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
171 | | - | |
| 171 | + | |
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
| |||
0 commit comments