8000 Bugfix in invalidate code: PromptSession was invalidating the UI cont… · cool-RR/python-prompt-toolkit@a800ea4 · GitHub
[go: up one dir, main page]

Skip to content 8000

Commit a800ea4

Browse files
Bugfix in invalidate code: PromptSession was invalidating the UI continuously.
When the refresh interval is 0, which is the default in `PromptSession`, don't run a refresh loop. This significantly reduces CPU usage when idle.
1 parent 76a7560 commit a800ea4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

prompt_toolkit/application/application.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@ def _start_auto_refresh_task(self) -> None:
527527
Start a while/true loop in the background for automatic invalidation of
528528
the UI.
529529
"""
530-
if self.refresh_interval is not None:
530+
if self.refresh_interval not in (None, 0):
531531
refresh_interval = self.refresh_interval
532532

533533
async def auto_refresh() -> None:

0 commit comments

Comments
 (0)
0