TypeError: Cannot read properties of undefined (reading 'startsWith')
Describe the bug
When asked to choose something, e.g.:
Do you want to run this command?
❯ 1. Yes
2. No, and tell Copilot what to do differently (Esc)
Confirm with number keys or ↑↓ keys and Enter, Cancel with Esc
On macOS if you use the keyboard numpad's Enter key you will then see the following appear above the box:
✗ TypeError: Cannot read properties of undefined (reading 'startsWith')
Additionally, the entire session then becomes unresponsive.
Affected version
No response
Steps to reproduce the behavior
No response
Expected behavior
No response
Additional context
No response
What version are you running? (copilot --version)
And what version of node? (node --version)
0.0.343
Node 22.20.0
I'm experiencing the same issue.
Copilot version: 0.0.351 Commit: 90770bc Node: v22.20.0
It happened several times today.
Stacktrace:
2025-10-27T18:41:17.386Z [ERROR] Uncaught Exception: Cannot read properties of undefined (reading 'startsWith')
TypeError: Cannot read properties of undefined (reading 'startsWith')
at EventEmitter.I (file:///Users/dlombard/.nvm/versions/node/v22.20.0/lib/node_modules/@github/copilot/index.js:819:1670)
at EventEmitter.emit (node:events:531:35)
at ReadStream.handleReadable (file:///Users/dlombard/.nvm/versions/node/v22.20.0/lib/node_modules/@github/copilot/index.js:815:489)
at ReadStream.emit (node:events:519:28)
at emitReadable_ (node:internal/streams/readable:834:12)
at process.processTicksAndRejections (node:internal/process/task_queues:89:21)
I've been hitting this over and over on my Mac - Node hangs and I have to force kill it in Activity Monitor.
I haven't been able to reproduce this when emulating the Enter key, but I don't have a Mac keyboard with a numpad to try it with a physical keyboard.
Does this happen every time you use that key? Does it only happen on the numbered prompts? Does it happen if you try to submit a text prompt with it?
Hi @williammartin
It only happens for me on number prompts. Not on text prompts.
It happens every time.
Thanks. What terminal emulator and shell are you using?
I'm using iTerm2 on the Mac - not an emulator. Seems to consistently happen when picking a number as to how to execute a tool.
I'm having the same issue both when starting copilot and selecting to use current folder and when approving to run a tool and have to close terminal window.
When I select approve for this and future sessions it works.
Copilot Version 0.0.362
Also running into this when using the numblock (hitting "Enter").
Welcome to GitHub Copilot CLI
Version 0.0.362 · Commit 0c95944
iTerm2, zsh, node 25
On a pure text input, hitting enter prints this in the prompt field:
For any key on a numpad. character might be different, all show like this though. MacOS with external keyboard (not apple).