diff options
author | Soumith Chintala <soumith@fb.com> | 2015-11-06 12:58:01 +0300 |
---|---|---|
committer | Soumith Chintala <soumith@fb.com> | 2015-11-06 12:58:01 +0300 |
commit | 5ef7de14ec324c5611d4fc8a61841845aacf344b (patch) | |
tree | 2011aa0eaab9f9b1054e00f451a8e682596077ed | |
parent | 2492b1f45336f38859f031bf23af72bd52a37568 (diff) |
fixing colors
-rw-r--r-- | init.lua | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -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: |