Skip to content

Instantly share code, notes, and snippets.

@sorah sorah/a.rb
Created Nov 6, 2018

Embed
What would you like to do?
require 'io/console'
$stdin.raw do
$stdin.noecho do
loop do
print "\r"
begin
c = $stdin.read_nonblock(1)
p c
exit if c == ?;
rescue => e
p e
a, *_ = IO.select([$stdin], [], [], 1)
p a
end
sleep 0.1
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.