-# just saying this is an array...
-declare -a PRIOR_TERMINAL_TITLES
-# 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
-
-# adds an entry into the stack of terminal titles.
-function push_ptt_stack()
-{
- PRIOR_TERMINAL_TITLES[$PTT_STACK_INDEX]="$*"
-echo now list has:
-echo ${PRIOR_TERMINAL_TITLES[@]}
- ((PTT_STACK_INDEX++))
-echo stack index incremented and now at $PTT_STACK_INDEX
-}
-
-function pop_ptt_stack()
-{
- if [ $PTT_STACK_INDEX -le 0 ]; then
- echo nothing to pop from prior terminal titles stack.
- else
- ((PTT_STACK_INDEX--))
-echo stack index decremented and now at $PTT_STACK_INDEX
- CURRENT_TERM_TITLE="${PRIOR_TERMINAL_TITLES[$PTT_STACK_INDEX]}"
- fi
-}
-
-# returns okay (0) if the stack is empty, or non-zero if not empty.
-function ptt_stack_empty()
-{
- test $PTT_STACK_INDEX -le 0
-}