Skip to content

fix(tui): reduce frequent full-screen redraws - #2442

Merged
liruifengv merged 1 commit into
mainfrom
fix/tui-full-redraws
Jul 31, 2026
Merged

fix(tui): reduce frequent full-screen redraws#2442
liruifengv merged 1 commit into
mainfrom
fix/tui-full-redraws

Conversation

@liruifengv

Copy link
Copy Markdown
Collaborator

Related Issue

N/A — the problem is explained in the next section.

Problem

Several frequent TUI interactions forced a destructive full-screen redraw (clear screen + clear scrollback + repaint everything): toggling tool output expansion with Ctrl+O, closing any mountEditorReplacement dialog or selector, dismissing the autocomplete menu, and resetting the session via /clear or /new. On long sessions this caused visible full-screen flicker and wiped the terminal scrollback, so users lost the ability to scroll up.

What changed

Removed the four app-level forced full renders so these interactions go through pi-tui's differential renderer instead:

  • Ctrl+O expand/collapse (toggleToolOutputExpansion) now requests a normal render.
  • Session reset (/clear, /new, session switch) no longer forces a redraw explicitly.
  • restoreEditor (used when closing every dialog/selector) drops the overflow probe and tmux special case; it renders differentially.
  • The autocomplete-close full-render machinery in the custom editor (render-edge tracking + forced redraw) is removed entirely.

Notes:

  • Engine-level fallback full renders in pi-tui (e.g. when a change lands above the current viewport, as with /clear on a tall transcript) are intentionally untouched in this PR.
  • Accepted side effect: after a tall dialog or the autocomplete menu closes, the editor may sit a few rows above the bottom (blank tail) until the next output appends.
  • Tests: the obsolete test block that pinned the removed autocomplete-close behavior was deleted; the Ctrl+O, /btw, replay, and startup suites all pass (235 tests), plus tsc --noEmit and oxlint are clean.

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue, or explained the problem above.
  • I have added tests that prove my feature works.
  • Ran gen-changesets skill, or this PR needs no changeset.
  • Ran gen-docs skill, or this PR needs no doc update.

@changeset-bot

changeset-bot Bot commented Jul 31, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 47ab1f4

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@moonshot-ai/kimi-code Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented Jul 31, 2026

Copy link
Copy Markdown
pnpm dlx https://pkg.pr.new/@moonshot-ai/kimi-code@47ab1f4
npx https://pkg.pr.new/@moonshot-ai/kimi-code@47ab1f4

commit: 47ab1f4

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 47ab1f4d18

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread apps/kimi-code/src/tui/kimi-tui.ts
@liruifengv
liruifengv merged commit bb2919e into main Jul 31, 2026
24 of 25 checks passed
@liruifengv
liruifengv deleted the fix/tui-full-redraws branch July 31, 2026 03:35
@github-actions github-actions Bot mentioned this pull request Jul 31, 2026
Pidbid added a commit to Pidbid/kkm that referenced this pull request Jul 31, 2026
Pidbid added a commit to Pidbid/kkm that referenced this pull request Jul 31, 2026
Pidbid added a commit to Pidbid/kkm that referenced this pull request Jul 31, 2026
Pidbid added a commit to Pidbid/kkm that referenced this pull request Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant