diff --git a/copyparty/util.py b/copyparty/util.py index 7290dd9e..9ea8819f 100644 --- a/copyparty/util.py +++ b/copyparty/util.py @@ -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]]: @@ -4442,4 +4447,4 @@ __all__ = [ "JINJA_VER", "PYFTPD_VER", "PARTFTPY_VER", -] +] \ No newline at end of file