-# just saying this is an array...
-#declare -a PRIOR_TERMINAL_TITLES
-#and that whole approach fails; arrays aren't passed to subshells, so any commands
-# that execute in a subshell don't know about the contents and thus don't do what we want.
-#hmmm: revise back to single level memory.
-
-# set the stack position if not already set.
-if [ -z "$PTT_STACK_INDEX" ]; then
- # this variable records where we will push new items on the stack.
- PTT_STACK_INDEX=0
-fi
-
-# 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()
-{
- sep 14
- echo "[terminal title list now has...]"
- local i=${#PRIOR_TERMINAL_TITLES[@]}
- if ptt_stack_empty; then
- echo the terminal title list is empty.
- else
- while ((i--)); do
- echo "ent #$i: '${PRIOR_TERMINAL_TITLES[$i]}'"
- done
- fi
- sep 14
-}