Editor type does not wait for file to close when using editors other than vim
When using, for example, subl as the default editor of the system, the command does not wait for the file to close, instead it just ends, therefore no answers are passed to the command.
Repro:
import inquirer from 'inquirer';
inquirer
.prompt([
{
type: 'editor',
name: 'theme',
message: 'What do you want to do?',
waitUserInput: true, // <-- does not do anything here
postfix: 'json' // <-- fyi, this one doesn't work either, but there's already an open issue
},
])
.then((answers) => {
console.log(JSON.stringify(answers, null, ' '));
});
node: v12.22.1 OS: macOS Monterey 12.4
This might be an issue with the underlying modules handling external editors: https://github.com/mrkmg/node-external-editor
I'm experiencing an issue, similar to others (#985), where the prompt doesn't wait for the external editor to close the file.
This doesn't impact editors running within the terminal e.g. nano, or vi, vim, only external editors like subl or code.
I'm experiencing an issue, similar to others (#985), where the prompt doesn't wait for the external editor to close the file.
This doesn't impact editors running within the terminal e.g.
nano, orvi,vim, only external editors likesublorcode.
See #985. For Sublime Text, you can also use subl -w or subl --wait.