0

I often come across the situation where I want to open a file that I am viewing from my tmux session in ansi-term into my Emacs session. I tried to use find-file-at-point (see Max Bozzi's answer below), but in tmux it only directs me to the working directory of my ansi-term session, and it does not detect the file in my tmux session. With ansi-term alone, find-file-at-point works fine, but I prefer to use a session manager, or at least a solid terminal multiplexer.

Any suggestions?

For example, here is my tmux session in ansi-term:

lucas@~/Downloads$ ls
A CHRISTMAS CAROL (ILLUSTRATED with Special Kindle Format).azw3
bleachbit_1.0_all_ubuntu1310.deb
Island of the Blue Dolphins.azw3
javaPong.jnlp
test.txt

How do I open test.txt within my Emacs session?

modulitos
  • 14,737
  • 16
  • 67
  • 110

1 Answers1

1

One option is to place point on the name of the file and then run find-file-at-point. I find that to be useful enough to bind to M-'.

Another is to just use the standard C-c C-f and tab-complete the name, or maybe if you really wanted to, to have recursive Emacs and have Emacs running inside Emacs' own terminal buffer. Presumably you wouldn't, though, so I would stick to find-file-at-point.

smiling_nameless
  • 1,047
  • 1
  • 9
  • 23
  • Thanks, this is very helpful, but it does not work for my tmux session , which I usually run inside ansi-term. `find-file-at-point` only directs me to the working directory of my ansi-term session, and it does not detect anything in my tmux session. Any suggestions? – modulitos Apr 18 '14 at 02:04