Bug: SSH connection fails when targeting Windows host due to hardcoded 'sh' wrapper (corrupted CP949 error `'sh'() Ǵ...`)
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 48/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Tranquilo
- Stack tecnológico
- go
- Área
- cli, operating-systems
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Go
- Estrellas
- 22.4k
- Forks
- 1.1k
- Merge medio
- 12 d 6 h
- PR fusionados (30 d)
- 14
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de wavetermdev/waveterm
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
wavetermdev/waveterm#3481 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
wavetermdev/waveterm#3435 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
wavetermdev/waveterm#3432 ·
Los mantenedores suelen responder en 1 día
-
enhancement triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
wavetermdev/waveterm#3431 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
wavetermdev/waveterm#3428 ·
Los mantenedores suelen responder en 1 día
Todos los issues de wavetermdev/waveterm
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
google/differential-privacy#516 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 90/100
lightninglabs/lndmon#140 ·
-
documentation good first issue ready-for-triage ready-to-code
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
release-engineering/fbc-update-planner#102 · 3 comentarios ·
Los mantenedores suelen responder en 5 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
yetone/magpie#562 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
Los mantenedores suelen responder en 4 días