簡體   English   中英

Windows上的emacs Tramp:plink說/ bin / sh:env:找不到命令

[英]emacs Tramp on Windows: plink says /bin/sh: env: command not found

我正在Windows上使用emacs Tramp,試圖遠程登錄Windows PC。 它發出以下plink命令失敗(在emacs和cmd.exe上均失敗)

雖然油灰給了我一個會議。 我想通過emacs使用它。 我需要做什么才能使其在Windows上的Tramp上運行。

注意:我已經嘗試過一個SO答案中提到的字節編譯文件tramp-sh.el修復程序。 已更新為通過Git MSys2使用Emacs 26.1(可以說是最小的cygwin)。 參考更多的答案,但沒有找到對目標Windows PC的幫助。 任何幫助指針表示贊賞。

CMD.EXE:

C:\Users\myUser>plink -v -l int***** -ssh -t inpu******* " env 'TERM=dumb' 'PROMPT_COMMAND=' 'PS1=
#$ ' ssh " && exit | exit
... 
...
Sent password
Access granted
Opening session as main channel
Opened main channel
Allocated pty (ospeed 38400bps, ispeed 38400bps)
Started a shell/command
/bin/sh: env: command not found
Server sent command exit status 0
Disconnected: All channels closed

Emacs的:

Tramp: Opening connection for int*****@inpu******* using plink...
Tramp: Sending command ‘plink -l int*****  -ssh -t inpu******* " env 'TERM=dumb' 'PROMPT_COMMAND=' 'PS1=#$ ' /bin/sh " && exit || exit’
Tramp: Waiting for prompts from remote shell...
Tramp: Sending password
Tramp: Waiting for prompts from remote shell...failed
Tramp: Opening connection for int*****@inpu******* using plink...failed 

更新1:僅使用MSys2而不是/ bin / sh退出(預期將使用MSys2啟動Shell會話)

Sent password
Access granted
Opening session as main channel
Opened main channel
Allocated pty (ospeed 38400bps, ispeed 38400bps)
Started a shell/command
*exits here*

Tramp希望“ / bin / sh”作為遠程shell。 請參見可變的tramp-methods ,條目“ plink”,屬性tramp-login-program 您可以更改此設置(Tramp手冊進行了說明),但是無論您選擇什么,它都必須是POSIX兼容的外殼。 不知道,MS Windows上是否有這樣的野獸。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM