Last active
December 14, 2015 17:29
-
-
Save kechol/5122350 to your computer and use it in GitHub Desktop.
a small script for a shell in shell.
thanks to screenxtv gem and @grubrescue.
This file contains hidden or 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
| require 'io/console' | |
| require 'pty' | |
| PTY::getpty("sh") do |r,w| | |
| Thread.new do | |
| loop do | |
| w.write IO.console.getch | |
| end | |
| end | |
| loop do | |
| print r.readpartial 1024 | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment