aboutsummaryrefslogtreecommitdiff
path: root/lua
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2017-01-31 09:10:07 +0100
committerMarc André Tanner <mat@brain-dump.org>2017-01-31 09:40:28 +0100
commit963c238ff8d3f734bd852669d379e951f4fc7649 (patch)
tree6b0f1688b04e6ce7c2cddccbe29281b264fa34b7 /lua
parenteca2fbb4c6d9de94f7a4cb1140819246425bebbd (diff)
downloadvis-963c238ff8d3f734bd852669d379e951f4fc7649.tar.gz
vis-963c238ff8d3f734bd852669d379e951f4fc7649.tar.xz
vis: add workaround for broken color handling in Terminal.app
Terminal.app sets $TERM=xterm-256color and ships a corresponding terminfo description advocating that it is capable of color changes to the 256 color palette when in fact it can not. We introduce a new boolean option "change-256colors" which is true by default but can be used to disable color changes. It is automatically set if Terminal.app is detected using $TERM_PROGRAM. This should fix display artifacts as described in #456.
Diffstat (limited to 'lua')
-rw-r--r--lua/vis-std.lua3
1 files changed, 3 insertions, 0 deletions
diff --git a/lua/vis-std.lua b/lua/vis-std.lua
index 4da7293..6c42a0c 100644
--- a/lua/vis-std.lua
+++ b/lua/vis-std.lua
@@ -19,6 +19,9 @@ vis.events.subscribe(vis.events.INIT, function()
vis.lexers = require('lexer')
end
+ if os.getenv("TERM_PROGRAM") == "Apple_Terminal" then
+ vis:command("set change-256colors false");
+ end
vis:command("set theme ".. (vis.ui.colors <= 16 and "default-16" or "default-256"))
end)