We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ba193d1 commit 9c51496Copy full SHA for 9c51496
invoke/terminals.py
@@ -243,6 +243,7 @@ def bytes_to_read(input_: IO) -> int:
243
# it's not a tty but has a fileno, or vice versa; neither is typically
244
# going to work re: ioctl().
245
if not WINDOWS and isatty(input_) and has_fileno(input_):
246
- fionread = fcntl.ioctl(input_, termios.FIONREAD, b" ")
247
- return int(struct.unpack("h", fionread)[0])
+ arg = bytes(bytearray(struct.calcsize("i")))
+ fionread = fcntl.ioctl(input_, termios.FIONREAD, arg)
248
+ return int(struct.unpack("i", fionread)[0])
249
return 1
0 commit comments