How to attach to a remote emacs session

I was away from my workstation which was running an emacs with several open files (some potentially unsaved!) when I wanted to access some of those files.

My emacs is always configured to run the server process. This means I can start an emacs process and edit any file with `emacsclient $file`. Instead of a new emacs process, the file is opened by my original emacs.

I was curious if I could use emacsclient to connect remotely to a running frame: I can. By ssh’ing in I can run `emacsclient -nw` (no-window) and get a new frame of that emacs client in the terminal which has all my buffers open and ready to go.

Alternatively, if you’re forwarding X connections, using `ssh -X` for instance, `emacsclient -c` will fire up a new emacs frame on your local machine which shares the same emacs process.

More information:

There is a difference between performing a calculation and solving a problem. I’ve been considering the equation of a circle, . Except, you see, that’s not the entire thing. There’s a bit that we’ve dropped because it’s  zeroes (and therefore doesn’t affect our equation): . This equation contains the full information–everything that is necessary to draw and position […]