improved the examples of capturing pty