Thanks to visit codestin.com
Credit goes to github.com

Skip to content

$command: Interactive prompts not processing the inputs #99

@m-sureshraj

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

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