On this page
curses.def_prog_mode
Prev: curses.curs_set | Up: curses | Next: curses.def_shell_mode
Rel: curses.assume_default_colors, curses.baudrate, curses.beep, curses.can_change_color
Ref: docs.python.org — curses.def_prog_mode
Tags: #public #python3 #stdlib #curses
Import
import curses
from curses import def_prog_mode
Signature & Overview
curses.def_prog_mode()
Save the current terminal mode as the "program" mode.
Usage
import curses
# Saves current curses terminal state so you can shell out and restore later
assert callable(curses.def_prog_mode)
Gotchas
- Pair with
reset_shell_mode()andreset_prog_mode()when spawning an interactive subprocess from a TUI.
REPL Inspect
from curses import def_prog_mode
help(def_prog_mode)
Linked from
Related notes
- tuts/python3/stdlib_module/curses/curs_set Linked here; links to this page; shared tags: #curses, #stdlib
- tuts/python3/stdlib_module/curses/def_shell_mode Linked here; links to this page; shared tags: #curses, #stdlib
- tuts/python3/stdlib_module/curses Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/curses/assume_default_colors Linked here; shared tags: #curses, #stdlib
- tuts/python3/stdlib_module/curses/baudrate Linked here; shared tags: #curses, #stdlib
- tuts/python3/stdlib_module/curses/beep Linked here; shared tags: #curses, #stdlib
- tuts/python3/stdlib_module/curses/can_change_color Linked here; shared tags: #curses, #stdlib
- tuts/python3/stdlib_module/curses/cbreak shared tags: #curses, #stdlib
- tuts/python3/stdlib_module/curses/color_content shared tags: #curses, #stdlib
- tuts/python3/stdlib_module/curses/color_pair shared tags: #curses, #stdlib