From 2a0f33d0122a634da6ab319c235a993ca50e8d07 Mon Sep 17 00:00:00 2001 From: Laurent Demailly Date: Thu, 8 Aug 2024 13:24:57 -0700 Subject: [PATCH] don't save history if not interactive/terminal --- terminal.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/terminal.go b/terminal.go index 2975ef9..f31a5f3 100644 --- a/terminal.go +++ b/terminal.go @@ -104,6 +104,10 @@ func (t *Terminal) LoggerSetup() { } func (t *Terminal) SetHistoryFile(f string) { + if !t.IsTerminal() { + log.Infof("Not a terminal, not setting history file") + return + } t.historyFile = f entries := readOrCreateHistory(f) for _, e := range entries {