wsl

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 16, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecWindows

func ExecWindows(command string) (string, error)

ExecWindows runs a Windows command and returns stdout.

func IsWSL

func IsWSL() bool

IsWSL returns true if running under WSL.

func ToWSLPath

func ToWSLPath(winPath string) (string, error)

ToWSLPath converts a Windows path (C:\Users\Me) → /mnt/c/Users/Me.

func ToWindowsPath

func ToWindowsPath(wslPath string) (string, error)

ToWindowsPath converts a WSL path (/mnt/c/Users/Me) → C:\Users\Me.

func WindowsHome

func WindowsHome() (string, error)

WindowsHome returns the Windows user's home directory as a WSL path.

Types

type WSLInfo

type WSLInfo struct {
	IsWSL         bool   // True if running under WSL1 or WSL2
	DistroName    string // Value of WSL_DISTRO_NAME
	KernelVersion string // Contents of /proc/version
	InteropPath   string // Value of WSL_INTEROP
	WindowsHome   string // Windows home directory as a WSL path
}

func Info

func Info() *WSLInfo

Info returns cached WSL environment information.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL