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
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)