hstt/main.py
def detect_window_resize(screen) -> None:
    """Detect terminal resize & ^C pressing."""
    # required for getting resize signal
    keycode = None
    while keycode != -1:
        keycode = screen.getch()
        if keycode == 3:
            # curses eat ^C, so we need raise it manually
            raise KeyboardInterrupt()
    # detect different size changed by signal
    if curses.is_term_resized(*screen.getmaxyx()):
        curses.resize_term(0, 0)
        screen.erase()
Detect terminal resize & ^C pressing.
Detect terminal resize & ^C pressing.
Detect terminal resize & ^C pressing .
def detect_window_resize(screen) -> None:
    keycode = None
    while keycode != -1:
        keycode = screen.getch()
        if keycode == 3:
            raise KeyboardInterrupt()
    if curses.is_term_resized(*screen.getmaxyx()):
        curses.resize_term(0, 0)
        screen.erase()
def detect_window_resize ( screen ) -> None : keycode = None while keycode != - 1 : keycode = screen . getch ( ) if keycode == 3 : raise KeyboardInterrupt ( ) if curses . is_term_resized ( * screen . getmaxyx ( ) ) : curses . resize_term ( 0 , 0 ) screen . erase ( )
Detect terminal resize & ^C pressing.
Detect terminal resize & ^C pressing .
"""Detect terminal resize & ^C pressing.""" # required for getting resize signal # curses eat ^C, so we need raise it manually # detect different size changed by signal
screen