add OLLAMA_NOHISTORY to turn off history in interactive mode (#4508)

This commit is contained in:
Patrick Devine 2024-05-18 11:51:57 -07:00 committed by GitHub
parent ba04afc9a4
commit 105186aa17
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 30 additions and 5 deletions

View file

@ -182,6 +182,10 @@ func generateInteractive(cmd *cobra.Command, opts runOptions) error {
return err
}
if os.Getenv("OLLAMA_NOHISTORY") != "" {
scanner.HistoryDisable()
}
fmt.Print(readline.StartBracketedPaste)
defer fmt.Printf(readline.EndBracketedPaste)