fixed tty/pre_cmd problem related to exporting TERM