crashes on keypress
crashes on keypress for certain non-alphanumeric keys, for example .,?.
/usr/lib/node_modules/btc/libs/cli.js:125
if (key.name == 'return') {
^
TypeError: Cannot read property 'name' of undefined
at List.module.exports (/usr/lib/node_modules/btc/libs/cli.js:125:16)
at List.EventEmitter.emit (events.js:99:17)
at List.onkeypress (/usr/lib/node_modules/btc/node_modules/term-list/index.js:54:8)
at ReadStream.EventEmitter.emit (events.js:126:20)
at emitKey (/usr/lib/node_modules/btc/node_modules/term-list/node_modules/keypress/index.js:406:12)
at ReadStream.onData (/usr/lib/node_modules/btc/node_modules/term-list/node_modules/keypress/index.js:48:14)
at ReadStream.EventEmitter.emit (events.js:126:20)
at TTY.onread (net.js:397:14)
Edit:
based on the keypress examples it looks like it's expected to check that key is truthy prior to checking any properties. (if (key && key.name == 'return') { ... })
This is a bug in node-term-list. Fixing it here will still cause btc to crash, since there's a switch in the default onkeypress behaviour in node-term-list. I've reported a bug over there: visionmedia/node-term-list#4 and submitted a pull request, which should fix the problem (once the dependency has been updated).
:+1:
node-term-list has been updated to 0.2.1 now, which fixes this bug.
thank you @eyko , nice work!