Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

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

Abierto
#3,427 0 comentarios 0 reacciones 0 asignados Ver en GitHub

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

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
  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.
Lenguaje dominante
Go
Estrellas
22.4k
Forks
1.1k
Merge medio
12 d 6 h
PR fusionados (30 d)
14

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de wavetermdev/waveterm

Todos los issues de wavetermdev/waveterm

Issues similares

Más issues de Go

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.