Skip to content

Commit

Permalink
Fix terminal size in tox commands (tox-dev#2999)
Browse files Browse the repository at this point in the history
  • Loading branch information
ziima committed Oct 13, 2023
1 parent 9ebcfef commit 8d56177
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/changelog/2999.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix terminal size of tox subcommands (fixes ipython, ipdb, prompt_toolkit, ...).
2 changes: 1 addition & 1 deletion src/tox/execute/local_sub_process/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ def _pty(key: str) -> tuple[int, int] | None:
# adjust sub-process terminal size
columns, lines = shutil.get_terminal_size(fallback=(-1, -1))
if columns != -1 and lines != -1:
size = struct.pack("HHHH", columns, lines, 0, 0)
size = struct.pack("HHHH", lines, columns, 0, 0)
fcntl.ioctl(child, termios.TIOCSWINSZ, size)

return main, child
Expand Down

0 comments on commit 8d56177

Please sign in to comment.