From 89223375943fb05c68c0822d7294d77482f233ce Mon Sep 17 00:00:00 2001 From: heathdutton Date: Wed, 21 Feb 2024 14:54:02 -0500 Subject: [PATCH] Add a [q] to quit option to REPL mode --- sgpt/handlers/repl_handler.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sgpt/handlers/repl_handler.py b/sgpt/handlers/repl_handler.py index df03f7df..cdf59870 100644 --- a/sgpt/handlers/repl_handler.py +++ b/sgpt/handlers/repl_handler.py @@ -32,7 +32,7 @@ def handle(self, init_prompt: str, **kwargs: Any) -> None: # type: ignore if not self.role.name == DefaultRoles.SHELL.value else ( "Entering shell REPL mode, type [e] to execute commands " - "or [d] to describe the commands, press Ctrl+C to exit." + "[d] to describe the commands or [q] to quit." ) ) typer.secho(info_message, fg="yellow") @@ -48,7 +48,7 @@ def handle(self, init_prompt: str, **kwargs: Any) -> None: # type: ignore prompt = typer.prompt(">>>", prompt_suffix=" ") if prompt == '"""': prompt = self._get_multiline_input() - if prompt == "exit()": + if prompt == "exit()" or prompt == "q": raise typer.Exit() if init_prompt: prompt = f"{init_prompt}\n\n\n{prompt}"