JanDeDobbeleer/oh-my-posh · warning

network type '%s' not found

Error message

network type '%s' not found

What it means

Terminal.Connection looks up a cached network connection of the requested ConnectionType (e.g. wifi, ethernet, cellular) from the networks collected by getConnections. If networks were collected but none match the requested type, it logs this error and returns &NotImplemented{} - signaling the shell/runtime cannot supply that connection type, not a network failure.

Source

Thrown at src/runtime/terminal_windows.go:243

}

func (term *Terminal) Connection(connectionType ConnectionType) (*Connection, error) {
	if term.networks == nil {
		networks := term.getConnections()
		if len(networks) == 0 {
			return nil, errors.New("no connections found")
		}

		term.networks = networks
	}

	for _, network := range term.networks {
		if network.Type == connectionType {
			return network, nil
		}
	}

	log.Error(fmt.Errorf("network type '%s' not found", connectionType))
	return nil, &NotImplemented{}
}

View on GitHub (pinned to 0976794618)

Solutions

  1. Request a connection type that exists on the machine (check ethernet vs wifi), or make the segment tolerate a missing type.
  2. Check the machine's adapters (Get-NetAdapter) to see which connection types are actually available.
  3. Handle the returned *NotImplemented{} error gracefully in the segment/template (the prompt should just omit the info).
  4. If the adapter exists but isn't detected, verify it isn't a virtual/VPN-only interface and update network drivers.
Defensive patterns

Strategy: type-guard

Validate before calling

// Probe which connection types exist before requesting
netInfo, _ := shims.NetworkInfo() // or adapter enumeration
hasType := func(t string) bool {
    for _, n := range netInfo { if strings.EqualFold(n, t) { return true } }
    return false
}

Type guard

var notImpl *NotImplemented
if errors.As(err, &notImpl) {
    // connection type unsupported on this machine
}

Try / catch

conn, err := term.Connection(connectionType)
if err != nil {
    if nie, ok := err.(*NotImplemented); ok {
        // type not available: hide the network segment
        return nil
    }
    return nil
}

Prevention

When it happens

Trigger: Requesting Connection("wifi") (or another type) when the Windows machine has no adapter of that type, or when the Win32 API enumeration (getConnections) doesn't classify any adapter as the requested type.

Common situations: Desktop without Wi-Fi (ethernet-only) while the prompt segment requests wifi info; virtual/VPN adapters that don't report a standard connection type; disconnected adapters omitted from the enumeration.

Related errors


AI-assisted analysis of JanDeDobbeleer/oh-my-posh@0976794618 (2026-08-31). Data as JSON: /api/errors/2c7dd7c2d6e45a83. Report an issue: GitHub.