Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Bug: SSH connection fails when targeting Windows host due to hardcoded 'sh' wrapper (corrupted CP949 error `'sh'() Ǵ...`)

オープン
#3,427 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
48/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
静か
技術スタック
go

調査の方向性

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
  1. 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.)

  2. Hardcoded sh -c wrapper
    In the Go source code, when detecting the platform of the remote machine:

  • In pkg/remote/connutil.go inside GetClientPlatform, uname -sm is run to determine the target OS and architecture.

  • However, in pkg/genconn/genconn.go inside BuildShellCommand, all remote shell commands are wrapped in sh -c by default:

    return fmt.Sprintf("sh -c %s", shellutil.HardQuote(envVars.String()+shellCmd)), nil
    
  • Since a Windows host does not have sh installed in its %PATH% by default, executing sh -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 sh fails or is missing, try executing commands via cmd.exe /c or powershell -Command when 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

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

wavetermdev/waveterm のほかの issue

wavetermdev/waveterm の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。