[英]emacs Tramp on Windows: plink says /bin/sh: env: command not found
[英]Emacs 24.3 for windows, Tramp byte-code: Couldn't find a proper `ls' command
24.2運行良好,但24.3 bounded tramp在打開遠程Linux系統文件或目錄時出現以下錯誤:
"byte-code: Couldn't find a proper `ls' command"
我打開tramp trace並發現,所有遠程搜索路徑和文件路徑都是通過某種東西擴展,在開頭添加一個額外的“c:”。 結果是tramp既沒有找到我要打開的命令也沒有找到文件。
16:04:51.768000 tramp-get-connection-property (7) # process-buffer nil
16:04:51.769000 tramp-set-file-property (8) # c:/bin file-directory-p nil
16:04:51.770000 tramp-get-file-property (8) # c:/usr/bin file-directory-p undef
...
16:04:59.531000 tramp-sh-handle-file-truename (5) # Check /c:
16:04:59.532000 tramp-get-file-property (8) # c:/c: file-attributes-integer undef
...
16:04:51.773000 tramp-get-connection-property (7) # process-name nil
16:04:51.773000 tramp-get-connection-property (7) # chunksize 0
16:04:51.773000 tramp-set-connection-property (7) # last-cmd-time (20809 28067 773000 0)
16:04:51.774000 tramp-send-string (10) # test -d c\:/usr/bin 2>/dev/null; echo tramp_exit_status $?
有人知道這個嗎? 提前致謝。
合並@AlanThird的答案和@uscjeremy的評論,這對我有用(2013-03-17的GNU Emacs 24.3.1(i386-mingw-nt5.1.2600),關於MARVIN,Windows XP / SP3 / 32) :
字節編譯tramp-sh.el
(相應地調整路徑):
(byte-compile-file "C:/Program Files (X86)/emacs/lisp/net/tramp-sh.el")
退出Emacs。
刪除Tramp緩存: ~/.emacs.d/tramp
啟動Emacs。
另請參閱gnu.org上的錯誤報告#14030 。
看來這是tramp中的一個bug,但是你不需要升級tramp,所有你需要做的就是在Windows機器上重新編譯tramp-sh.el。 有關詳細信息,請參閱此處的錯誤報告。
在暫存緩沖區中輸入:
(byte-compile-file "C:/Program Files/emacs/lisp/net/tramp-sh.el")
調整路徑以匹配您的安裝,然后鍵入Ctrl-Meta-x以重新編譯該文件。 如果它抱怨權限,您可能需要使用Windows中的“以管理員身份運行”選項重新啟動emacs。
重新編譯文件后,鍵入Mx tramp-cleanup-all-connections以重置tramp連接緩存。 這將關閉您打開的所有tramp連接。
切換到Emacs 24.3后,我遇到了同樣的問題。 解決方案是升級到最新的Tramp 2.2.7。 這是我做的:
執行Mx tramp-version以確保正確安裝。 現在tramp到處工作(dired,eshell,shell等)。
使用帶有(byte-compile-file ..)
eval-expression
對我來說不起作用,但是下面做了:
Mx byte-compile-file
:c:/ Program Files / emacs-24.3 / lisp / net / tramp-sh.el tramp-cleanup-all-connections
,然后再次嘗試打開遠程文件。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.