Hi,

In message "[ruby-talk:02990] Problem with getc under UNIX with ruby 1.4.3"
    on 00/05/25, "David Douthitt" <DDouthitt / cuna.com> writes:

|# ./test.rb
|;lakjdf;klasjdf;klasjdf;klasdjf;asdkjf;klasjf
|59
|# cat test.rb
|#!/usr/bin/ruby
|
|str = STDIN.getc
|p str
|
|#
|
|[.....CUT!...]
|
|I would have expected output to look like this:
|
|# ./test.rb
|59
|#
|
|That is - no echo, instant response, no carriage return needed - or
|put another way, just as if you used "getc" (crunch!).

That' what UNIX getc is by default.  You can:

  #!/usr/bin/ruby

  begin
    system("stty raw -echo")
    str = STDIN.getc
  ensure
    system("stty -raw echo")
  end
  p str

							matz.