2011-10-02 49 views
1
ssh -X [email protected] "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搜索,但找不到解決方案來解決它。emacsclient:無法獲取終端名稱

更新: 我認爲emacs客戶端(在本地計算機上)連接到emacs服務器(在遠程計算機上),以便emacs客戶端可以編輯本地計算機上的文件。但它似乎並沒有這樣工作...

+0

在你運行'ssh'的本地機器上,你可以與我們分享'echo $ DISPLAY'的結果嗎? –

+0

ssh在本地機器上。 $ DISPLAY的值是:0 – louxiu

回答

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 
+0

第一種方法:emacsclient -c -d $ DISPLAY 「等待Emacs ... *錯誤*:顯示無效,而不是主機:服務器或主機:SERVER.SCREEN」第二種方法:相同結果與第一個。 – louxiu

+0

如果你給它一些東西打開它工作得很好。 'emacsclient -c -d $ DISPLAY/tmp/test.txt' – DJJ