Skip to content

Conversation

@vanm
Copy link

@vanm vanm commented May 23, 2013

Support using "ask" without echoing back stdin for passwords and other sensitive information.

Relies on io/console and http://apidock.com/ruby/IO/noecho (not supported in 1.8.7 or 1.9.2 unfortunately)

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling eb3ceb2 on socialcast:stdin-noecho-support into 8a09e6b on wycats:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling eb3ceb2 on socialcast:stdin-noecho-support into 8a09e6b on wycats:master.

@sferik
Copy link
Contributor

sferik commented May 23, 2013

As proposed in #209, I’d prefer if the option was named echo: false instead of noecho. Overall, I'm 👍 on this feature.

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling dbfdd30 on socialcast:stdin-noecho-support into 8a09e6b on wycats:master.

@vanm
Copy link
Author

vanm commented Jun 1, 2013

@sferik Thanks for the feedback. I updated the option to be :echo => false. Just a reminder that this is only compatible with 1.9.3+ (I see your Travis build is set up to run specs against 1.8.7 and 1.9.2).

@eventualbuddha eventualbuddha merged commit dbfdd30 into rails:master Aug 18, 2013
@eventualbuddha
Copy link
Contributor

Just noticed a bit too late what you said about this being 1.9.3+ only. We could polyfill $stdin.noecho using the usual technique before that method was available. @vanm, what do you think?

@vanm
Copy link
Author

vanm commented Aug 18, 2013

A few options come to mind:

  1. Revert and wait until thor drops support for <1.9.3
  2. Implement our own cross-platform solution like Add password prompt through shell.ask("Pass: ", :password => true) #209 (polyfill in case <1.9.3 and use stdin.noecho when available)
  3. Make this :echo option dependent on Ruby version. Not a great UX to have varying functionality based on Ruby version, but an option.

Any maintainers have a preference? I just proposed this as a 1.9.3-ready option to solve the problem, but understand the library needs to be compatible with 1.8.7 and 1.9.2.

@TimMoore
Copy link
Contributor

It would be great to restore 1.8.7 compatibility. This is preventing Bundler from updating to a newer version of Thor (rubygems/bundler#2736). We'd like to get the fix for #362.

@TimMoore
Copy link
Contributor

Looks like this was covered in #380.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants