{"record":{"id":"a180fc4b537eeb99","repo":"JanDeDobbeleer/oh-my-posh","slug":"no-matching-window-title-found","errorCode":null,"errorMessage":"no matching window title found\n","messagePattern":"no matching window title found\n","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"info","filePath":"src/runtime/win32_windows.go","lineNumber":110,"sourceCode":"\t\ttitle = syscall.UTF16ToString(b)\n\t\tif regex.MatchString(windowTitleRegex, title) {\n\t\t\t// will cause EnumWindows to return 0 (error)\n\t\t\t// but we don't want to enumerate all windows since we got what we want\n\t\t\treturn 0\n\t\t}\n\t\treturn 1 // continue enumeration\n\t})\n\t// Enumerates all top-level windows on the screen\n\t// The error is not checked because if EnumWindows is stopped before enumerating all windows\n\t// it returns 0(error occurred) instead of 1(success)\n\t// In our case, title will equal \"\" or the title of the window anyway\n\terr := enumWindows(cb, 0)\n\tif title == \"\" {\n\t\tvar message string\n\t\tif err != nil {\n\t\t\tmessage = err.Error()\n\t\t}\n\t\treturn \"\", errors.New(\"no matching window title found\\n\" + message)\n\t}\n\treturn title, nil\n}\n\nvar (\n\tadvapi     = syscall.NewLazyDLL(\"advapi32.dll\")\n\tprocGetAce = advapi.NewProc(\"GetAce\")\n)\n\nconst (\n\tACCESS_DENIED_ACE_TYPE = 1\n)\n\ntype accessMask uint32\n\nfunc (m accessMask) canWrite() bool {\n\tallowed := []int{windows.GENERIC_WRITE, windows.WRITE_DAC, windows.WRITE_OWNER}\n\tfor _, v := range allowed {","sourceCodeStart":92,"sourceCodeEnd":128,"githubUrl":"https://github.com/JanDeDobbeleer/oh-my-posh/blob/0976794618c5ed95de0985dded50de1b4dc914cb/src/runtime/win32_windows.go#L92-L128","documentation":"queryWindowTitles enumerates all top-level windows via EnumWindows and matches window titles against a pattern. When no window title matches, the collected title is empty and this error is raised; the wrapped message includes any enumeration error (e.g. from getWindowFileName) for diagnostics.","triggerScenarios":"Calling QueryWindowTitles(pattern) when no currently visible top-level window's title contains the requested text, or when every candidate window failed processing (e.g. process open failures) leaving title empty.","commonSituations":"oh-my-posh checking whether it runs inside a known terminal window and the terminal's window title was customized by the user or a shell integration; running in a session without a visible window (ssh, service); the terminal's title changed due to a newer shell version.","solutions":["Confirm the expected application window actually exists and its title contains the searched text (inspect with Get-Process | Select MainWindowTitle).","Avoid tools/scripts that rewrite the terminal window title ($Host.UI.RawUI.WindowTitle or echo -ne '\\e]0;...') if window-title detection matters.","This is usually harmless: the caller treats unmatched titles as 'not that app' and falls back to default behavior - no action needed unless you rely on window detection."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"// enumerate and fall back to default behavior when nothing matches\ntitle, err := term.QueryWindowTitles(pattern)\nif err != nil {\n    // no matching window: proceed with non-window-specific behavior\n}","preventionTips":["Don't let other tools/scripts rewrite the terminal window title if window detection matters","Use stable terminal applications whose window titles include the expected text","Treat this error as informational - it simply means 'not the expected app'"],"tags":["windows","win32","window-title"],"backgroundTag":"window-not-found","analyzedSha":"0976794618c5ed95de0985dded50de1b4dc914cb","analyzedAt":"2026-08-31T23:41:19.708Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}