Fix for non-interactive mode when there is no terminal

Originally the code called Refresh(nil). This had handling for
non-interactive mode where the code would return without printing
a prompt. When issue169 was initially fixed, the interactive
part of this was mistakenly dropped. This puts the interactive
check back into the flow.
This commit is contained in:
Thomas O'Dowd 2022-03-16 11:59:53 +09:00
parent 45cb5208e8
commit 5407ea7a3c
1 changed files with 4 additions and 1 deletions

View File

@ -472,9 +472,12 @@ func (r *RuneBuffer) SetOffset(offset string) {
} }
func (r *RuneBuffer) Print() { func (r *RuneBuffer) Print() {
if !r.interactive {
return
}
r.Lock() r.Lock()
defer r.Unlock()
r.print() r.print()
r.Unlock()
} }
func (r *RuneBuffer) print() { func (r *RuneBuffer) print() {