mscdex / node-ncurses

An ncurses binding for node.js
MIT License
386 stars 25 forks source link

How to set terminal type? #43

Closed chrisdew closed 10 years ago

chrisdew commented 10 years ago

I'm assuming that node-ncurses picks up the terminal type from some environment variable.

When writing an app which can also be connected to over the network, how can I manually set the terminal type in node-ncurses?

(Remote users will manually chose set their default term type on their first connection.)

mscdex commented 10 years ago

It should be $TERM that ncurses looks for. You could try setting $TERM within node before using node-ncurses. Otherwise ncurses' newterm() and set_term() will probably need to be wrapped.

chrisdew commented 10 years ago

There may be several different terminal types being served from one application simultaneously.

Can this multiple terminal types work in ncurses, or is $TERM a 'global' for the library? (I'm also looking at blessed.)

mscdex commented 10 years ago

AFAIK ncurses can only do one terminal type per screen/window/etc. I'm not sure how well ncurses' C++ API works with using custom screens. For this kind of flexibility, I think you'll probably want/need to use something like blessed instead.

chrisdew commented 10 years ago

Thanks for your help, I'll try blessed.