Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hidden: true does not hide #98

Open
j6s opened this issue Sep 7, 2014 · 11 comments
Open

hidden: true does not hide #98

j6s opened this issue Sep 7, 2014 · 11 comments

Comments

@j6s
Copy link

j6s commented Sep 7, 2014

When using hidden: true on my system, it does not actually hide the input.

Code:

prompt.start();

prompt.get([{name: "password", required: true, hidden: true}], function(err,result) {
    var password = result.password;
    ...

Output:
screenshot from 2014-09-07 18 34 24

As you can see, the password is visible. For the type of application i am building, this is not optimal, since it is a password.

Information on the system:

➜  uname -a
Linux jo-desktop 3.16-trunk-amd64 #1 SMP Debian 3.16-1~exp1 (2014-08-09) x86_64 GNU/Linux
➜   node -v
v0.10.31
➜ echo $SHELL
/usr/bin/zsh

(also tested on bash)

edit:

  • Using prompt v0.2.13 intalled via npm
  • When using hidden: false / no hidden setting the characters are displayed twice. In both cases the value received is perfectly fine, however displayed once, if it should not be displayed and displayed twice, when it should be displayed once. prompt: user: uusseerr
@bradleat
Copy link

I have the same issue in powershell and cmd.

@colesimmons
Copy link

I have the same issue when I run with nodemon

@gangstead
Copy link
Member

This doesn't happen in my environment (mac version 0.2.14) Is this still an issue?

@j6s
Copy link
Author

j6s commented Feb 4, 2016

Still happening on my system. Using linux it happens with the shells

  • bash
  • zsh

in the emulators

  • gnome-terminal
  • guake

I will have to ask someone to check on a mac

@gangstead
Copy link
Member

Can you do a pull and try the updated password example?
https://github.com/flatiron/prompt/blob/master/examples/password.js

I just merged a PR for masking the password and added it to the example. Nothing's changed that would fix the root cause, but if the masking is working it might be a suitable work around.

@gangstead
Copy link
Member

It hasn't been published to npm yet so you'll have to clone the repo to test.

@ddumont
Copy link

ddumont commented Mar 27, 2016

I'm seeing this on windows 10. Trying to work around another bug where I have a list of things to prompt for but it's tripping up over the password one (maybe because of the hidden: true?).

pget(['username', { name: 'password', hidden: true}, 'cid', 'locale'])
.then(({username, password, cid, locale}) => {

I hardcoded to

pget([{ name: 'password', hidden: true}])
.then(({password}) => {

and it showed password in plaintext as I typed it.

Node: v5.9.0

  "dependencies": {
    "bluebird": "^3.3.4",
    "node-fetch": "^1.4.1",
    "prompt": "^1.0.0"
  },
  "devDependencies": {
    "babel-cli": "^6.6.5",
    "babel-preset-es2015": "^6.6.0",
    "babel-register": "^6.7.2"
  }

@ddumont
Copy link

ddumont commented Mar 27, 2016

To follow up, yes. If I remove hidden from password, I don't get weird skipping behavior.
I thought #132 was my problem... maybe they are related. When I do simply:

pget(['username', 'password', 'cid', 'locale'])
.then(({username, password, cid, locale}) => {

Things seem to work better

@pswai
Copy link

pswai commented Mar 28, 2016

I am also experiencing this issue on Windows 10 (Mingw64, cmd, powershell). I think this has to do with this issue of the read package

@soichih
Copy link

soichih commented Apr 21, 2016

+1 for Window 10 + git-bash.exe

@alancwoo
Copy link

alancwoo commented Dec 5, 2016

I was going completely insane trying to comprehend why this was happening as well when the example ran perfectly, the issue for me as with @colesimmons was that it doesn't work with nodemon

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

No branches or pull requests

8 participants