-
-
Notifications
You must be signed in to change notification settings - Fork 315
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
As mentioned in the code, the prompt is supposed to take parameter args.stdout. I tried passing process.stderr to stdout but it doesn't seem to work.
To Reproduce
Steps to reproduce the behavior:
- . Create
index.jswith basic autocomplete prompt code and set question.stdout = process.stderr (this is supposed to make terminal wait so command substitution likeeval $(command)can work) - print any random path for testing when a specific value is selected.
cd $(node index.js)This will not show the autocomplete
Expected behavior
In the above scenario, it should first show the autocomplete prompt and on selecting that particular option it should cd to the mentioned path
System
- OS: [e.g. MacOS 10.14.3] Ubuntu 19
- Terminal: [e.g. iTerm, PowerShell] Ubuntu Terminal
- Node version:
node -v10.16.0
Additional context
Add any other context about the problem here.
I looked around the code and found following code in lib/elements/prompt.js
class Prompt extends EventEmitter {
this.firstRender = true;
this.in = opts.in \|\| process.stdin;
this.out = opts.out \|\| process.stdout;Isn't opts.out is supposed to be opts.stdout in above code? since args.stdout is mentioned everywhere while mentioning the arguments.
EDIT: I tried having out instead of stdout and it does wait for the input but it re-renders autocomplete list everytime you press key.
const questions = [
{
type: 'autocomplete',
message: `Select project to ${action} :`,
name: 'selectedProject',
choices:getChoices(),
limit:40,
suggest:suggestFilter,
out:process.stderr
}
];Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working