{"record":{"id":"86cad760c48cec34","repo":"wavetermdev/waveterm","slug":"registereddistros-not-implemented-on-this-system","errorCode":null,"errorMessage":"RegisteredDistros not implemented on this system","messagePattern":"RegisteredDistros not implemented on this system","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/wsl/wsl-unix.go","lineNumber":21,"sourceCode":"// Copyright 2025, Command Line Inc.\n// SPDX-License-Identifier: Apache-2.0\n\npackage wsl\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"os/exec\"\n)\n\ntype WslName struct {\n\tDistro string `json:\"distro\"`\n}\n\nfunc RegisteredDistros(ctx context.Context) (distros []Distro, err error) {\n\treturn nil, fmt.Errorf(\"RegisteredDistros not implemented on this system\")\n}\n\nfunc DefaultDistro(ctx context.Context) (d Distro, ok bool, err error) {\n\treturn d, false, fmt.Errorf(\"DefaultDistro not implemented on this system\")\n}\n\ntype Distro struct{}\n\nfunc (d *Distro) Name() string {\n\treturn \"\"\n}\n\nfunc (d *Distro) WslCommand(ctx context.Context, cmd string) *WslCmd {\n\treturn nil\n}\n\n// just use the regular cmd since it's\n// similar enough to not cause issues","sourceCodeStart":3,"sourceCodeEnd":39,"githubUrl":"https://github.com/wavetermdev/waveterm/blob/a4447c1563b2df285ab89e76c82f91e1a1a49c1e/pkg/wsl/wsl-unix.go#L3-L39","documentation":"RegisteredDistros in wsl-unix.go is the non-Windows stub of the WSL integration. WSL only exists on Windows, so on Linux/macOS this function always returns this error instead of listing installed WSL distributions.","triggerScenarios":"Calling wsl.RegisteredDistros (directly or via the WslListCommand RPC) on a Linux or macOS build of Wave.","commonSituations":"Users running wsh/waveterm on Linux/macOS invoking WSL block commands; cross-platform code paths not gated by runtime.GOOS.","solutions":["Only invoke WSL commands on Windows builds — gate with runtime.GOOS == \"windows\" before calling","On Unix systems, use native shell/SSH connections instead of WSL blocks","Treat the error as expected behavior and surface 'WSL is only available on Windows' in UI/CLI"],"exampleFix":"// before\ndistros, err := wsl.RegisteredDistros(ctx)\n// after\nif runtime.GOOS != \"windows\" {\n    return fmt.Errorf(\"WSL is only available on Windows\")\n}\ndistros, err := wsl.RegisteredDistros(ctx)","handlingStrategy":"fallback","validationCode":"if runtime.GOOS != \"windows\" {\n    return errors.New(\"WSL listing unavailable: not a Windows host\")\n}","typeGuard":null,"tryCatchPattern":"distros, err := wsl.RegisteredDistros(ctx)\nif err != nil {\n    distros = nil // non-Windows host: fall back to native connections\n}","preventionTips":["Gate all WSL code behind runtime.GOOS == \"windows\"","Disable WSL block types in UI/CLI on Unix builds","Skip WSL tests on non-Windows CI runners"],"tags":["wsl","platform","unsupported"],"backgroundTag":"platform-not-supported","analyzedSha":"a4447c1563b2df285ab89e76c82f91e1a1a49c1e","analyzedAt":"2026-09-01T15:26:23.972Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}