Description
🐛 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
- In a non-Windows OS, run:
wasm-pack login
- Now, the program will indefinitely wait for input without prompting the user what to do.
- 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:
- In a non-Windows OS, run:
wasm-pack login
- Enter
asdf
and press Enter. (Username) - Enter
asdf
and press Enter. (Password) - Enter
asdf@asdf.com
and press Enter. (Email) - Because the child process now is complete, all buffered output should be displayed to the screen.