tiny-care-terminal: Crash when counting commits in multiple repos
Node Version: v7.2.1
tiny-core-terminal version: 1.0.8
Shell: bash
Terminal Program: iTerm2
Operating System: macOS
I have quite a few repos in ~/dev. The dashboard starts up, starts counting commits for a second and then crashes. Using TTC_REPOS=/single/repo works fine for the ones I tried. Didn’t try very hard to debug into the blessed library since I don’t know what the code is doing. What I can tell you that at that given code location in blessed (/usr/local/lib/node_modules/tiny-care-terminal/node_modules/blessed/lib/program.js:2543), we have part == "cpp" and val == "cpp".
Unsetting env vars other than TTC_REPOS doesn’t make a difference.
$ set | grep TTC
TTC_APIKEYS=false
TTC_BOTS=tinycarebot,selfcare_bot
TTC_REPOS='~/dev'
TTC_WEATHER=Munich
$ tiny-care-terminal
TypeError: Cannot read property 'slice' of null
at /usr/local/lib/node_modules/tiny-care-terminal/node_modules/blessed/lib/program.js:2543:35
at Array.forEach (native)
at Program._attr (/usr/local/lib/node_modules/tiny-care-terminal/node_modules/blessed/lib/program.js:2542:11)
at Box.Element._parseTags (/usr/local/lib/node_modules/tiny-care-terminal/node_modules/blessed/lib/widgets/element.js:498:26)
at Box.Element.parseContent (/usr/local/lib/node_modules/tiny-care-terminal/node_modules/blessed/lib/widgets/element.js:393:22)
at Box.Element.render (/usr/local/lib/node_modules/tiny-care-terminal/node_modules/blessed/lib/widgets/element.js:1839:8)
at /usr/local/lib/node_modules/tiny-care-terminal/node_modules/blessed/lib/widgets/screen.js:738:8
at Array.forEach (native)
at Screen.render (/usr/local/lib/node_modules/tiny-care-terminal/node_modules/blessed/lib/widgets/screen.js:735:17)
at Socket.week.stdout.on.data (/usr/local/lib/node_modules/tiny-care-terminal/care.js:120:12)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at readableAddChunk (_stream_readable.js:176:18)
at Socket.Readable.push (_stream_readable.js:134:10)
at Pipe.onread (net.js:551:20)
About this issue
- Original URL
- State: open
- Created 7 years ago
- Comments: 16 (5 by maintainers)
I had the same problem, and traced it to curly braces in the commit messages wreaking havoc with the “tag parser” implemented in the blessed library. The simplest fix is to set
tags: falseinmakeBox(), but I’m not sure if there is an unrelated reason it needs to be set totrue. The alternative is to do something likecontent = content.replace(/[{}]/g, m => m === '{' ? '{open}' : '{close}');insidegetCommits(). Happy to submit a tiny-PR if you let me know which solution you think would be more appropriate 😃