Skip to main content

resizewin: Detect and configure terminal size

Usage

From a terminal shell

eval `resizewin`

It works with VT100-compatible terminals, including all modern terminal emulators.

From Python code

import sys
import termios

import resizewin

fd = sys.stdin.fileno()
rows, cols = resizewin.get_terminal_size(fd)
termios.tcsetwinsize(fd, (rows, cols))

How it works

In order to detect the terminal size, resizewin first tells the terminal to move the cursor to as far as possible, then asks the terminal for the current cursor's position. It uses the fact that terminals move the cursor to the bottom right corner when told to move the cursor to a row/column position that exceeds screen size.

Metadata

Release files for resizewin 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for resizewin 0.1.1
File Size Uploaded Provenance
resizewin-0.1.1.tar.gz 10.1 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for resizewin 0.1.1
File Interpreter ABI Platform
resizewin-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 15.4 kB

Release files / resizewin-0.1.1.tar.gz

Download URL resizewin-0.1.1.tar.gz
Size 10.1 kB
Tags Source
SHA-256 checksum
How to use checksums
d8399e3b44f551934c548304179b2d9cb1da768d013d57dc33e7aef2a2b9015e
BLAKE2b-256 checksum
How to use checksums
d41f1162cb68922615c9214b87709040bf029450fbf1aa9d4c65d042393717e8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.32.3

Release files / resizewin-0.1.1-py3-none-any.whl

Download URL resizewin-0.1.1-py3-none-any.whl
Size 5.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
98066776e741af27f987388249f3458a924dcc368a2b3b0c206a3ef46d1f5c37
BLAKE2b-256 checksum
How to use checksums
633821836fa679bb6c23c5508a051acd0880a9167f5002f64c28a18e17a51714
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.32.3

Security for resizewin 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page