chzyer/readline

the serial terminal key is invalid or stuck

shiroming opened this issue · 0 comments

When the tty is /dev/ttyS0, readline gets the term width as 0 (stty size output is 0 0), resulting in invalid tab and infinite loop of arrow keys

w return is 0

readline/utils_unix.go

Lines 39 to 45 in 7f93d88

func GetScreenWidth() int {
w := getWidth(syscall.Stdout)
if w < 0 {
w = getWidth(syscall.Stderr)
}
return w
}