Skip to content

Commit

Permalink
don't save history if not interactive/terminal
Browse files Browse the repository at this point in the history
  • Loading branch information
ldemailly committed Aug 8, 2024
1 parent 22e460e commit 2a0f33d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions terminal.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 2a0f33d

Please sign in to comment.