From 79b783ec43ae2abbe4ed768c9a8210dc34418eb1 Mon Sep 17 00:00:00 2001 From: Kevin Van Brunt Date: Fri, 21 Aug 2026 14:00:38 -0400 Subject: [PATCH] Enabled Ctrl-Z suspension at the prompt --- CHANGELOG.md | 5 +++++ cmd2/cmd2.py | 3 +++ 2 files changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f01dcec70..2f72d081a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## 4.2.1 (TBD) + +- Enhancements + - Enabled Ctrl-Z suspension at the prompt + ## 4.2.0 (August 6, 2026) - Enhancements diff --git a/cmd2/cmd2.py b/cmd2/cmd2.py index 3bfb4574a..45bf8bbe2 100644 --- a/cmd2/cmd2.py +++ b/cmd2/cmd2.py @@ -785,6 +785,7 @@ def _(event: Any) -> None: # pragma: no cover "complete_in_thread": complete_in_thread, "complete_while_typing": False, "completer": Cmd2Completer(self), + "enable_suspend": True, "history": Cmd2History(item.raw for item in self.history), "key_bindings": key_bindings, "lexer": Cmd2Lexer(self), @@ -3613,6 +3614,7 @@ def read_input( complete_in_thread=self.main_session.complete_in_thread, complete_while_typing=self.main_session.complete_while_typing, completer=completer_to_use, + enable_suspend=self.main_session.enable_suspend, history=InMemoryHistory(history) if history is not None else InMemoryHistory(), key_bindings=self.main_session.key_bindings, input=self.main_session.input, @@ -3635,6 +3637,7 @@ def read_secret( """ temp_session: PromptSession[str] = PromptSession( color_depth=self.main_session.color_depth, + enable_suspend=self.main_session.enable_suspend, input=self.main_session.input, output=self.main_session.output, style=self.main_session.style,