blessed-contrib
blessed-contrib copied to clipboard
Error: Not a terminal
Hello, I'm running an AWS instance of Ubuntu Server accessed through Iterm, I followed the basic example on the front page and I get this error:
Error: Not a terminal.
at Program.listen (/var/nodejs/node_modules/blessed/lib/program.js:264:11)
at new Program (/var/nodejs/node_modules/blessed/lib/program.js:112:8)
at Program (/var/nodejs/node_modules/blessed/lib/program.js:30:12)
at new Screen (/var/nodejs/node_modules/blessed/lib/widget.js:259:20)
at Function.Screen (/var/nodejs/node_modules/blessed/lib/widget.js:248:12)
at Object.
What do you think could cause this issue?
Do you also get the same error when running the blessed sample?
Also check this blessed issue .
adding @chjj
Just checked and I do get the same error with the blessed sample. I made sure that I have the latest ncurses-base and ncurses-term installed.
I suggest to open a defect in the blessed project on this.
Yeah, enough people have reported this that I'm thinking of just removing this limitation. With a blessed app, I wanted to check for a tty fd in the case that someone wants to manually check against tty FDs and add different behavior before instantiating a screen object. However, the programmer could do this without this error being thrown anyway. It's more just a minor failsafe so you don't get weird behavior when piping to or from the app, but it's not that serious.
I think just adding an ncurses-like warning might be better.
It works! Thank you guys, this is so fun!
So when I updated my code with your fix I then ran into this issue:
TypeError: Object #< Socket > has no method 'setRawMode' at Program.fn (/var/nodejs/node_modules/blessed/lib/program.js:322:20) at Program.EventEmitter.emit (events.js:117:20) at Program.EventEmitter.addListener (events.js:138:10) at Screen._listenMouse (/var/nodejs/node_modules/blessed/lib/widget.js:560:16) at Box.fn (/var/nodejs/node_modules/blessed/lib/widget.js:2172:19) at Box.EventEmitter._emit (/var/nodejs/node_modules/blessed/lib/events.js:90:20) at Box.EventEmitter.addListener (/var/nodejs/node_modules/blessed/lib/events.js:29:8) at Screen.setEffects (/var/nodejs/node_modules/blessed/lib/widget.js:1834:7) at /var/nodejs/node_modules/blessed/lib/widget.js:2211:17 at Array.forEach (native)
commenting out line 322 did the trick, but I'm assuming I'll run into some sort of problem down the road, but I wanted to let you guys know.