feat: always print prompt on newline; complete missing linefeed - "\r"

pull/26/head
TorchedSammy 2021-04-06 21:12:19 -04:00
parent c0f34fd784
commit 2b01d5edb2
1 changed files with 5 additions and 1 deletions

View File

@ -14,7 +14,7 @@ import (
"github.com/akamensky/argparse" "github.com/akamensky/argparse"
"github.com/bobappleyard/readline" "github.com/bobappleyard/readline"
"github.com/yuin/gopher-lua" "github.com/yuin/gopher-lua"
"golang.org/x/term"
) )
const version = "0.3.1" const version = "0.3.1"
@ -111,6 +111,10 @@ func main() {
} }
} }
RunInput(input) RunInput(input)
termwidth, _, err := term.GetSize(0)
if err != nil { continue }
fmt.Printf("\u001b[7m∆\u001b[0m" + strings.Repeat(" ", termwidth - 1) + "\r")
} }
} }