# Path: il2fb/ds/airbridge/typing.py



import io
import logging
import math
import sys
import threading
    import readline
    import pyreadline as readline
from colorama import init as init_colors, Fore, Style
from il2fb.ds.airbridge.typing import StringHandler, StringOrNone

        self._stdin_listener_thread = None
        self._stdin_listener_event = threading.Event()
        self._stdin_listener_event.clear()

    @staticmethod
    def handle_stdout(s: str) -> None:
        write_string_to_stdout(s)

    @staticmethod
    def handle_stderr(s: str) -> None:
        write_string_to_stderr(colorize_error(s))

    def handle_prompt(self, value: StringOrNone) -> None:
        with self._prompt_not_empty:
            if self._prompt_has_waiters:
                self._prompt_value = value
                self._prompt_not_empty.notify()

            if (
                (
                    value is not None
                ) and (
                    (not self._prompt_has_waiters)
                    or
                    self._stdin_listener_thread is None
                )
            ):
                write_string_to_stdout(colorize_prompt(value))


# Path: il2fb/ds/airbridge/typing.py



# Path: il2fb/ds/airbridge/terminal.py
import io
import logging
import math
import sys
import threading
    import readline
    import pyreadline as readline
from colorama import init as init_colors, Fore, Style
from il2fb.ds.airbridge.typing import StringHandler, StringOrNone


        self._stdin_listener_thread = None
        self._stdin_listener_event = threading.Event()
        self._stdin_listener_event.clear()

    @staticmethod
    def handle_stdout(s: str) -> None:
        write_string_to_stdout(s)

    @staticmethod
    def handle_stderr(s: str) -> None:
        write_string_to_stderr(colorize_error(s))

    def handle_prompt(self, value: StringOrNone) -> None:
        with self._prompt_not_empty:
            if self._prompt_has_waiters:
                self._prompt_value = value
                self._prompt_not_empty.notify()

            if (
                (
                    value is not None
                ) and (
                    (not self._prompt_has_waiters)
                    or
                    self._stdin_listener_thread is None
                )
            ):
                write_string_to_stdout(colorize_prompt(value))


    def _pop_prompt(self) -> StringOrNone: