Bug: SSH connection fails when targeting Windows host due to hardcoded 'sh' wrapper (corrupted CP949 error `'sh'() Ǵ...`)
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 48/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 技術スタック
- go
- 領域
- cli, operating-systems
調査の方向性
Start in pkg/remote/connutil.go at GetClientPlatform and pkg/genconn/genconn.go at BuildShellCommand, then reproduce wsh conn reinstall against a Windows OpenSSH target. Trace how uname -sm becomes sh -c and how the resulting Windows error is decoded. Done means platform detection no longer fails because sh is unavailable and the reported error is readable.
索引モデルが issue の本文から書いたものです。
説明
Description
When attempting to connect or reinstall a connection (wsh conn reinstall) to a remote target that runs on Windows OS (with native OpenSSH server enabled), the process fails during client platform detection. The terminal prints a corrupted, unreadable error message:
Error: reinstalling connection: error detecting client platform: error running uname -sm: Process exited with status 1, stderr: 'sh'() Ǵ , α, Ǵ ġ ƴմϴ.
Root Cause Analysis
-
Decoding Error (CP949 to UTF-8)
The unreadable message'sh'() Ǵ , α, Ǵ ġ ƴմϴ.is the CP949-encoded Windows Command Prompt/PowerShell error message decoded as UTF-8 in Go. The original Korean error message is:
'sh'은(는) 내부 또는 외부 명령, 실행할 수 있는 프로그램, 또는 배치 파일이 아닙니다.
(English translation:'sh'is not recognized as an internal or external command, operable program or batch file.) -
Hardcoded
sh -cwrapper
In the Go source code, when detecting the platform of the remote machine:
-
In
pkg/remote/connutil.goinsideGetClientPlatform,uname -smis run to determine the target OS and architecture. -
However, in
pkg/genconn/genconn.goinsideBuildShellCommand, all remote shell commands are wrapped insh -cby default:return fmt.Sprintf("sh -c %s", shellutil.HardQuote(envVars.String()+shellCmd)), nil -
Since a Windows host does not have
shinstalled in its%PATH%by default, executingsh -c 'uname -sm'fails immediately with the Windows command-not-found error.
Environment
- Client OS: Windows/Linux/macOS
- Remote Target OS: Windows (running OpenSSH)
- Wave Terminal / wsh version: v0.14.5
Suggested Mitigation / Fixes
- Detection fallback: If
shfails or is missing, try executing commands viacmd.exe /corpowershell -Commandwhen targeting Windows hosts, or allow specifying the shell/OS configuration beforehand. - Graceful parsing: Handle different shell error codes and decoding errors (like CP949 fallback for Windows targets) to show friendly messages when the shell invocation fails.
- 主要言語
- Go
- スター
- 22.4k
- フォーク
- 1.1k
- 平均マージ
- 3日 13時間
- マージ済み PR(30日)
- 13
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
wavetermdev/waveterm のほかの issue
-
pwsh: encodeEnvVarsForPowerShell rejects Windows-standard env var names like ProgramFiles(x86), breaking wsh token on every pwsh block対応中かも @vortsghost2025 が 26 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
wavetermdev/waveterm#3481 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
wavetermdev/waveterm#3435 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
wavetermdev/waveterm#3432 ·
メンテナーはふだん 1 日以内に返信
-
enhancement triage
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
wavetermdev/waveterm#3431 ·
メンテナーはふだん 1 日以内に返信
-
[Bug]: web blocks become unresponsive when switching focus between two of them対応中かも @jameswolensky が 84 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
wavetermdev/waveterm#3428 ·
メンテナーはふだん 1 日以内に返信
wavetermdev/waveterm の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
JuliusBrussee/caveman#1189 ·
メンテナーはふだん 1 日以内に返信
-
agent-review-finding chore
難易度 2/5 半日 初心者へのやさしさ 78/100
jordansmall/spindrift#4497 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
bug from-studio
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
esengine/DeepSeek-Reasonix#12044 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1〜3時間 初心者へのやさしさ 82/100