fixed $TERM recognition