{"record":{"id":"d849b4435f26033d","repo":"JanDeDobbeleer/oh-my-posh","slug":"no-connections-found","errorCode":null,"errorMessage":"no connections found","messagePattern":"no connections found","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/runtime/terminal_windows.go","lineNumber":231,"sourceCode":"\nfunc (term *Terminal) ConvertToWindowsPath(input string) string {\n\treturn strings.ReplaceAll(input, `\\`, \"/\")\n}\n\nfunc (term *Terminal) ConvertToLinuxPath(input string) string {\n\treturn input\n}\n\nfunc (term *Terminal) DirIsWritable(input string) bool {\n\tdefer log.Trace(time.Now())\n\treturn term.isWriteable(input)\n}\n\nfunc (term *Terminal) Connection(connectionType ConnectionType) (*Connection, error) {\n\tif term.networks == nil {\n\t\tnetworks := term.getConnections()\n\t\tif len(networks) == 0 {\n\t\t\treturn nil, errors.New(\"no connections found\")\n\t\t}\n\n\t\tterm.networks = networks\n\t}\n\n\tfor _, network := range term.networks {\n\t\tif network.Type == connectionType {\n\t\t\treturn network, nil\n\t\t}\n\t}\n\n\tlog.Error(fmt.Errorf(\"network type '%s' not found\", connectionType))\n\treturn nil, &NotImplemented{}\n}\n","sourceCodeStart":213,"sourceCodeEnd":246,"githubUrl":"https://github.com/JanDeDobbeleer/oh-my-posh/blob/0976794618c5ed95de0985dded50de1b4dc914cb/src/runtime/terminal_windows.go#L213-L246","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// PowerShell: ensure an active adapter exists before enabling the network segment\nif ((Get-NetAdapter | Where-Object Status -eq 'Up').Count -gt 0) { \"network available\" }","typeGuard":null,"tryCatchPattern":"// caller (prompt engine) treats the error as 'segment disabled'\nconn, err := term.Connection(wifi)\nif err != nil {\n    // skip rendering the network segment\n    return\n}","preventionTips":["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"],"tags":["windows","network","segment"],"backgroundTag":"no-network-connection","analyzedSha":"0976794618c5ed95de0985dded50de1b4dc914cb","analyzedAt":"2026-08-31T23:41:19.708Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}