I'm trying to read one character at a time in a ruby running in cygwin.
STDIN.getc
returns the characters but only after I pressed enter:
STDOUT.sync = true
while true
STDIN.getc
puts "HELLO"
STDOUT.flush
end
test session:
aa
HELLO
HELLO
HELLO
How can I read a character?