#180·prompts

no gives me a green check, cancel gives me yes

Author: PrimajinCreated Jul 3, 2019Updated Dec 26, 2024
Labelsenhancement

Describe the bug

I have two unexpected behaviours regarding confirm prompts, where no gives me a green check and cancel gives me yes.

To Reproduce

Steps to reproduce the behavior:

javascript
const prompts = require('prompts');

(async () => {
    const response = await prompts({
        type: 'confirm',
        name: 'value',
        message: 'Do you want to upgrade: stuff?',
        initial: true
    });

    console.log(response.value);
})();

Given the above code:

  • a no and a green check mark on N
  • a yes and a red cross on CTRL+C
  • a yes and a green check mark on enter
  • a yes and a green check mark on Y

Expected behavior

  • a no and a red cross on N
  • a no and a red cross on CTRL+C
  • a yes and a green check mark on enter
  • a yes and a green check mark on Y

System

  • OS: macOS 10.14.5
  • Terminal: iTerm2 3.2.9
  • Node version: v12.5.0

Screenshot 2019-07-03 at 15 42 21