0

I am running a tmux session on a server where I do my development work (this is where I run emacs). I have two monitors - how do I use both of them with the same emacs session? If I join the same tmux session, the monitors just mirror each other. If I am not in the same tmux session (and by extension a different emacs session) I will have to reread from disk everytime a file gets updated, and there can be differences between the different working versions of files. Any thoughts on how to use both monitors here?

Andrew
  • 551
  • 6
  • 18

1 Answers1

1

You can start two tmux sessions. In one you run an Emacs and start the "Emacs server" using M-x emacs-server RET. In the other you can run emacsclient -nw, this will create a second tty frame.

In fact, you can use emacsclient -nw to connect to a graphical Emacs, in case one in running on the machine.

Lindydancer
  • 6,150
  • 1
  • 15
  • 26
  • Is there a way to do that in the same tmux session? Should I care if it is in the same tmux session? – Andrew Feb 25 '16 at 21:43
  • Of course, you can use the same tmux session on both monitors. Then you can start Emacs in one tmux window (or pane, I never remember the correct terminology) and emacsclient in another. – Lindydancer Feb 26 '16 at 06:06
  • when i attach to the same tmux session, it just mirrors the other monitor - is the some other command i should use? – Andrew Feb 28 '16 at 06:22
  • You have to run Emacs in one tmux window and emacsclient in another, and display then on the different monitors. – Lindydancer Feb 28 '16 at 08:05
  • sorry, still not following. the steps I was taking were 1. open terminal in left window, ssh and tmux attach 2. open terminal in right window ssh, and tmux attach. When I do that they are mirrrored, so I can't do separate things like only open emacs in one window and emacsclient in the other as the commands are mirrored – Andrew Feb 29 '16 at 18:16
  • You will need to create a second tmux window using <PREFIX>-c, and show one tmux window in each terminal. In fact, you don't need tmux at all to get Emacs up and running on two monitors. – Lindydancer Feb 29 '16 at 20:50
  • was looking at this question http://unix.stackexchange.com/questions/24274/attach-to-different-windows-in-session, seems I need to make another tmux session . So back at square one, make two tmux sessions. Thanks for your help! – Andrew Feb 29 '16 at 23:29