Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a [q] to quit option to REPL mode #490

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions sgpt/handlers/repl_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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}"
Expand Down