fix reading from tty

This commit is contained in:
Kovid Goyal
2022-08-22 15:18:12 +05:30
parent 3a7d26a3ef
commit eec8f04e93
2 changed files with 7 additions and 7 deletions

View File

@@ -132,7 +132,7 @@ func do_tty_io(tty TTYIO, input utils.Reader, no_response bool, response_timeout
buf := make([]byte, 0, utils.DEFAULT_IO_BUFFER_SIZE)
for !response_received {
buf = buf[:0]
buf = buf[:cap(buf)]
var n int
n, err = tty.ReadWithTimeout(buf, response_timeout)
if err != nil {