# 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
        return self._prompt_value is self._prompt_empty_value

    def _reset_prompt(self) -> None:
        self._prompt_value = self._prompt_empty_value
        self._prompt_has_waiters = True

    def listen_stdin(self, handler: StringHandler) -> None:
        with self._prompt_mutex:
            self._stdin_listener_thread = threading.Thread(
                target=self._listen_stdin,
                name="stdin",
                kwargs=dict(
                    handler=handler,
                ),
                daemon=True,
            )
            self._stdin_listener_thread.start()
            self._stdin_listener_event.wait()

    def _listen_stdin(self, handler: StringHandler) -> None:
        write_string_to_stdout("\r")
        self._stdin_listener_event.set()

        while True:
            prompt = self._pop_prompt()

            if prompt is None:
                return

            raw_line = input(colorize_prompt(prompt))

# 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

        return self._prompt_value is self._prompt_empty_value

    def _reset_prompt(self) -> None:
        self._prompt_value = self._prompt_empty_value
        self._prompt_has_waiters = True

    def listen_stdin(self, handler: StringHandler) -> None:
        with self._prompt_mutex:
            self._stdin_listener_thread = threading.Thread(
                target=self._listen_stdin,
                name="stdin",
                kwargs=dict(
                    handler=handler,
                ),
                daemon=True,
            )
            self._stdin_listener_thread.start()
            self._stdin_listener_event.wait()

    def _listen_stdin(self, handler: StringHandler) -> None:
        write_string_to_stdout("\r")
        self._stdin_listener_event.set()

        while True:
            prompt = self._pop_prompt()

            if prompt is None:
                return

            raw_line = input(colorize_prompt(prompt))

            line = raw_line + '\n'