Skip to content

Conversation

@cebtenzzre
Copy link

On macOS, you can't just pass the string 1234 to this ioctl, it needs to be 8 bytes:

>>> import fcntl, termios
>>> fcntl.ioctl(0, termios.TIOCGWINSZ, "1234")
Traceback (most recent call last):
  File "<python-input-1>", line 1, in <module>
    fcntl.ioctl(0, termios.TIOCGWINSZ, "1234")
    ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SystemError: buffer overflow

But shutil provides a cross-platform way to get the terminal width, which we should just use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant