+# returns okay (0) if the stack is empty, or non-zero if not empty.
+function ptt_stack_empty()
+{
+ if [ -z "$PTT_STACK_INDEX" ]; then
+ # fix the index value.
+ PTT_STACK_INDEX=0
+ true
+ else
+ test $PTT_STACK_INDEX -le 0
+ fi
+}
+
+# a debugging function that should never have been necessary.
+# a little bit furious the restore is failing during regenerate right now.
+function show_terminal_titles()
+{
+ echo terminal title list now has:
+ local i=${#PRIOR_TERMINAL_TITLES[@]}
+ if ptt_stack_empty; then
+ echo the list is empty
+ else
+ while ((i--)); do
+ echo "ent #$i: '${PRIOR_TERMINAL_TITLES[$i]}'"
+ done
+ fi
+}
+