public function read($prompt, $style = '') {
        $this->write($prompt . ' ', $style);
        $stdin = fopen('php://stdin', 'r');
        $str = fgets($stdin, 4096);
        fclose($stdin);
        return preg_replace('{\r?\n$}D', '', $str);
    }