foreseen

A text-based gemini browser with prefetching
git clone git://git.laack.co/foreseen.git
Log | Files | Refs | README | LICENSE

commit 0ed19d5bea0ff4d860fa1905c5af40abbb37f0e2
parent 0039e93897c94d49465ff2ccd1d7dc631e11390a
Author: Andrew Laack <andrew@laack.co>
Date:   Thu, 15 Oct 2026 00:02:01 -0500

Force all screen writes to be 256-bit colors, never fg

Diffstat:
Msrc/render.cpp | 8++++++++
1 file changed, 8 insertions(+), 0 deletions(-)

diff --git a/src/render.cpp b/src/render.cpp @@ -79,8 +79,10 @@ void drawInputBox(std::string text, std::string userInput, DrawState& ds) { } move(ds.lines / 2, ds.columns / 4); + attron(COLOR_PAIR(COLOR_WHITE + 1)); addstr(text.c_str()); addstr(userTextToRender.c_str()); + attroff(COLOR_PAIR(COLOR_WHITE + 1)); } uint64_t getCurrentTime() { return std::chrono::duration_cast<std::chrono::milliseconds>( @@ -91,14 +93,18 @@ uint64_t getCurrentTime() { void draw(DrawState& ds) { if (ds.columns < 20) { erase(); + attron(COLOR_PAIR(COLOR_WHITE + 1)); addstr("Screen width too small."); + attroff(COLOR_PAIR(COLOR_WHITE + 1)); refresh(); return; } if (ds.lines < 5) { // This is the min size that still allows top and // bottom padding along with one line of text. erase(); + attron(COLOR_PAIR(COLOR_WHITE + 1)); addstr("Screen height too small."); + attroff(COLOR_PAIR(COLOR_WHITE + 1)); refresh(); return; } @@ -132,6 +138,7 @@ void draw(DrawState& ds) { move(0, (ds.columns / 2) - ((int)ds.header.size() / 2)); attron(A_BOLD); + attron(COLOR_PAIR(COLOR_WHITE + 1)); if ((int)ds.header.size() < ds.columns) { addstr(ds.header.c_str()); @@ -139,6 +146,7 @@ void draw(DrawState& ds) { addstr((ds.header.substr(0, ds.columns - 3) + "...").c_str()); } + attroff(COLOR_PAIR(COLOR_WHITE + 1)); attroff(A_BOLD); addstr(std::string(ds.columns, ' ').c_str());