commit ddb79dd9d9d3eaabbc9496cbc6a75bdcc8726e97
parent af69669258fef2810a3d99f8503b971f8220ceb8
Author: blmayer <bleemayer@gmail.com>
Date: Mon, 26 Jul 2021 21:31:20 -0300
Improved relative link nav
Fixed print on POSIX shell
Diffstat:
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/astro b/astro
@@ -71,6 +71,7 @@ fetch() {
# Some setup first
cols=$(tput cols)
width=$((cols - (2*margin)))
+ [ "$debug" ] && echo "Text width: $width" >&2
[ "$debug" ] && echo "Requesting $1://$2:$3/$4$5" >&2
echo "$1://$2:$3/$4$5" | openssl s_client \
@@ -189,7 +190,7 @@ fetch() {
while IFS='' read -r txt
do
printf "%*s" "$margin" ""
- echo "$sty$txt"
+ printf "$sty$txt\n"
done
}
fi
@@ -231,6 +232,7 @@ fetch() {
port="$(echo "$newurl" | cut -d' ' -f3)"
path="$(echo "$newurl" | cut -d' ' -f4)"
+ [ "$path" ] || path="$host"; host="$2"
[ "$host" ] || host="$2"
[ "$debug" ] && echo "Seeking link: gemini://$host:$port/$path" >&2 && sleep 1