Closed pbnj closed 2 years ago
Thanks for reporting. Shell command substitution captures stdout of the command, but Survey only works if both stdin and stdout are attached to a terminal. Right now, what you are describing is not possible.
Follow https://github.com/AlecAivazis/survey/issues/328 for updates
Thank you for this library.
I have run into a reproducible bug when survey is used in a command-substitution, i.e.
$(...)
.Here is an exmaple using the
examples/simple.go
in this repo.This works fine:
This hangs:
I was expecting to get the same prompts and once answered,
echo $TEST
would outputPbnj chose red.
I have also tried handling interrupts per the FAQ:
But that didn't work in this case.
Input
,Multiline
,Password
, andConfirm
seem to be the most problematic ones as they hang the entire shell session, where asSelect
andMultiSelect
can exit with[ENTER]
or terminate with^C
without a problem (although the output is not what I expected, but that can be a separate issue).What I am trying to accomplish is a CLI utility inspired by this Rust project