Added terminal stuff for emacs