update init.el: check if TERM is defined