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
我已经谷歌过了,但是我找不到解决这个问题的方法。
更新:我认为emacs客户端(在本地机器上)连接到emacs服务器(在远程机器上),这样emacs客户端就可以在本地机器上编辑文件。但事实似乎并非如此……
将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