Skip to content

Commit

Permalink
Changed some escape sequences
Browse files Browse the repository at this point in the history
  • Loading branch information
blmayer committed Dec 19, 2023
1 parent 30574fd commit de956ea
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions astro
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ typesetgmi() {
printf "%*s" "$margin" ""

# shellcheck disable=SC2059
printf -- "$sty$txt\n\e[m"
printf -- "$sty$txt\n\033[m"
done
}
done
Expand All @@ -291,7 +291,7 @@ pager() {
clear

# hide cursor
printf '\e[?25l'
printf '\033[?25l'

# lines columns
lines="$(tput lines)"
Expand Down Expand Up @@ -362,7 +362,7 @@ pager() {
esac ;;
"$quitkey") exit 0 ;;
"$openkey")
printf '\e[%sH\e[?25h\e[2KType url: ' "$lines"
printf '\033[%sH\033[?25h\033[2KType url: ' "$lines"
stty echo icanon
read -r url <&1

Expand All @@ -373,10 +373,9 @@ pager() {
esac
return
;;
# FIXME: dont know how yet
"$openlocalkey")
# Open local gmi file
printf '\e[?25h\e[2KType file path: '
printf '\033[?25h\033[2KType file path: '
stty echo
read -r file <&1
typesetgmi < "$file" > "$pagefile"
Expand All @@ -385,7 +384,7 @@ pager() {
;;
"$refreshkey") return ;;
"$gokey")
printf '\e[?25hEnter link number: '
printf '\033[?25hEnter link number: '
stty echo icanon
read -r i <&1
debug "selected $i"
Expand All @@ -401,7 +400,7 @@ pager() {
;;
"$homekey") url="$homepage"; return ;;
"$markkey")
printf '\e[?25h\e[KEnter description: (optional)'
printf '\033[?25h\033[KEnter description: (optional)'
stty echo icanon
read -r desc <&1
echo "$url $desc" >> "$bookmarkfile"
Expand All @@ -410,7 +409,7 @@ pager() {
"$gomarkkey")
clear
cat -n "$bookmarkfile"
printf "\e[?25h\e[KEnter link number: "
printf "\033[?25h\033[KEnter link number: "
stty echo icanon
read -r i <&1
url="$(sed "${i}q;d" "$bookmarkfile" | cut -d' ' -f1)"
Expand Down

0 comments on commit de956ea

Please sign in to comment.