ptysnoop.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:cligraphy 作者: Netflix-Skunkworks 项目源码 文件源码
def _fix_tty(self):
        """Set suitable tty options
        """
        assert self.tcattr is not None
        iflag, oflag, cflag, lflag, ispeed, ospeed, chars = self.tcattr  # pylint:disable=unpacking-non-sequence
        # equivalent to cfmakeraw
        iflag &= ~(termios.IGNBRK | termios.BRKINT | termios.PARMRK | termios.ISTRIP | termios.INLCR |
                   termios.IGNCR | termios.ICRNL | termios.IXON)
        oflag &= ~termios.OPOST
        lflag &= ~(termios.ECHO | termios.ECHONL | termios.ICANON | termios.ISIG | termios.IEXTEN)
        cflag &= ~(termios.CSIZE | termios.PARENB)
        cflag |= termios.CS8
        termios.tcsetattr(STDIN, termios.TCSANOW, [iflag, oflag, cflag, lflag, ispeed, ospeed, chars])
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号