fix termsz on windows

This commit is contained in:
ed
2025-12-11 16:41:55 +00:00
parent 1b0eb45032
commit 7d526eaba3
2 changed files with 14 additions and 3 deletions

View File

@@ -1,8 +1,8 @@
#!/usr/bin/env python3
from __future__ import print_function, unicode_literals
S_VERSION = "2.15"
S_BUILD_DT = "2025-10-25"
S_VERSION = "2.16"
S_BUILD_DT = "2025-12-11"
"""
u2c.py: upload to copyparty
@@ -492,6 +492,12 @@ print = safe_print if VT100 else flushing_print
def termsize():
try:
w, h = os.get_terminal_size()
return w, h
except:
pass
env = os.environ
def ioctl_GWINSZ(fd):

View File

@@ -4175,7 +4175,12 @@ def wrap(txt: str, maxlen: int, maxlen2: int) -> list[str]:
def termsize() -> tuple[int, int]:
# from hashwalk
try:
w, h = os.get_terminal_size()
return w, h
except:
pass
env = os.environ
def ioctl_GWINSZ(fd: int) -> Optional[tuple[int, int]]: