def _init_tty(self): try: self.mode = tty.tcgetattr(pty.STDIN_FILENO) tty.setraw(pty.STDIN_FILENO) # this seems to change the behavior of the stdout except tty.error: pass