MoonshotAI / MoonshotAI/kimi-code
fix(tui): prevent Tabby scroll jumps during streamed output
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 7.5k
- Forks
- 1.2k
- Avg merge
- 11h 53m
- Merged PRs (30d)
- 350
Description
Problem
In Tabby, Kimi Code can jump the terminal viewport to the top while a response is streaming. The issue is most visible with long conversations and high-frequency output.
Reproduction
- Open Kimi Code in Tabby.
- Start or resume a conversation with enough transcript content to exceed the terminal height.
- Send a prompt that produces a streamed response.
- Observe that Tabby can leave the viewport at the top instead of following the active response.
Investigation
Kimi Code uses TuiMainScreen by default. Its full-redraw path emits CSI 2 J, CSI H, and CSI 3 J to clear and rebuild the main screen and scrollback. Streamed updates can exercise this path when changed content lies above the tracked viewport.
Tabby previously fixed a related fast-output viewport race in Eugeny/tabby#11102, released in v1.0.235. Using Kimi Code's existing alternate-screen renderer for Tabby avoids the destructive main-screen redraw and provides an application-owned scrollable transcript viewport.
Proposed fix
- Automatically select the existing
TuiAltScreenrenderer whenTERM_PROGRAM=tabby. - Preserve
KIMI_CODE_TUI_FULL_SCREEN=0as an explicit opt-out and=1as an explicit opt-in. - Add regression coverage for renderer selection and alternate-screen startup layout.
- Document the Tabby behavior in both environment-variable reference pages.
I have a tested patch ready and will open a PR after maintainer approval.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing renderer selection between TuiMainScreen and TuiAltScreen, including how KIMI_CODE_TUI_FULL_SCREEN and TERM_PROGRAM=tabby are handled. Add regression coverage for renderer selection and alternate-screen startup layout, then update both environment-variable reference pages to document the Tabby behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100