commit 429a9ab40cebda48592bdd8743bfecb66d525085
parent 713a34e1aa71d1251fdaf8288a1201dd9fab0cb0
Author: Luxferre <lux@ferre>
Date: Fri, 31 Mar 2023 08:22:32 +0300
Gophermap RFC improvement
Diffstat:
2 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/README.md b/README.md
@@ -13,6 +13,7 @@ Improvements over the original Bopher from that post:
- mouse support (where possible)
- smoother rendering and scrolling
- better edge-case stability (e.g. on macOS where using file descriptor 3 actually crashes everything)
+- better Gophermap processing according to the RFC
- multi-level navigation history (although you can only go back)
- status bar with currently opened resource name
- ability to accept `gopher://` URLs from the command line
@@ -58,6 +59,10 @@ Besides having Tor itself up and running, you also need to have the `torsocks` w
torsocks bash bopher-ng.sh gopher://[some-address].onion
```
+## Will there be any Gopher-TLS support?
+
+No. Besides the ambiguity problem, it will also introduce huge external dependencies. Use .onion services instead whenever possible.
+
## How to control Bopher-NG?
- Scrolling: Up/Down arrow keys, k/j keys or mouse scroll wheel (if supported)
diff --git a/bopher-ng.sh b/bopher-ng.sh
@@ -7,6 +7,7 @@
# - mouse support
# - smoother rendering and scrolling
# - better edge-case stability
+# - better Gophermap processing according to the RFC
# - multi-level navigation history (although you can only go back)
# - status bar with currently opened resource name
# - ability to accept gopher:// URLs from the command line
@@ -152,6 +153,7 @@ amclick() { # args: AM line[, forcedl], output: AM line(s)
for line in "${lines[@]}"; do # iterate over every fetched line
line="${line##$'\n'}" # remove a starting LF if it's there
line="${line%%$'\r'}" # remove a trailing CR if it's there
+ [[ "$line" == '.' ]] && break # stop processing Gophermaps on .
gmparse "$line" "$rhost" "$rport"
done
elif [[ 'P' == "$action" ]]; then # plain text content (can be delimited with both CRLF or LF)