google / zx

A tool for writing better scripts

Home Page:https://google.github.io/zx/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Subcommand Prompts are Invisible

wrynegade opened this issue · comments

Expected Behavior

Be able to see when a sub-command prompts for user input.

Actual Behavior

If a line-end character is not hit, the output is never flushed. Typical prompts for user input in sub-commands will not show up.

Steps to Reproduce the Problem

#!/usr/bin/env zx
await $`printf 'input your name: '; read`

Specifications

  • Version: 6.0.3
  • Platform: Linux w/node 17.9.0
let p = await $`printf "name:"; read line; echo $line`
console.log(p)
$ printf "name:"; read line; echo $line
name:anton
anton
ProcessOutput {
  stdout: 'name:anton\n',
  stderr: '',
  signal: null,
  exitCode: 0
}