Skip to content

Commit

Permalink
Fixed: minor bug in new cursor logic (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
signebedi committed Apr 2, 2023
1 parent 50e3460 commit 825804c
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions gptty/gptty.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,12 +164,9 @@ async def create_chat_room(configs=get_config_data(), log_responses:bool=True, c

# handle keyboard interrupt
except KeyboardInterrupt:
i = None
i = False

if not i:
continue
elif prompt_length < 1:
click.echo('\nPlease provide an actual prompt.\n')
if i == False:
continue
elif i.strip() in [':help',':h']:
click.echo(HELP)
Expand All @@ -185,11 +182,10 @@ async def create_chat_room(configs=get_config_data(), log_responses:bool=True, c
# c = f'{"|".join(f"{row[]}" for index,row in df.iterrows())}'.replace('|','\n')
click.echo (f'\n{df}\n')
continue
elif i.strip().startswith(':'):
click.echo('\nPlease provide a valid command.\n')
elif i.strip().startswith(':') or prompt_length < 1:
click.echo('\nPlease provide a valid command or prompt.\n')
continue


# click.echo the question in color
print(f"\n{CYAN}[{configs['your_name']}] {question}{RESET} \n", end="", flush=True)

Expand Down

0 comments on commit 825804c

Please sign in to comment.