From 5ef7de14ec324c5611d4fc8a61841845aacf344b Mon Sep 17 00:00:00 2001 From: Soumith Chintala Date: Fri, 6 Nov 2015 04:58:01 -0500 Subject: fixing colors --- init.lua | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/init.lua b/init.lua index b56987c..ca4d41d 100644 --- a/init.lua +++ b/init.lua @@ -46,10 +46,15 @@ local function isWindows() package.config:sub(1,1) == '\\' end -if isWindows() - or (not cutils.isatty()) -or (os.execute('tput colors >/dev/null') ~= 0) then +if isWindows() or (not cutils.isatty()) then noColors() +else + local outp = os.execute('tput colors >/dev/null') + if type(outp) == 'boolean' and not outp then + noColors() + elseif type(outp) == 'number' and outp ~= 0 then + noColors() + end end -- Help string: -- cgit v1.2.3