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 Prompt causes next question to hang #1070

Open
shelbykauth opened this issue Dec 2, 2021 · 0 comments
Open

Editor Prompt causes next question to hang #1070

shelbykauth opened this issue Dec 2, 2021 · 0 comments

Comments

@shelbykauth
Copy link

When I add an Editor question to a list of otherwise-working questions, it will cause the next question to malfunction, and it will make the process hang and not close.

This occurs when I add the following to a list of prompts:

    {
      when: (answers: Answers) => answers.login.whatToDo === OPTS.editRaw,
      name: "login.rawData",
      type: "editor",
      message: "Edit the logins list in raw json format.",
      postfix: "json",
      default: () => {
        if (logins.length) {
          return JSON.stringify(logins, null, 2);
        } else {
          const defaultLogins = [
            {
              url: "[redacted]",
              username: "MyUser",
              password: "someP@ssw0rd",
            },
          ];
          return JSON.stringify(defaultLogins, null, 2);
        }
      },
    },

Symptoms:
(note, all occur after closing the editor)

  • When used as the last Promise in a program, I must hit "enter" again to close it out, even after the other code has run.
  • When other code runs afterwards, the stuff it prints is visible before it hangs
  • When another question is in the same prompt(question[]) queue after this one, it fixes the problem.
  • When another prompt queue is started, making sure that the async/awaits are used properly in that it doesn't start until after the editor closes and all questions are asked, I can move up and down and edit the response, but when I hit enter, it doesn't register the enter for that question. It drops to a new line and continues to ask that question.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants