peterh / liner

Pure Go line editor with history, inspired by linenoise
MIT License
1.04k stars 132 forks source link

PasswordPrompt bug #103

Closed iikira closed 6 years ago

iikira commented 6 years ago

When the password prompt string is too long, and wrap to a new line, the input typed is displayed. linerbug

The input typed is not displayed.

import ( "github.com/peterh/liner" "strings" )

func main() { line := liner.NewLiner() line.PasswordPrompt(strings.Repeat("-", 200)) line.Close() }

peterh commented 6 years ago

Whether password or not, any prompt that is wider than the terminal causes liner to use fallback mode.

Can I suggest printing the lines you want before the password prompt separately, and making sure you use a short string as the password prompt?

iikira commented 6 years ago

alright...