The enclosed files are an example of a way to use a table lookup to set the terminal ID for BBx when running in a FacetTerm window. To implement the example on your system, do the following:
# setbbterm.tbl
# BBTERM tty,window
T1 /dev/tty1a,0
T11 /dev/tty1a,1
T12 /dev/tty1a,2
T2 /dev/tty2a,0
T21 /dev/tty2a,1
T22 /dev/tty2a,2
T3 /dev/tty3a,0
T31 /dev/tty3a,1
T32 /dev/tty3a,2
Example shell script named setbbtem
###############################################################
#
# setbbterm
#
# This script sets the BBTERM variable based on the original
# login terminal and the FacetTerm window number,
# if any. It should be invoked using # the ". setbbterm"
# command (so that the exported BBTERM variable is available to
# bbx. Then, when bbx is run, it will look for the alias line
# in the config.bbx file whose TTYID matches BBTERM.
#
###############################################################
###############################################################
#
# If this is not being run in a FacetTerm window,
# set the window number to zero and the ttyname using the tty
# command. If this is being run in a facetterm window, set the
# window number to the FacetTerm window number
# and the ttyname to the original terminal.
#
###############################################################
if fct_info not_a_window
then
TTY=`tty`
WINDOW=0
else
TTY=`fct_info ttyname`
WINDOW=`fct_info window_number`
fi
echo TTY=$TTY
echo WINDOW=$WINDOW
###############################################################
#
# Now, look up the combination of ttyname,window in the file
# and set the BBTERM variable to the first entry on that line,
# or to TX if no entry is found that matches.
#
###############################################################
set `grep $TTY,$WINDOW /etc/setbbterm.tbl` XxXx
if [ "$1" != "XxXx" ]
then
BBTERM=$1
else
BBTERM=TX
fi
export BBTERM
echo BBTERM=$BBTERM
###############################################################
#
# Note: What may appear to be apostrophes in the 4 noted
# lines above are actually the grave accent or "backward
# quote", or hex value 0x60.
#
###############################################################