def get_char()

in src/nova_act/util/terminal_manager.py [0:0]


    def get_char(self, block: bool) -> str | None:
        """Get a single character

        Parameters
        ----------
        block: bool
            Whether the function should block until a character is received.

        Returns
        -------
        str | None
            The character received, or None if no character was received and block is False.
        """
        if sys.platform == "win32":
            if block:
                return msvcrt.getch().decode("utf-8")
            elif msvcrt.kbhit():
                return msvcrt.getch().decode("utf-8")
        else:
            if block:
                return sys.stdin.read(1)
            else:
                i, _, _ = select.select([sys.stdin], [], [], 0)
                if i != []:
                    return sys.stdin.read(1)

        return None