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
- Check the machine actually has an active network adapter (Get-NetAdapter in PowerShell) and re-enable/reconnect it.
- Guard the network segment in your theme so it only renders when connectivity exists, or accept the segment simply not rendering.
- 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
- Only rely on network segments on machines with an active network adapter
- Expect no output from the segment when offline - that is by design
- Keep network drivers and PowerShell tooling healthy so adapter enumeration succeeds
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
- not connected
- network type '%s' not found
- unable to get data for team %s
- no assets found
- failed to parse nerd fonts release
AI-assisted analysis of JanDeDobbeleer/oh-my-posh@0976794618 (2026-08-31).
Data as JSON: /api/errors/d849b4435f26033d.
Report an issue: GitHub.