blessed-contrib icon indicating copy to clipboard operation
blessed-contrib copied to clipboard

Error: Not a terminal

Open tracerstevens opened this issue 9 years ago • 6 comments

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. (/var/nodejs/myapp/app.js:10:22) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12)

What do you think could cause this issue?

tracerstevens avatar Apr 17 '15 02:04 tracerstevens

Do you also get the same error when running the blessed sample?

Also check this blessed issue .

adding @chjj

yaronn avatar Apr 17 '15 13:04 yaronn

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.

tracerstevens avatar Apr 18 '15 17:04 tracerstevens

I suggest to open a defect in the blessed project on this.

yaronn avatar Apr 19 '15 12:04 yaronn

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.

chjj avatar Apr 19 '15 12:04 chjj

I think just adding an ncurses-like warning might be better.

chjj avatar Apr 19 '15 13:04 chjj

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.

tracerstevens avatar Apr 19 '15 16:04 tracerstevens