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:
-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: