From ca796b5d5ed937922c301a43248019ce46ed4bb2 Mon Sep 17 00:00:00 2001 From: fyffyf <3517708329@qq.com> Date: Thu, 4 Jun 2026 20:28:22 +0800 Subject: [PATCH 1/2] fix: prevent idle cursor blink from forcing scroll to bottom in Linux terminals --- src/kimi_cli/ui/shell/prompt.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/kimi_cli/ui/shell/prompt.py b/src/kimi_cli/ui/shell/prompt.py index b820fe8a0..429093d85 100644 --- a/src/kimi_cli/ui/shell/prompt.py +++ b/src/kimi_cli/ui/shell/prompt.py @@ -1856,7 +1856,22 @@ async def _refresh() -> None: while True: app = get_app_or_none() if app is not None: - app.invalidate() + # Only redraw when not idle. Idle redraws cause the + # terminal to scroll to the bottom on every tick in + # some terminal emulators (GNOME Terminal, Konsole). + is_idle = ( + self._active_prompt_delegate() is None + and self._active_modal_delegate() is None + ) + if not is_idle: + app.invalidate() + else: + # Still clean up expired toasts to avoid leaks. + now = time.monotonic() + for pos in ("left", "right"): + queue = _toast_queues[pos] + while queue and queue[0].expires_at <= now: + queue.popleft() try: asyncio.get_running_loop() From 87956a01b229be1fd2798b11f1dd651b31cba62f Mon Sep 17 00:00:00 2001 From: fyffyf <3517708329@qq.com> Date: Fri, 5 Jun 2026 20:32:56 +0800 Subject: [PATCH 2/2] fix: also account for _fast_refresh_provider in idle check --- src/kimi_cli/ui/shell/prompt.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/kimi_cli/ui/shell/prompt.py b/src/kimi_cli/ui/shell/prompt.py index 429093d85..bffc9f611 100644 --- a/src/kimi_cli/ui/shell/prompt.py +++ b/src/kimi_cli/ui/shell/prompt.py @@ -1862,6 +1862,10 @@ async def _refresh() -> None: is_idle = ( self._active_prompt_delegate() is None and self._active_modal_delegate() is None + and not ( + self._fast_refresh_provider is not None + and self._fast_refresh_provider() + ) ) if not is_idle: app.invalidate()