On this page
tty.setcbreak
Prev: tty.cfmakeraw | Up: tty | Next: tty.setraw
Rel: tty.cfmakecbreak, tty.cfmakeraw, tty.setraw
Ref: docs.python.org — tty.setcbreak
Tags: #public #python3 #stdlib #tty
Import
import tty
from tty import setcbreak
Signature & Overview
tty.setcbreak(fd, when=2)
Put terminal into cbreak mode.
Usage
import tty
# Unix-only: switches a TTY fd to cbreak mode (unbuffered keypresses, Ctrl-C still works)
assert callable(tty.setcbreak)
Gotchas
- Always save
old = termios.tcgetattr(fd)first and restore it in afinally:block.
REPL Inspect
from tty import setcbreak
help(setcbreak)
Linked from
Related notes
- tuts/python3/stdlib_module/tty/cfmakecbreak Linked here; links to this page; shared tags: #stdlib, #tty
- tuts/python3/stdlib_module/tty/cfmakeraw Linked here; links to this page; shared tags: #stdlib, #tty
- tuts/python3/stdlib_module/tty/setraw Linked here; links to this page; shared tags: #stdlib, #tty
- tuts/python3/stdlib_module/tty Linked here; links to this page; shared tags: #stdlib
- tuts/c/stdlib shared tags: #stdlib
- tuts/c/stdlib/assert shared tags: #stdlib
- tuts/c/stdlib/assert/assert shared tags: #stdlib
- tuts/c/stdlib/assert/static_assert shared tags: #stdlib
- tuts/c/stdlib/ctype shared tags: #stdlib
- tuts/c/stdlib/ctype/isalpha shared tags: #stdlib