commit 6f80b3c5fa71ba7a869763481ce955f1e2115f85
parent 35940c6515829da9a8e12fa873d8325c2f847c6e
Author: Andrew Laack <andrew@laack.co>
Date: Fri, 25 Sep 2026 10:51:47 -0500
Show redirect location.
Diffstat:
2 files changed, 24 insertions(+), 1 deletion(-)
diff --git a/TODO.txt b/TODO.txt
@@ -14,3 +14,14 @@
- should make the filename better
- lynx just yoinks the final part of the path, it seems
- way to show where links go
+- text search
+- character encoding options
+- don't line break on preformatted text...
+- should reset y value when switching between some tabs
+ - persistent memory sometimes though.
+ - perhaps on the basis of a page? sort of wonder about that though; like should this be stored in browser and then perhaps
+ - returned when queried for to do rendering? prat of a site? probably not that, not totally sure though.
+ - should be able to highlight arbitrary text / jump to a position on command
+ - what would the abstraction look like for that?
+ - This would likely take as an input a line text and output a pair with start / stop chars for selection
+ - iff delta p_1 - p_0 > 0 then highlight this line.
diff --git a/src/main.cpp b/src/main.cpp
@@ -52,6 +52,7 @@ struct DrawState {
std::string redirInput;
std::string openOtherInput;
std::string userInput;
+ std::string metaLine;
};
void drawInputBox(std::string text, std::string userInput) {
@@ -128,7 +129,7 @@ void draw(DrawState ds) {
}
if (ds.handleRedirect) {
- drawInputBox("Follow redirect (y/n): ", ds.redirInput);
+ drawInputBox("Redirect to " + ds.metaLine + " (y/n): ", ds.redirInput);
}
if(ds.handleInput) {
@@ -360,6 +361,12 @@ int main(int argc, char** argv) {
}
} else if (b.getCurrentSite()->getStatusCode() >= 30 && b.getCurrentSite()->getStatusCode() <= 39){
+
+ auto* st = b.getCurrentSite();
+ if(st != nullptr) {
+ ds.metaLine = st->getMeta();
+ }
+
Direction dir = handleRedir(ds);
if(dir == BACKWARD) {
b.goBack();
@@ -386,6 +393,11 @@ int main(int argc, char** argv) {
ds.header = "Welcome!";
}
+ auto* st = b.getCurrentSite();
+ if(st != nullptr) {
+ ds.metaLine = st->getMeta();
+ }
+
draw(ds);
refresh();