chzyer / readline

Readline is a pure go(golang) implementation for GNU-Readline kind library
MIT License
2.1k stars 280 forks source link

the serial terminal key is invalid or stuck #215

Open shiroming opened 2 years ago

shiroming commented 2 years ago

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 https://github.com/chzyer/readline/blob/7f93d88cd5ffa0e805d58d2f9fc3191be15ec668/utils_unix.go#L39-L45