2
ssh -X root@localhost "emacsclient -c"

Warning: untrusted X11 forwarding setup failed: xauth key data not generated
Warning: No xauth data; using fake authentication data for X11 forwarding.
emacsclient: could not get terminal name

我已经google了,但我找不到解决它的解决方案。

更新:我认为 emacs 客户端(在本地机器上)连接到 emacs 服务器(在远程机器上),以便 emacs 客户端可以在本地机器上编辑文件。但它似乎并没有那样工作......

4

1 回答 1

2

使用带有远程转发的 emacsclient 有点棘手(并且行为可能在某些时候已被修复/更改)。

您可以做的一件事就是正常 ssh 到服务器,并将当前的 ssh 显示显式传递给 emacs:

emacsclient -c -d $DISPLAY

在emacsclient wiki上也找到了这个:

ssh remote_host -f emacsclient --eval ‘”(make-frame-on-display \”$DISPLAY\”)”’

更新:

由于 emacs 似乎不喜欢 ":0" 显示,请尝试明确写出:

emacsclient -c -d localhost:0
于 2011-10-02T15:38:01.893 回答