mirror of
https://github.com/ollama/ollama.git
synced 2025-07-13 00:57:13 +02:00
ctrl+c on empty line exits (#135)
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user