Sha256: 8f80189944609889e516fb245306eaf47ab32e09491b3f234f907a9d613809c0

Contents?: true

Size: 283 Bytes

Versions: 7

Compression:

Stored size: 283 Bytes

Contents

# to input secretly [ruby-list:15968]
require 'termios'

oldt = Termios.tcgetattr($stdin)
newt = oldt.dup
newt.lflag &= ~Termios::ECHO
Termios.tcsetattr($stdin, Termios::TCSANOW, newt)
print "noecho> "
a = $stdin.gets
Termios.tcsetattr($stdin, Termios::TCSANOW, oldt)
print "\n"
p a

Version data entries

7 entries across 7 versions & 3 rubygems

Version Path
ruby-termios-1.1.0 examples/secret_input1.rb
ruby-termios-1.0.2 examples/secret_input1.rb
ruby-termios-1.0.1 examples/secret_input1.rb
arika-ruby-termios-0.9.5 examples/secret_input1.rb
arika-ruby-termios-0.9.6 examples/secret_input1.rb
ruby-termios-0.9.6 examples/secret_input1.rb
termios-0.9.4 examples/secret_input1.rb