From 216aaf1f489133630f2583dac66c26f69ee3f06d Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Thu, 6 Aug 2015 00:26:23 -0700 Subject: [PATCH] fix NO_PADDING detection. --- lib/program.js | 2 +- lib/tput.js | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/program.js b/lib/program.js index 6412682..9b4d43a 100644 --- a/lib/program.js +++ b/lib/program.js @@ -280,7 +280,7 @@ Program.prototype.setupTput = function() { return; } - if (options.padding) { + if (tput.padding) { self.put[key] = function() { return tput._print(tput[key].apply(tput, arguments), write); }; diff --git a/lib/tput.js b/lib/tput.js index 2851f7c..8b99730 100644 --- a/lib/tput.js +++ b/lib/tput.js @@ -702,6 +702,12 @@ Tput.prototype.inject = function(info) { this.features = info.features; Object.keys(info.features).forEach(function(key) { + if (key === 'padding') { + if (!info.features.padding && self.options.padding !== true) { + self.padding = false; + } + return; + } self[key] = info.features[key]; }); };