It might be helpful to point out that
hidden = STDIN.raw(&:gets)
will not return until you enter a newline (\n), e.g. by pressing Ctrl-J, and that Return and Enter usually generate \r not \n in raw mode (at least on *nix - I can't remember what Windows does). Might save some head scratching.