I'm not sure if this is an issue here or with the generator, but the ghost issue we had before has reappeared. Here's a gif to help me explain:

You mean the npm being outputed after you exited? Or the line being duplicated at the beginning?
Sorry, that video didn't turn out well. The line duplicated as well as when
I hit "y" to answer a question, it comes up as "yy".
On Monday, April 28, 2014, Simon Boudrias [email protected] wrote:
You mean the npm being outputed after you exited? Or the line being
duplicated at the beginning?—
Reply to this email directly or view it on GitHubhttps://github.com/SBoudrias/Inquirer.js/issues/109#issuecomment-41610132
.
Alright, I wonder if that's related to a new (non backward compat) Node release. The bug appeared without any update to the core of Inquirer.
I'll have to check it out!
@stephenplusplus Which generator is that with? I can see how that would happen if using the API incorrectly.
generator-angular's latest release.
On Monday, April 28, 2014, Daniel Chatfield [email protected]
wrote:
@stephenplusplus https://github.com/stephenplusplus Which generator is
that with? I can see how that would happen if using the API incorrectly.—
Reply to this email directly or view it on GitHubhttps://github.com/SBoudrias/Inquirer.js/issues/109#issuecomment-41613287
.
I can't reproduce this, is there anything I'm missing?
Hmm.
$ node -v
v0.10.26
$ npm -v
1.4.3
Happens in Terminal and iTerm 2 for me.
I tested it on iterm yesterday and I haven't been able to reproduce with node v0.10.26 on iTerm 2
But I had this bug on Windows powershell back at work...
No luck on my windows machine with power shell either.
I have a feeling this is going to be a tricky one to pin down.
I'm experiencing the same issue with Node v.0.10.24 and Inquirer v0.5.1 on my Windows 8.1 machine. It just doubles every key stroke, but interestingly the value provided as answer is the proper data.
So e.g. I enter ABC -> display == AABBCC, but the value nevertheless = ABC.
I guess it may be some event emitting called twice.
EDIT:
I found the reason for my scenario at least.
I'm creating a CLI module which of course should operate cross-plattform. So I had to handle CTRL+C on windows where code like this is needed
if (process.platform === "win32"){
var rl = readLine.createInterface ({
input: process.stdin,
output: process.stdout
});
rl.on ("SIGINT", function (){
process.emit ("SIGINT");
});
}
So the readLine interface is interfering with Inquirer. Hope this helps to find out how to solve the bug.
Any update on this? I'm seeing this issue on v.0.8 node 10.33.
@rodriguise Did you ran on this issue using a yeoman-generator or running this repo examples?
No running my own code
inquirer.prompt([
{
type: 'input',
name: 'user',
message: 'Enter your username',
validate: promptRequired('username'),
when: promptWhen(user, false)
},
{
type: 'password',
name: 'pass',
message: 'Enter your password',
validate: promptRequired('password'),
when: promptWhen(pass, false)
},
{
type: 'list',
name: 'cmd',
message: 'Select an operation',
choices: ops,
default: false
}
], function(answers) {
user = answers.user;
pass = answers.pass;
cmd = answers.cmd;
callback();
});
@rodriguise which prompt / operating system do you use?
OS X 10.10, Terminal.app
This behavior seems to be linked to the bottom bar.
var ui = new inquirer.ui.BottomBar();
commenting that out it goes away.
@rodriguise
The same problem. Have you found a solution?
FWIW, I ran into the same issue when I when requiring (and using) Inquirer in two separate modules, both of which were being required by a third module.
I resolved the issue temporarily by reducing it to a single var inquirer = require('inquirer'); for my entire app, and passing that var around when needed, which obviously isn't ideal. Hope that helps :dancer:
Might be unrelated, but I ran into this when I instantiated two instances of readline.
@knownasilya Yes, that will effectively happen currently if two inquirer or readlines run at the same time.
Got the same problem here with this piece of code:
var inquirer = require('inquirer');
var ui = new inquirer.ui.BottomBar();
var questions = [
{
name: 'firstname',
message: 'First name?',
validate: function (data) {
// there are as many character duplicates as there are instanciations of BottomBar
new inquirer.ui.BottomBar();
new inquirer.ui.BottomBar();
return true;
}
},
{
name: 'lastname',
message: 'Last name?'
}
];
inquirer.prompt(questions, function (answers) {
console.log(answers);
});
It seems like the more there are instances of BottomBar, the more there are duplicates.
Tested on OS X Yosemite v10.10.4, node v0.10.33 and iTerm2 v2.1.1.

I cannot reproduce in the latest release. I did some cleanup to events listeners a while ago, so that might just've fixed the issue.
Either way, feel free to reopen if the issue still occurs for you.
I am having the same issue..
Node v8.9.4
NPM 5.6.0
iTerm
OSX 10.12.6 (16G29)
Hey ! Same for me on windows10 with git bash (aka cygwin) and OSX terminal (using last LTS v8 nodejs and inquirer 5.2.0)
Broken for me now, inquirer 6.0.0, node v10.6.0
Btw. the old prompt package caused the same issue. Any idea guys?
Similar problem of duplicate output here. Working with nodejs v10.14.2 and inquirer 6.2.1 on Windows 7 Pro, x64.
Project dependencies:
"dependencies": {
"cli-interact": "^0.1.9",
"coffeequate": "^1.3.0",
"inquirer": "^6.2.1"
}
Sample output:
$ node app.js
? What's the sample volume [mL]? 2270
? What's the sample volume [mL]? 2270
? What's the sample density [g/mL]? ,987
? What's the sample density [g/mL]? .987
Add 1384.04 g of pure ethanol.
Tried both using cmd andGit Bash (based on MINGW64) which provide same faulty output.
Inquirer related code is as follows:
const validateFloat = (val) => {
if ( val && val.match(/^[0-9]*[\.\,]?[0-9]*$/i) ) {
return true
}
else {
return 'Please enter a valid float'
}
}
const replaceComma = (val) => {
return val.replace(',', '.')
}
const questions = [
{
type: 'input',
name: 'volume',
message: "What's the sample volume [mL]? ",
filter: (val) => replaceComma(val),
validate: (val) => validateFloat(val),
},
{
type: 'input',
name: 'density',
message: "What's the sample density [g/mL]? ",
filter: (val) => replaceComma(val),
validate: (val) => validateFloat(val),
},
]
inquirer.prompt(questions).then(answers => {
for (const answer in answers) {
answers[answer] = parseFloat(answers[answer])
}
const answer = query('Press any key twice to exit.')
})
I did a work around for this bug, if you can't wait for a bug fix. Just decorate the original prompt function like this =>
const inquirer = require('inquirer');
const pause = duration => (new Promise(resolve => (
setTimeout(resolve, duration)
)));
const decoratedPrompt = async (...args) => {
const r = await inquirer.prompt.call(inquirer, ...args);
await pause(200);
return r;
}
module.exports = {
prompt: decoratedPrompt,
}
... Hope it may help some of you.
I think the multiple character echo stems from multiple calls to readline.createInterface. If you have more than one module that does this, then you end up with the duplicate. Look for and eliminate any redundant calls to fix your problem.
Most helpful comment
I think the multiple character echo stems from multiple calls to readline.createInterface. If you have more than one module that does this, then you end up with the duplicate. Look for and eliminate any redundant calls to fix your problem.