【问题标题】:Emacs: Opening a file within the same Emacs session from a tmux session in ansi-termEmacs:在 ansi-term 中从 tmux 会话中打开同一 Emacs 会话中的文件
【发布时间】:2014-04-17 20:43:36
【问题描述】:

我经常遇到这样的情况,我想打开一个文件,该文件从我的 tmux 会话中以 ansi-term 格式查看到我的 Emacs 会话中。我尝试使用find-file-at-point(请参阅下面的Max Bozzi 的答案),但在 tmux 中它只会将我引导到我的 ansi-term 会话的工作目录,并且它不会在我的 tmux 会话中检测到该文件。单独使用 ansi-term,find-file-at-point 可以正常工作,但我更喜欢使用会话管理器,或者至少是可靠的终端多路复用器。

有什么建议吗?

例如,这是我在 ansi-term 中的 tmux 会话:

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

如何在我的 Emacs 会话中打开 test.txt

【问题讨论】:

    标签: session emacs ansi-term


    【解决方案1】:

    一种选择是将点放在文件名上,然后运行find-file-at-point。我发现绑定到M-' 很有用。

    另一种方法是只使用标准的C-c C-f 并用制表符完成名称,或者如果你真的想要的话,可以使用递归 Emacs 并让 Emacs 在 Emacs 自己的终端缓冲区中运行。不过,大概你不会,所以我会坚持find-file-at-point

    【讨论】:

    • 谢谢,这很有帮助,但它不适用于我通常在 ansi-term 中运行的 tmux session 。 find-file-at-point 仅将我定向到我的 ansi-term 会话的工作目录,并且在我的 tmux 会话中没有检测到任何内容。有什么建议吗?
    猜你喜欢
    • 2015-06-15
    • 2012-01-21
    • 1970-01-01
    • 2012-12-31
    • 1970-01-01
    • 2011-02-22
    • 1970-01-01
    • 1970-01-01
    • 2020-06-30
    相关资源
    最近更新 更多