--- id: backports-shutil-get-terminal-size version: "1.0.0" license: MIT license_treatment: permissive maintenance: abandoned --- # backports.shutil_get_terminal_size — A backport of the get_terminal_size function from Python 3.3's shutil. License: permissive · Maintenance: abandoned · Downloads: 435.4K/mo ## What it is and what it does This package backports Python 3.3's shutil.get_terminal_size() function to earlier Python versions that lack it. It returns a named tuple containing the terminal's column count and line count, useful for terminal-aware applications that need to adapt output width and height. The implementation is written in pure Python rather than C. The package has been abandoned since 2016 with no releases after 2014-08-19, and is primarily relevant for legacy Python 2 codebases; modern Python 3 versions include this function in the standard library. Use it for: - Detect terminal dimensions in Python 2.6 or 2.7 applications that format output for the current terminal width - Build terminal-based CLI tools that need to wrap text or position output based on available columns and lines - Support older Python versions in a codebase that must run across multiple Python generations ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides the get_terminal_size() function for Python versions that lack it natively, returning terminal dimensions as a named tuple of columns and lines. No, unless you are maintaining legacy Python 2 code that requires terminal size detection and cannot upgrade to Python 3. For any modern codebase, use shutil.get_terminal_size() directly from the standard library. The package is abandoned and offers no advantages over the native implementation. ## Install pip install backports-shutil-get-terminal-size uv add backports-shutil-get-terminal-size poetry add backports-shutil-get-terminal-size ## Installing backports.shutil_get_terminal_size Before you install: Low install friction with no runtime dependencies. However, the package is abandoned—last commit was 2016-11-03 and no releases since 2014-08-19. License in practice: MIT license is permissive and poses no restrictions on use, modification, or distribution in commercial or private projects. Quickstart: from backports.shutil_get_terminal_size import get_terminal_size size = get_terminal_size() print(size.columns, size.lines) Verify before relying: - Whether the pure-Python implementation handles all edge cases that the native C version covers - Current compatibility with Python 2.6 and 2.7 environments still in active use ## Package facts - License: MIT (permissive) - Python support: unspecified - Install friction: low - Maintenance: abandoned - Downloads: 435.4K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags terminal size detection, get terminal dimensions, terminal width height, shutil backport, terminal columns lines, terminal size python 2, legacy, terminal-io [View on SkillFed](https://skillfed.io/packages/backports-shutil-get-terminal-size) · [View on PyPI](https://pypi.org/project/backports-shutil-get-terminal-size/)