diff options
author | Rui Guo <guorui.xt@gmail.com> | 2016-10-28 05:36:12 +0300 |
---|---|---|
committer | Rui Guo <guorui.xt@gmail.com> | 2016-10-28 05:36:12 +0300 |
commit | 9ee945bd8b2e28c011e791fad1af7ddf2a94b238 (patch) | |
tree | 49dcb1a9e5a0559e8efc81662949562e844c2498 /init.lua | |
parent | 47fec15d184fd613c3e5425f9dd5dbb11adef5fb (diff) |
fix for windows with wineditline
Diffstat (limited to 'init.lua')
-rw-r--r-- | init.lua | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -46,10 +46,15 @@ local function isWindows() package.config:sub(1,1) == '\\' end -if isWindows() or (not cutils.isatty()) then +local hasTPut = true -- default true for non windows +if isWindows() then + hasTPut = sys.fexecute('where tput'):find('tput') +end + +if not hasTPut or not cutils.isatty() then noColors() else - local outp = os.execute('tput colors >/dev/null') + local outp = os.execute('tput colors >' .. (isWindows() and 'NUL' or '/dev/null')) if type(outp) == 'boolean' and not outp then noColors() elseif type(outp) == 'number' and outp ~= 0 then @@ -520,6 +525,10 @@ local aliases = [[ alias lla='ls -lahF'; ]] +if isWindows() then + aliases = "" +end + -- Penlight pcall(require,'pl') |