ptysnoop.py 文件源码

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

项目:cligraphy 作者: Netflix-Skunkworks 项目源码 文件源码
def _open_pty(self):
        """Create a PTY
        """
        # get our terminal params
        self.tcattr = termios.tcgetattr(STDIN)
        winsize = fcntl.ioctl(STDIN, termios.TIOCGWINSZ, '0123')
        # open a pty
        self.master, self.slave = os.openpty()
        # set the slave's terminal params
        termios.tcsetattr(self.slave, termios.TCSANOW, self.tcattr)
        fcntl.ioctl(self.slave, termios.TIOCSWINSZ, winsize)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号