Performance Regression Cluster: Typing lag, modal freezes, and PTY corruption #2250
Unanswered
wowlegend
asked this question in
Kimi for Coding
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
This is a cluster of 4 related performance/reliability issues that all stem from the same rendering pipeline. I've opened separate issues for each, but they should be tracked together since fixing the root cause (synchronous rendering overhead + missing PTY allocation) would resolve most of them.
The Issues
render_to_ansi()creates a newrich.Consoleon every keystroke + 10 Hz forced redraws + completion engine fires on hidden input buffers_render_bottom_toolbar()polls git subprocesses on every prompt_toolkit redrawstdin.close()+ no PTY allocation causes race between subprocess and prompt_toolkit over/dev/ttyssh-add,sudo,npm init) corrupt terminal input or hangCommon Thread: Rendering Pipeline
Issues #2032 and #2038 both trace back to synchronous, unthrottled rendering in the prompt_toolkit UI layer:
_render_bottom_toolbar()and modal delegates recompute everything on every redrawrender_to_ansi()instantiates a newrich.Consoleper callstart_completion()runs even when the buffer is a hidden text fieldIssue #2037 is architectural: the Shell tool needs PTY allocation or terminal yielding to handle interactive subprocesses correctly (Claude Code, Gemini CLI, and Codex CLI all do this).
What I've Already Done
I've locally patched #2032 with three changes:
After patching, inline input feels instant in Ghostty. I've shared the full root cause analysis and suggested fixes in each issue above.
Ask
Could a maintainer acknowledge this cluster and indicate which fixes (if any) are on the roadmap? Happy to open PRs for the rendering patches if that would help.
Beta Was this translation helpful? Give feedback.
All reactions