mirror of
https://github.com/9001/copyparty.git
synced 2026-01-13 08:12:39 -07:00
fix termsz on windows
This commit is contained in:
parent
1b0eb45032
commit
7d526eaba3
10
bin/u2c.py
10
bin/u2c.py
|
|
@ -1,8 +1,8 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
from __future__ import print_function, unicode_literals
|
from __future__ import print_function, unicode_literals
|
||||||
|
|
||||||
S_VERSION = "2.15"
|
S_VERSION = "2.16"
|
||||||
S_BUILD_DT = "2025-10-25"
|
S_BUILD_DT = "2025-12-11"
|
||||||
|
|
||||||
"""
|
"""
|
||||||
u2c.py: upload to copyparty
|
u2c.py: upload to copyparty
|
||||||
|
|
@ -492,6 +492,12 @@ print = safe_print if VT100 else flushing_print
|
||||||
|
|
||||||
|
|
||||||
def termsize():
|
def termsize():
|
||||||
|
try:
|
||||||
|
w, h = os.get_terminal_size()
|
||||||
|
return w, h
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
env = os.environ
|
env = os.environ
|
||||||
|
|
||||||
def ioctl_GWINSZ(fd):
|
def ioctl_GWINSZ(fd):
|
||||||
|
|
|
||||||
|
|
@ -4175,7 +4175,12 @@ def wrap(txt: str, maxlen: int, maxlen2: int) -> list[str]:
|
||||||
|
|
||||||
|
|
||||||
def termsize() -> tuple[int, int]:
|
def termsize() -> tuple[int, int]:
|
||||||
# from hashwalk
|
try:
|
||||||
|
w, h = os.get_terminal_size()
|
||||||
|
return w, h
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
env = os.environ
|
env = os.environ
|
||||||
|
|
||||||
def ioctl_GWINSZ(fd: int) -> Optional[tuple[int, int]]:
|
def ioctl_GWINSZ(fd: int) -> Optional[tuple[int, int]]:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue