Skip to content

Commit

Permalink
feat: stop for copying only if override auto is not set
Browse files Browse the repository at this point in the history
  • Loading branch information
0xbrayo committed Nov 8, 2024
1 parent ec64640 commit 33693fc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions gptme/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,12 +175,14 @@ def ask_execute(question="Execute code?", default=True) -> bool: # pragma: no c
answer = console.input(
f"[bold bright_yellow on red] {question} {choicestr}{copystr} [/] ",
)
if copiable and "c" == answer.lower().strip():

global override_auto

if not override_auto and copiable and "c" == answer.lower().strip():
if copy():
print("Copied to clipboard.")
return False

global override_auto
if answer.lower() in [
"auto"
]: # secret option to stop asking for the rest of the session
Expand Down

0 comments on commit 33693fc

Please sign in to comment.