diff --git a/qline.go b/qline.go index 18dcc8f..99ffdeb 100644 --- a/qline.go +++ b/qline.go @@ -70,10 +70,11 @@ type buffer struct { func GetInput(prompt string, content string) string { termios.SetCharMode() cols, _ := termios.GetWindowSize() - b := buffer{make([]rune, 0, (len(content)+1)*2), 0, cols-len(prompt), 0, 0, prompt} + b := buffer{make([]rune, 0, (len(content)+1)*2), 0, cols-len(prompt), 0, len(prompt), prompt} + fmt.Print("\033[25h") // Make sure cursor is visible fmt.Print(prompt) - fmt.Print("\033[6n") + fmt.Print("\033[6n") // Query for cursor position var ch rune var err error