Sha256: f2f440e93141a157bbfc9b2119c6082c9d023d05d4eb0bec0756b18825a8c241

Contents?: true

Size: 279 Bytes

Versions: 7

Compression:

Stored size: 279 Bytes

Contents

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

$stdin.extend Termios

oldt = $stdin.tcgetattr
newt = oldt.dup
newt.lflag &= ~Termios::ECHO
$stdin.tcsetattr(Termios::TCSANOW, newt)
print "noecho> "
a = $stdin.gets
$stdin.tcsetattr(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_input2.rb
ruby-termios-1.0.2 examples/secret_input2.rb
ruby-termios-1.0.1 examples/secret_input2.rb
arika-ruby-termios-0.9.5 examples/secret_input2.rb
arika-ruby-termios-0.9.6 examples/secret_input2.rb
ruby-termios-0.9.6 examples/secret_input2.rb
termios-0.9.4 examples/secret_input2.rb