On this page
termios.tcgetwinsize
Prev: termios.tcgetattr | Up: termios | Next: termios.tcsendbreak
Rel: termios.error, termios.tcdrain, termios.tcflow, termios.tcflush
Ref: docs.python.org — termios.tcgetwinsize
Tags: #public #python3 #stdlib #termios
Import
import termios
from termios import tcgetwinsize
Signature & Overview
termios.tcgetwinsize(fd, /)
Get the tty winsize for file descriptor fd.
Usage
import termios
# Python 3.11+ Unix-only: returns (rows, cols) of a TTY fd
assert hasattr(termios, 'tcgetwinsize') or True
Gotchas
- Prefer
shutil.get_terminal_size()for portable width/height queries.
REPL Inspect
from termios import tcgetwinsize
help(tcgetwinsize)
Linked from
Related notes
- tuts/python3/stdlib_module/termios/tcgetattr Linked here; links to this page; shared tags: #stdlib, #termios
- tuts/python3/stdlib_module/termios/tcsendbreak Linked here; links to this page; shared tags: #stdlib, #termios
- tuts/python3/stdlib_module/termios Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/termios/error Linked here; shared tags: #stdlib, #termios
- tuts/python3/stdlib_module/termios/tcdrain Linked here; shared tags: #stdlib, #termios
- tuts/python3/stdlib_module/termios/tcflow Linked here; shared tags: #stdlib, #termios
- tuts/python3/stdlib_module/termios/tcflush Linked here; shared tags: #stdlib, #termios
- tuts/python3/stdlib_module/termios/tcsetattr shared tags: #stdlib, #termios
- tuts/python3/stdlib_module/termios/tcsetwinsize shared tags: #stdlib, #termios
- tuts/c/stdlib shared tags: #stdlib