mirror of
https://github.com/MoonshotAI/kimi-code.git
synced 2026-07-09 17:29:12 +00:00
fix(tui): restore terminal state on crash and release leaked resources (#1272)
* fix(tui): restore terminal state on crash and release leaked resources Restore raw mode, cursor, and flow control on uncaughtException, unhandledRejection, and SIGTERM cleanup failure; reclaim pasted image bytes when transcript entries are trimmed; and stop feedback, activity, transcript, footer, and editor timers during shutdown. * fix(tui): keep crash handlers installed and attach stty to the tty Keep uncaughtException / unhandledRejection handlers installed for the whole interactive session; removing them right after start() resolved left runtime crashes uncaught. Run stty with stdin inherited from the TTY, since stty fails when stdin is /dev/null.
This commit is contained in:
parent
b905dd4910
commit
54703d9457
13 changed files with 251 additions and 40 deletions
5
.changeset/release-tui-resources.md
Normal file
5
.changeset/release-tui-resources.md
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
"@moonshot-ai/kimi-code": patch
|
||||
---
|
||||
|
||||
Release pasted images and streaming timers once they are no longer shown, so memory stops growing in long sessions.
|
||||
5
.changeset/restore-terminal-on-crash.md
Normal file
5
.changeset/restore-terminal-on-crash.md
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
"@moonshot-ai/kimi-code": patch
|
||||
---
|
||||
|
||||
Fix the terminal being left in raw mode with a hidden cursor and disabled flow control after a crash or abrupt exit.
|
||||
Loading…
Add table
Add a link
Reference in a new issue