Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTyler Green <tyler.green2@gmail.com>2012-02-22 22:54:22 +0400
committerisaacs <i@izs.me>2012-02-24 01:29:00 +0400
commit5f6184580590869a5ce04c176558c34b8a5f4b21 (patch)
tree3e1fb8503f45af9918871f2774b0054e6bae08c5 /lib/search.js
parent0949df998b757fde459fbc2056ff0d725a0dbdde (diff)
fix #2187 set terminal columns to Infinity if 0
Updated deprecated call from tty.getWindowSize()[1]
Diffstat (limited to 'lib/search.js')
-rw-r--r--lib/search.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/search.js b/lib/search.js
index 92f4319f5..213390eb0 100644
--- a/lib/search.js
+++ b/lib/search.js
@@ -137,7 +137,8 @@ function prettify (data, args) {
, stdout = process.stdout
, cols = !tty.isatty(stdout.fd) ? Infinity
: stdout._handle ? stdout._handle.getWindowSize()[0]
- : tty.getWindowSize()[1]
+ : process.stdout.getWindowSize()[0]
+ cols = (cols == 0) ? Infinity : cols
} catch (ex) { cols = Infinity }
// name, desc, author, keywords