foreseen

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

commit 5b88bddb66e030f239872645ac86b5a1181e6e1b
parent a0f9e2c7e081db48df0418f42faba979a4f53d5b
Author: Andrew Laack <andrew@laack.co>
Date:   Thu, 24 Sep 2026 10:43:53 -0500

Added install, added additional c-r binding for refresh

Diffstat:
MMakefile | 3++-
Msrc/main.cpp | 9+++++++--
Msrc/utils.cpp | 1+
3 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile @@ -2,7 +2,8 @@ build: g++ -g src/main.cpp src/quote.cpp src/list-item.cpp src/preformatted.cpp src/format-switch.cpp src/cache.cpp src/link.cpp src/plaintext.cpp src/site.cpp src/utils.cpp src/gemini-client.cpp src/browser.cpp src/heading.cpp -lssl -lcrypto -lncursesw -o browser.out install: - echo "Not implemented" + g++ -Ofast src/main.cpp src/quote.cpp src/list-item.cpp src/preformatted.cpp src/format-switch.cpp src/cache.cpp src/link.cpp src/plaintext.cpp src/site.cpp src/utils.cpp src/gemini-client.cpp src/browser.cpp src/heading.cpp -lssl -lcrypto -lncursesw -o browser.out + cp browser.out /usr/local/bin/gem-browser clean: echo "Not implemented" diff --git a/src/main.cpp b/src/main.cpp @@ -7,9 +7,14 @@ #include <filesystem> #include <ncurses.h> #include <string> +#include <unctrl.h> #include <utility> #include <vector> +#ifndef CTRL +#define CTRL(c) ((c) & 037) +#endif + const std::string DEFAULT_SEARCH_ENGINE="gemini://tlgs.one/search?"; @@ -292,7 +297,7 @@ int main(int argc, char** argv) { int y = 0; // this is the main loop. - + // while( input != 'q') { if(input == KEY_DOWN) { y += 1; @@ -306,7 +311,7 @@ int main(int argc, char** argv) { y += LINES / 2; } else if (input == 0x15) { y -= LINES / 2; - } else if (input == 'r'){ + } else if (input == 'r' || input == CTRL('r')){ b.refresh(); } else if(input == 'f') { b.goForward(); diff --git a/src/utils.cpp b/src/utils.cpp @@ -148,6 +148,7 @@ std::string getNewTab() { "* b -> back a page\n" "* f -> forward a page\n" "* o -> show url entry / link selection\n" + "* (r | C-r) -> refresh page\n" ; return st; }