rikhuijzer / ata

Ask the Terminal Anything (ATA): ChatGPT in the terminal
MIT License
274 stars 17 forks source link

Cancel should have cooldown #16

Closed rikhuijzer closed 1 year ago

rikhuijzer commented 1 year ago

When canceling a prompt with CTRL + C, it is very tricky to ensure that the stream doesn't end at the same time. If that happens, ata will shut down.

To solve this, there should be a timeout of a few seconds after the stream has finished in which CTRL + C is ignored.

rikhuijzer commented 1 year ago

Or do the same as Node.js:

$ node
Welcome to Node.js v16.17.1.
Type ".help" for more information.
>
(To exit, press Ctrl+C again or Ctrl+D or type .exit)
>