-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
24-bit true color support #9
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Recent versions of tmux works well with ncurses (for 256 or richer colors) with TERM="xterm-256color". We do not find any reason to use 'screen-256color'; the new TERM configuration is required to enable 24-bit true color feature.
This enables 24-bit true color support in true-color compatible environments. Mainly, highlights will follow gui colors.
Popup menu was in a gray-ish color with GUI or 24-bit terminals, which should be yellow-ish as in normal terminals (256 color).
Detects the current shell (running inside tmux, or not) is through a mosh channel. This tool is necessary for auto-configuring true color mode in several applications including vim.
Whenever possible, use termguicolors features to enable 24-bit true color, even in the terminals like GUI. There is a subtle challenge as some shell or terminal emulators may not support 24-bit colors. We assume that modern terminal emulators we would use will support it, or even fall-back to 256 colors nicely, but otherwise it may look broken as in mosh. For mosh, to workaround this issue until mosh supports true color, we detect whether the vim is running in a mosh environment. This detection should be robust even when it is running under a tmux session; to this end, the 'is_mosh' script is introduced. Whenever the vim is initialized or asked to redraw the screen, we detect mosh under which the feature shall be disabled.
In some nvim environments, &term is set to be 'nvim' instead of the TERM value inherited from the shell.
When 24-bit colors are enabled (termguicolors), use a slightly different appearance and color themes.
Use better color, respecting syntax highlight, when viewing diff under GUI mode or true color. Previously, foreground color for diff texts had to set black in which syntax highlights are ignored, because 256-color doesn't have dark green/red color of similar brightness to the background. In 24-bit color mode, we adopt dark but chromatic colors for diff background.
wookayin
added a commit
that referenced
this pull request
Oct 10, 2017
In the case where # Add the following line to ~/.vimrc.local
set notermguicolor |
To test whether your terminal emulator supports 24-bit color (see also this):
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
References: https://gist.github.com/XVilka/8346728
iTerm2 >= 3.0
Tmux >= 2.1
Vim >= 7.4.1799 or neovim