Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editor type does not wait for file to close when using editors other than vim #1155

Open
DanielOrtel opened this issue Aug 11, 2022 · 3 comments

Comments

@DanielOrtel
Copy link

DanielOrtel commented Aug 11, 2022

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

@SBoudrias
Copy link
Owner

This might be an issue with the underlying modules handling external editors: https://github.com/mrkmg/node-external-editor

@gfargo
Copy link

gfargo commented Jul 9, 2023

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.

@mensah-j
Copy link

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.

See #985. For Sublime Text, you can also use subl -w or subl --wait.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants