Skip to content

Empty input prompt when 'login' #486

Closed
@danwilhelm

Description

@danwilhelm

🐛 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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions