Though emacs has the ability to run a shell inside (three different ones actually), anything that requires more than just a “dumb terminal” doesn’t work as well as I’d like in these emulated terminals. My research in finding a solution has lead to some creative answers such as using tmux (thanks Takashi) which on its own solves and improves tons of daily workflow situations. I, however, will dedicate that topic in it’s entirety to another entry as it does add some optional complexity to your workflow; too much if you’re looking to solve just this one problem.

What I really want to be able to do is to be working in emacs on a remote machine (via ssh) with all my windows and buffers setup and to drop down to shell occasionally to look something up or run some other scripts and then move back to emacs at will. This is easy if you’re running emacs on your local terminal on OS X: just like any other process like top, use C-z to move emacs to a background process and type fg when you want to move it back to the foreground. All your current windows and buffers are resumed. On the two remote machines I’ve tested C-z just moved you to the previous line. I’ve tried unbinding that key combo, but all I get is a terminal beep. After some research and hanging around the #emacs chan (thanks insomniaSalt) the answer is to drop this in your .emacs file. Now C-z will work as it does on your local terminal:

(global-set-key "\C-z" 'suspend-emacs) ; Stops emacs and return to superior process