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

github.com/torch/trepl.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSoumith Chintala <soumith@fb.com>2015-11-06 12:58:01 +0300
committerSoumith Chintala <soumith@fb.com>2015-11-06 12:58:01 +0300
commit5ef7de14ec324c5611d4fc8a61841845aacf344b (patch)
tree2011aa0eaab9f9b1054e00f451a8e682596077ed
parent2492b1f45336f38859f031bf23af72bd52a37568 (diff)
fixing colors
-rw-r--r--init.lua11
1 files 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: