Extensions to emacs shell mode