chjj/blessed — pull request #55 by ELLIOTTCABLE (2014-05-08 16:03:39+00:00)
Title: New `Tput` instances don't `setup()` when not passed `options.term`

The first `cursor_left()` call below works, but the second doesn't:

var Tput = new require('blessed').Tput
, tput1 = new Tput({term: process.env.TERM})
, tput2 = new Tput()

tput1.cursor_left()
tput2.cursor_left()

The error:

/Users/ELLIOTTCABLE/Dropbox/Code/Paws/Paws.js/tput_test.js:6
tput2.cursor_left()
^
TypeError: Object # has no method 'cursor_left'
at Object. (/Users/ELLIOTTCABLE/Dropbox/Code/Paws/Paws.js/tput_test.js:6:7)

I've spelunked the source a bit, and I see no reason why it should do that. Running the debugger over it, and stepping through the `Tput()` constructor, `options.terminal` is definitely set to `"xterm-256color"` as expected in the second case; as it *should* be, by falling back to `process.env.TERM`. Nonetheless, even though the