JanDeDobbeleer/oh-my-posh · error

no connections found

Error message

no connections found

What it means

Terminal.Connection returns information about the active network connection (WiFi, ethernet, cellular, etc.). It lazily enumerates network interfaces via getConnections(); if the enumeration returns an empty list, no connection data exists to match against and this error is returned instead of a *Connection.

Source

Thrown at src/runtime/terminal_windows.go:231

func (term *Terminal) ConvertToWindowsPath(input string) string {
	return strings.ReplaceAll(input, `\`, "/")
}

func (term *Terminal) ConvertToLinuxPath(input string) string {
	return input
}

func (term *Terminal) DirIsWritable(input string) bool {
	defer log.Trace(time.Now())
	return term.isWriteable(input)
}

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. Check the machine actually has an active network adapter (Get-NetAdapter in PowerShell) and re-enable/reconnect it.
  2. Guard the network segment in your theme so it only renders when connectivity exists, or accept the segment simply not rendering.
  3. If adapters exist but still fail, update network drivers / verify `netsh wlan show interfaces` works, since getConnections relies on OS network tooling.
Defensive patterns

Strategy: try-catch

Validate before calling

// PowerShell: ensure an active adapter exists before enabling the network segment
if ((Get-NetAdapter | Where-Object Status -eq 'Up').Count -gt 0) { "network available" }

Try / catch

// caller (prompt engine) treats the error as 'segment disabled'
conn, err := term.Connection(wifi)
if err != nil {
    // skip rendering the network segment
    return
}

Prevention

When it happens

Trigger: Calling term.Connection(anyType) on Windows when getConnections() returns an empty slice - typically no active network adapters/interfaces, or the native WiFi/API calls fail and produce zero results.

Common situations: Running on a machine with all network adapters disabled or in airplane mode; Windows VM/container without virtual network adapters; drivers/PowerShell network cmdlets failing so enumeration silently yields nothing; using a network segment while disconnected.

Related errors


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