Skip to content

$command: Interactive prompts not processing the inputs #99

Closed

Description

@m-sureshraj

Expected Behavior

When the provided command prompts for the user input, it should accept entered value after pressing Enter or Return.

Actual Behavior

It just keeps reading the entered values without respecting end-of-line input.

#!/usr/bin/env zx

$`npm init`

Peek 2021-05-20 13-11

Steps to Reproduce the Problem

  1. Just pass an interactive command to the $``
$`npm init`
  1. Try to fill it

This behavior could be due to not redirecting the parent process stdin to the spawned process stdin. I tried the same command with the spawn, and it worked fine.

#! /usr/bin/env node
const { spawn } = require('child_process');

spawn('npm', ['init'], { stdio: 'inherit' });

Specifications

  • Version: 1.8.0
  • Platform: Ubuntu 20.04.2 LTS

Activity

  1. antonmedv commented on May 22, 2021

    @antonmedv
    Collaborator

    Fixed!

  2. m-sureshraj commented on May 23, 2021

    @m-sureshraj
    Author

    Commit - 1064e64

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions