-
-
Save syrm/552543587862782f1a2daf5b7dd6d715 to your computer and use it in GitHub Desktop.
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
puts "Started" | |
spawn do | |
puts "Loop start" | |
STDIN.raw &.each_char do |char| | |
puts "Pressed: #{char}\r" | |
break if char == 'q' || char == '\u{3}' # Ctrl-C | |
end | |
puts "Loop end" | |
end | |
spawn do | |
puts "Send value" | |
STDIN.puts "a" | |
end | |
sleep 2.seconds |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment