def bracketed_paste_mode():
    """Context manager for enabling/disabling bracketed paste mode."""
    sys.stdout.write('\x1b[?2004h')
    try:
        yield
    finally:
        sys.stdout.write('\x1b[?2004l')
Context manager for enabling/disabling bracketed paste mode.
hangups/ui/__main__.py