-
-
Notifications
You must be signed in to change notification settings - Fork 44
Tickets #4137 & #4821: true color support with ncurses and S-Lang color detection #4822
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
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
d6ecfc0
lib/skin/common.c: Fix typo in comment
b524cc3
misc/skins: Differentiate directories and files in true color skins
cd5fc97
lib/tty: Add true color support with ncurses and improve S-Lang color…
5633ffe
lib/tty: Add compatibility translation from 256 colors to true colors
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -403,47 +403,51 @@ Frequently Asked Questions | |
| If you get colors, be happy. | ||
|
|
||
| If your terminal stays black and white, your terminal doesn't support | ||
| color. You might want to upgrade to a terminal which compatible with | ||
| color. You might want to upgrade to a terminal which is compatible with | ||
| the ANSI color sequences. | ||
|
|
||
| If your terminal goes completely black, see the next question. | ||
|
|
||
| More detailed answer: | ||
|
|
||
| Check that your terminal supports color. color_xterm, rxvt and Linux | ||
| console do support, most other terminals don't. You can test color | ||
| support with following simple C program: | ||
| Check that your terminal supports color. Most terminals do. You can | ||
| test color support with the following command: | ||
|
|
||
| #include <stdio.h> | ||
| printf "\033[32m Hello color world! \033[m\n" | ||
|
|
||
| int main (void){ | ||
| printf ("\033[32m Hello world! \033[m\n"); | ||
| return 0; | ||
| } | ||
| You can test 256 color support with the following command: | ||
|
|
||
| Compile and run it. If you see "Hello world!" text in green your | ||
| terminal supports color, otherwise not (however, for color_xterm see | ||
| also the next question). | ||
| printf "\033[38;5;120m Hello 256-color world! \033[m\n" | ||
|
|
||
| Check whether you are using Ncurses or the S-Lang library (type | ||
| "mc -V" to find out). | ||
| You can test true color support with the following command: | ||
|
|
||
| With S-Lang library you can force color support by setting the | ||
| environment variable COLORTERM to any value. | ||
| printf "\033[38;2;0;200;0m Hello true color world! \033[m\n" | ||
|
|
||
| If you use ncurses library, check that your terminfo database | ||
| supports color. If not, you should install one of the enhanced | ||
| terminfo databases included in GNU Midnight Commander source | ||
| distribution. | ||
| If you see the text in green, your terminal supports the respective | ||
| color mode. | ||
|
|
||
| You might want to set the TERM environment variable so that you are | ||
| using the correct terminfo database or termcap entry. | ||
| Check that you are using the proper TERM variable for your terminal. | ||
| If not, set it accordingly. You can use the 'toe -a' command to list | ||
| all available terminfo entries. | ||
|
|
||
| If you use color_xterm (or rxvt) the correct value might be | ||
| xterm-color, xtermc or simply xterm. | ||
| If your terminal supports 256 colors, the correct entry name may be | ||
| appended with -256color. If your terminal supports true color, it | ||
| should be appended with -direct, -direct16, or -direct256. All three | ||
| variants provide both 256-color and true color support simultaneously. | ||
| The latter two variants make no difference in mc, and they support | ||
| basic colors including their bright versions along with true color | ||
| support, in contrast to the -direct variant, which supports only basic | ||
| 8 colors together with true color when used in a skin. | ||
|
|
||
| If you use Linux console the correct value for TERM is linux or | ||
| console. | ||
| If there is no 256-color or true-color terminfo variant for your | ||
| terminal, even though your terminal supports it, send an e-mail to | ||
| ncurses/terminfo maintainers ([email protected]) and ask them to | ||
| add one. | ||
|
|
||
| With the S-Lang library (you can check by 'mc -V'), you can force | ||
| color support by setting the environment variable COLORTERM to any | ||
| value, and specifically force true color support by setting it to | ||
| 'truecolor'. | ||
|
|
||
| 4.5 My color_xterm goes completely (or partially) black! | ||
|
|
||
|
|
||
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.