From 2b01d5edb27a4dedfebd5fcf31869a1b22aca08a Mon Sep 17 00:00:00 2001 From: TorchedSammy <38820196+TorchedSammy@users.noreply.github.com> Date: Tue, 6 Apr 2021 21:12:19 -0400 Subject: [PATCH] feat: always print prompt on newline; complete missing linefeed - "\r" --- main.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index b7c36e9..5442458 100644 --- a/main.go +++ b/main.go @@ -14,7 +14,7 @@ import ( "github.com/akamensky/argparse" "github.com/bobappleyard/readline" "github.com/yuin/gopher-lua" - + "golang.org/x/term" ) const version = "0.3.1" @@ -111,6 +111,10 @@ func main() { } } RunInput(input) + + termwidth, _, err := term.GetSize(0) + if err != nil { continue } + fmt.Printf("\u001b[7m∆\u001b[0m" + strings.Repeat(" ", termwidth - 1) + "\r") } }