Commit c9ed820e authored by John A's avatar John A

Improve mktemp name, bug fixes

Fix bug that left the terminal with an incorrect tab length, and set default values to variables that threw comparison error.
parent 969adc7d
......@@ -375,7 +375,8 @@ init() {
fi
# setup temp file for caching times of each growth
tmpFile="$(mktemp -p /tmp bonsai.sh.XXXXXXXX)"
mkdir -p /tmp/bonsai.sh
tmpFile="$(mktemp -p /tmp/bonsai.sh bonsai.sh.XXXXXXXX)"
}
grow() {
......@@ -581,7 +582,7 @@ branch() {
grid[$y,$newX]="${color}${char}"
# ensure we keep track of last column
[ $y -gt 0 ] && [ -n "${listChanged[$y]}" ] && [ $newX -gt ${listChanged[$y]} ] && listChanged[$y]=$newX
[ ${y:-0} -gt 0 ] && [ -n "${listChanged[$y]}" ] && [ ${newX:-0} -gt ${listChanged[$y]} ] && listChanged[$y]=$newX
index=$((index+1))
done
......@@ -631,6 +632,7 @@ quit() {
if ((! nfetch)); then
stty echo # echo stdin
printf '%b\n' '\e[?25h\e[?7h'"${R}" # show cursor, enable line wrapping, reset colors
tabs 8
else
printf '\n' # reset formatting, put cursor on next line
fi
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment