Last active
August 8, 2017 04:09
-
-
Save reissbaker/50790dc9dfd032f19926712a47e94f45 to your computer and use it in GitHub Desktop.
terminal in a terminal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> ruby ./pty-reopen.rb 20 | |
┌───────────────────┤ PTY SCREEN 55x20 ├───────────────────┐ | |
│ > echo 'echoed' │ | |
│ echoed │ | |
│ │ | |
│ let's run some shit in an inner pty and do some crazy f │ | |
│ ormatting. we will run: │ | |
│ > cat ./ruby-fd-debug.rb │ | |
│ running... │ | |
│ ran successfully. printing... │ | |
│ │ | |
│ 1: device = ARGV.first │ | |
│ 2: file = File.open(device) │ | |
│ 3: io = IO.for_fd(file.fileno) │ | |
│ 4: puts "output: #{io.gets(nil)}" │ | |
│ 5: │ | |
│ │ | |
│ │ | |
│ let's write some fake input to the controller and read │ | |
│ it back from $stdin │ | |
│ found input: yo │ | |
│ │ | |
└──────────────────────────────────────────────────────────┘ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment