diff options
| author | Robin Haberkorn <rhaberkorn@fmsbw.de> | 2026-04-17 01:18:20 +0200 |
|---|---|---|
| committer | Robin Haberkorn <rhaberkorn@fmsbw.de> | 2026-04-17 01:18:20 +0200 |
| commit | 869de7c6270c50481499c201aa16aa5bc3a56739 (patch) | |
| tree | 42aea84a1c33dd519806eebd5db416f3c63d59a4 | |
| parent | 34af154e92383161666751ca69a288c98f5cca60 (diff) | |
Curses: fixed rendering bright/light colors on 8-color terminalsmaster-fmsbw-ci
* Scinterm was simply rendering them as black, thus effectively
breaking the Linux and FreeBSD vts with terminal.tes.
* I was considering to render light black as white on 8-color terminals,
so it's always readable.
However, if you add in A_BOLD there is a good chance that the
color will end up grey - at least it does in the virtual terminals (consoles).
* There is no need to use bright colors in the Scintilla view defaults.
E.g. 0xFFFFF is "light white".
However on 8-color terminals this will be rendered like white anyway.
The new defaults are closer to what terminal.tes does.
| -rw-r--r-- | .gitmodules | 2 | ||||
| m--------- | contrib/scinterm | 0 | ||||
| -rw-r--r-- | lib/colors/terminal.tes | 1 | ||||
| -rw-r--r-- | src/interface-curses/interface.c | 6 | ||||
| -rw-r--r-- | src/view.c | 4 |
5 files changed, 10 insertions, 3 deletions
diff --git a/.gitmodules b/.gitmodules index 841ce77..af9fd68 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,7 +4,7 @@ ignore = untracked [submodule "scinterm"] path = contrib/scinterm - url = https://github.com/orbitalquark/scinterm.git + url = https://github.com/rhaberkorn/scinterm.git [submodule "lexilla"] path = contrib/lexilla url = https://github.com/ScintillaOrg/lexilla.git diff --git a/contrib/scinterm b/contrib/scinterm -Subproject 7f5b0e2bdfb23a2806ed0cf9c6d25c1f37c0392 +Subproject 70691faf4242525cad987da11a7c4912d800691 diff --git a/lib/colors/terminal.tes b/lib/colors/terminal.tes index ea048aa..39c5bac 100644 --- a/lib/colors/terminal.tes +++ b/lib/colors/terminal.tes @@ -9,6 +9,7 @@ Q[color.white]U[color.selback] !* Also used for popups *! [color.calltip] 0,Q[color.lwhite],Q[color.black] +!* Due to the bold attribute this should be grey even on 8-color terminals *! [color.comment] 1,Q[color.black],Q[color.lblack] [color.number] 0,Q[color.black],Q[color.cyan] [color.keyword] 1,Q[color.black],Q[color.lwhite] diff --git a/src/interface-curses/interface.c b/src/interface-curses/interface.c index 569b13a..b30e5dc 100644 --- a/src/interface-curses/interface.c +++ b/src/interface-curses/interface.c @@ -156,6 +156,12 @@ static inline gboolean teco_interface_check_key(gint key); * The 8 bright colors (if terminal supports at * least 16 colors), else they are identical to * the non-bright colors (default curses colors). + * + * As a consequence a light black (grey) foreground + * on black background might be invisible on 8 color + * terminals. + * If you add in A_BOLD, there is a good chance that + * the text will still become grey. */ #define COLOR_LBLACK COLOR_LIGHT(COLOR_BLACK) #define COLOR_LRED COLOR_LIGHT(COLOR_RED) @@ -112,9 +112,9 @@ teco_view_setup(teco_view_t *ctx) teco_view_ssm(ctx, SCI_SETCARETFORE, 0xFFFFFF, 0); teco_view_ssm(ctx, SCI_SETSELFORE, TRUE, 0x000000); - teco_view_ssm(ctx, SCI_SETSELBACK, TRUE, 0xFFFFFF); + teco_view_ssm(ctx, SCI_SETSELBACK, TRUE, 0xC0C0C0); - teco_view_ssm(ctx, SCI_STYLESETFORE, STYLE_DEFAULT, 0xFFFFFF); + teco_view_ssm(ctx, SCI_STYLESETFORE, STYLE_DEFAULT, 0xC0C0C0); teco_view_ssm(ctx, SCI_STYLESETBACK, STYLE_DEFAULT, 0x000000); teco_view_ssm(ctx, SCI_STYLESETFONT, STYLE_DEFAULT, (sptr_t)"Monospace"); teco_view_ssm(ctx, SCI_STYLECLEARALL, 0, 0); |
