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

Empty input prompt when 'login' #486

Closed
danwilhelm opened this issue Jan 11, 2019 · 1 comment
Closed

Empty input prompt when 'login' #486

danwilhelm opened this issue Jan 11, 2019 · 1 comment
Milestone

Comments

@danwilhelm
Copy link
Member

🐛 Bug description

wasm-pack login gives the appearance that the program is hanging or not working. It does not display stdout/stderr to the user. Instead of asking for a username, the user only sees the cursor.

🤔 Expected Behavior

wasm-pack login spawns npm adduser and should behave identically. The user should see the following line-by-line interactive prompt:

Username:
Password:
Email: (this IS public)

Errors should also be displayed. For example, if an email address is entered not containing '@', the user should see "npm WARN Email must be an email address" followed by a repeated Email prompt.

👟 Steps to reproduce

  1. In a non-Windows OS, run: wasm-pack login
  2. Now, the program will indefinitely wait for input without prompting the user what to do.
  3. After Ctrl-C is pressed, buffered output is displayed to the screen.

🌍 Your environment

wasm-pack version: 0.5.1 (also fails on latest master branch)
rustc version: rustc 1.33.0-nightly (8e2063d02 2019-01-07)

🔧 Technical explanation

wasm-pack login spawns npm adduser, which displays an interactive prompt, asking the user for username/password/email. PR #392 inadvertantly replaced the interactive process spawner with child::run, which is hard-coded to buffer stdout/stderr. This caused login to become essentially unusable; the user can no longer see interactive input prompts or error messages.

The above can be tested directly:

  1. In a non-Windows OS, run: wasm-pack login
  2. Enter asdf and press Enter. (Username)
  3. Enter asdf and press Enter. (Password)
  4. Enter asdf@asdf.com and press Enter. (Email)
  5. Because the child process now is complete, all buffered output should be displayed to the screen.
@ashleygwilliams ashleygwilliams added bug Something isn't working PR attached there's a PR open for this issue user report labels Jan 11, 2019
@ashleygwilliams ashleygwilliams added this to the 0.6.0 milestone Jan 11, 2019
@ashleygwilliams
Copy link
Member

closed by #487

@ashleygwilliams ashleygwilliams removed PR attached there's a PR open for this issue bug Something isn't working user report labels Jan 11, 2019
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

2 participants