ctrl+c on empty line exits (#135)

This commit is contained in:
Michael Yang 2023-07-20 00:53:08 -07:00 committed by GitHub
parent 3b135ac963
commit 55b5f5dc34
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -276,6 +276,10 @@ func generateInteractive(cmd *cobra.Command, model string) error {
case errors.Is(err, io.EOF):
return nil
case errors.Is(err, readline.ErrInterrupt):
if line == "" {
return nil
}
continue
case err != nil:
return err