You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/path/node_modules/blessed/lib/program.js:241
throw new Error('Not a terminal.');
^
Error: Not a terminal.
at Program.listen (/path/node_modules/blessed/lib/program.js:241:11)
at new Program (/path/node_modules/blessed/lib/program.js:89:8)
at Program (/path/node_modules/blessed/lib/program.js:28:12)
at new Screen (/path/node_modules/blessed/lib/widget.js:256:20)
at Function.Screen (/path/node_modules/blessed/lib/widget.js:245:12)
at init (/path/includes/uilib.js:17:25)
at initUI (/path/bin/ui:25:6)
at Object.<anonymous> (/path/bin/ui:388:1)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
And that makes sense, because I use the same condition to actually check if the user piped something to my script.
I tried to disable this check in program.js which brings up these lines:
TypeError: Object #<Socket> has no method 'setRawMode'
at Program.fn (/path/node_modules/blessed/lib/program.js:288:20)
at Program.EventEmitter.emit (events.js:117:20)
at Program.EventEmitter.addListener (events.js:138:10)
at Screen._listenMouse (/path/node_modules/blessed/lib/widget.js:440:16)
at ScrollableBox.fn (/path/node_modules/blessed/lib/widget.js:1808:19)
at ScrollableBox.EventEmitter._emit (/path/node_modules/blessed/lib/events.js:86:20)
at ScrollableBox.EventEmitter.addListener (/path/node_modules/blessed/lib/events.js:25:8)
at Screen.setEffects (/path/node_modules/blessed/lib/widget.js:1602:7)
at /path/node_modules/blessed/lib/widget.js:1849:17
at Array.forEach (native)
Removing that line as well, lets my script run w/o errors, but blessed is not able to catch any keystrokes or mouseactions correctly. Instead it shows some controll characters on top of my UI
I have no clue about TTYs. Is this something that can be done or is there no chance getting content from pipe and then open up an interactive UI where the user can actually interact with the content he just piped? I guess (hope!) it is possible since all user actions are actually catched but simply not interpreted correctly.
The text was updated successfully, but these errors were encountered:
After struggling with the same problem for a little while, I've gotten this working over at jsonfui --
If you pipe in content, the stdin stream is dedicated to that input. That can't change. Instead, you want to tell blessed to read from the active terminal (/dev/tty) instead of standard input (/dev/stdin).
Blessed supports this by accepting an input option on screen. While it defaults to process.stdin, you can pass in a reference to the terminal input instead.
I found the ttys module wraps this behaviour quite nicely if you want to be able to have the same code for either case (stdin or dev/ttyl if stdin is not a tty).
I am trying to pipe content to my script
Which gives me this error, when I init blessed:
And that makes sense, because I use the same condition to actually check if the user piped something to my script.
I tried to disable this check in program.js which brings up these lines:
Removing that line as well, lets my script run w/o errors, but blessed is not able to catch any keystrokes or mouseactions correctly. Instead it shows some controll characters on top of my UI
I have no clue about TTYs. Is this something that can be done or is there no chance getting content from pipe and then open up an interactive UI where the user can actually interact with the content he just piped? I guess (hope!) it is possible since all user actions are actually catched but simply not interpreted correctly.
The text was updated successfully, but these errors were encountered: