From de06101becf98abc802f1bf667640d5fbe9c71f4 Mon Sep 17 00:00:00 2001 From: Roland Walker Date: Mon, 23 Feb 2026 05:25:05 -0500 Subject: [PATCH] fix missing keepalives in \e prompt loop by passing the inputhook value to handle_editor_command() --- changelog.md | 1 + mycli/main.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index 496cf134..130f44b1 100644 --- a/changelog.md +++ b/changelog.md @@ -10,6 +10,7 @@ Bug Fixes --------- * Let interactive changes to the prompt format respect dynamically-computed values. * Better handle arguments to `system cd`. +* Fix missing keepalives in `\e` prompt loop. 1.56.0 (2026/02/23) diff --git a/mycli/main.py b/mycli/main.py index a93aa6ba..f7e05b33 100755 --- a/mycli/main.py +++ b/mycli/main.py @@ -785,6 +785,7 @@ def _connect(retry_ssl: bool = False, retry_password: bool = False) -> None: def handle_editor_command( self, text: str, + inputhook: Callable | None, loaded_message_fn: Callable, ) -> str: r"""Editor command is any query that is prefixed or suffixed by a '\e'. @@ -809,9 +810,9 @@ def handle_editor_command( while True: try: assert isinstance(self.prompt_app, PromptSession) - # buglet: this prompt() invocation doesn't have an inputhook for keepalive pings text = self.prompt_app.prompt( default=sql, + inputhook=inputhook, message=loaded_message_fn, ) break @@ -1066,6 +1067,7 @@ def one_iteration(text: str | None = None) -> None: try: text = self.handle_editor_command( text, + inputhook, loaded_message_fn, ) except RuntimeError as e: