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

confirm element: pressing a function key throws an error #404

Open
ohana54 opened this issue Sep 14, 2023 · 0 comments
Open

confirm element: pressing a function key throws an error #404

ohana54 opened this issue Sep 14, 2023 · 0 comments

Comments

@ohana54
Copy link

ohana54 commented Sep 14, 2023

Describe the bug

Using the confirm element, pressing one of the function keys (F1/F2...) throws an error.

To Reproduce

Steps to reproduce the behavior:

  1. Use the confirm element:
prompts({
  type: 'confirm',
  message: 'x',
});
  1. Press F2

Expected behavior

No error should be thrown

System

  • OS: MacOS 12.5.1
  • Terminal: iTerm
  • Node version: 18.16.0

Additional context

Full stack trace:

node:internal/readline/emitKeypressEvents:71
            throw err;
            ^

TypeError: Cannot read properties of undefined (reading 'toLowerCase')
    at ConfirmPrompt._ (/node_modules/prompts/lib/elements/confirm.js:60:11)
    at ReadStream.keypress (/node_modules/prompts/lib/elements/prompt.js:30:24)
    at ReadStream.emit (node:events:513:28)
    at emitKeys (node:internal/readline/utils:357:14)
    at emitKeys.next (<anonymous>)
    at ReadStream.onData (node:internal/readline/emitKeypressEvents:61:36)
    at ReadStream.emit (node:events:525:35)
    at addChunk (node:internal/streams/readable:315:12)
    at readableAddChunk (node:internal/streams/readable:289:9)
    at ReadStream.Readable.push (node:internal/streams/readable:228:10)
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

1 participant