Adds comments and a call to show cursor
This commit is contained in:
parent
48bedb4e12
commit
f040d8db6a
5
qline.go
5
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
|
||||
|
|
Loading…
Reference in New Issue