astro

a POSIX shell compatible gemini client (mirror of https://github.com/blmayer/astro)
git clone https://git.clttr.info/astro.git
Log (Feed) | Files | Refs (Tags) | README | LICENSE

commit 88c34af1a7ec7ee5a9bb8b59142bc9a320fc9aa6
parent 1a9af443e2e0a1ac81dc9d5b376899e14679b1e5
Author: Brian Mayer <bleemayer@gmail.com>
Date:   Wed, 18 Aug 2021 01:04:14 -0300

Merge pull request #5 from paemuri/ansi

Replace `\e` with `\033`
Diffstat:
Mastro | 16++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/astro b/astro @@ -91,7 +91,7 @@ fetch() { [ "$debug" ] && echo "Text width: $width" >&2 [ "$debug" ] && echo "Requesting $1://$2:$3/$4$5" >&2 - printf '\e]2;%s\007' "astro: $2/$4" + printf '\033]2;%s\007' "astro: $2/$4" echo "$1://$2:$3/$4$5" | openssl s_client \ -connect "$2:$3" -crlf -quiet \ -ign_eof 2> /dev/null | { @@ -190,10 +190,10 @@ fetch() { printf '%*s%s\n' "$margin" "" "$line" else case "$line" in - "### "*) sty='\e[35;1m' && line="$(echo "$line" | cut -c 5- )" ;; - "## "*) sty='\e[35;4m' && line="$(echo "$line" | cut -c 4-)" ;; - "# "*) sty='\e[35;4;1m' && line="$(echo "$line" | cut -c 3-)" ;; - "> "*) sty=' \e[2;3m' && line="$(echo "$line" | cut -c 3-)" ;; + "### "*) sty='\033[35;1m' && line="$(echo "$line" | cut -c 5- )" ;; + "## "*) sty='\033[35;4m' && line="$(echo "$line" | cut -c 4-)" ;; + "# "*) sty='\033[35;4;1m' && line="$(echo "$line" | cut -c 3-)" ;; + "> "*) sty=' \033[2;3m' && line="$(echo "$line" | cut -c 3-)" ;; "=>"*) link="$(echo "$line" | sed -e 's/^=> *\(\S\+\)\(\s*.*\)/\1 \2/g')" echo "$link" >> "$cachedir/links.txt" @@ -201,10 +201,10 @@ fetch() { # shellcheck disable=SC2086 line="$(echo $link | cut -d' ' -f2-)" [ -z "$line" ] && line="$link" - sty='\e[36;3m' - line="\\e[35m=>\\e[36;3m $line" + sty='\033[36;3m' + line="\\033[35m=>\\033[36;3m $line" ;; - '* '*) sty="" && line="\\e[35;1m •\\e[0m$(echo "$line" | cut -c 2-)";; + '* '*) sty="" && line="\\033[35;1m •\\033[0m$(echo "$line" | cut -c 2-)";; *) sty="";; esac echo "$line" | fold -w $width -s | {