From 5407ea7a3c42d5b0d89f3889d4368e51dc941566 Mon Sep 17 00:00:00 2001 From: Thomas O'Dowd Date: Wed, 16 Mar 2022 11:59:53 +0900 Subject: [PATCH] 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. --- runebuf.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/runebuf.go b/runebuf.go index 432ab59..5b63955 100644 --- a/runebuf.go +++ b/runebuf.go @@ -472,9 +472,12 @@ func (r *RuneBuffer) SetOffset(offset string) { } func (r *RuneBuffer) Print() { + if !r.interactive { + return + } r.Lock() + defer r.Unlock() r.print() - r.Unlock() } func (r *RuneBuffer) print() {