Merge pull request 'Handle input errors while returning to correct terminal mode' (#186) from handle_input_errors into release2.3.3

Reviewed-on: #186
This commit is contained in:
Sloom Sloum Sluom IV 2020-09-08 04:18:07 +00:00
commit 26a5e3869d
1 changed files with 1 additions and 1 deletions

View File

@ -102,6 +102,7 @@ func Getch() rune {
func GetLine(prefix string) (string, error) {
termios.SetLineMode()
defer termios.SetCharMode()
reader := bufio.NewReader(os.Stdin)
fmt.Print(prefix)
@ -110,7 +111,6 @@ func GetLine(prefix string) (string, error) {
return "", err
}
termios.SetCharMode()
return text[:len(text)-1], nil
}