{"record":{"id":"1879eca8bcb65497","repo":"JanDeDobbeleer/oh-my-posh","slug":"err-parsing-info-from-s-with-s","errorCode":null,"errorMessage":"err parsing info from %s with %s","messagePattern":"err parsing info from (.+?) with (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/segments/language.go","lineNumber":406,"sourceCode":"\tcacheKey := fmt.Sprintf(\"version_%s\", l.name)\n\n\tif versionCache, OK := cache.Device.Get[Version](cacheKey); OK {\n\t\tl.Version = versionCache\n\t\treturn nil\n\t}\n\n\tfor _, command := range l.commands {\n\t\tversionStr, err := l.runCommand(command)\n\t\tif err != nil {\n\t\t\tlog.Error(err)\n\t\t\tlastError = err\n\t\t\tcontinue\n\t\t}\n\n\t\tversion, err := command.parse(versionStr)\n\t\tif err != nil {\n\t\t\tlog.Error(err)\n\t\t\tlastError = fmt.Errorf(\"err parsing info from %s with %s\", command.executable, versionStr)\n\t\t\tcontinue\n\t\t}\n\n\t\tl.Version = *version\n\t\tif command.versionURLTemplate != \"\" {\n\t\t\tl.versionURLTemplate = command.versionURLTemplate\n\t\t}\n\n\t\tl.buildVersionURL()\n\t\tl.Executable = command.executable\n\n\t\tduration := l.options.String(options.CacheDuration, string(cache.NONE))\n\t\tcache.Device.Set(cacheKey, l.Version, cache.Duration(duration))\n\n\t\treturn nil\n\t}\n\n\tif lastError != nil {","sourceCodeStart":388,"sourceCodeEnd":424,"githubUrl":"https://github.com/JanDeDobbeleer/oh-my-posh/blob/0976794618c5ed95de0985dded50de1b4dc914cb/src/segments/language.go#L388-L424","documentation":"The language segment ran a version command (e.g. `go version`), got output back, but the segment's parse function failed to extract a version from that output. oh-my-posh wraps this into a generic 'err parsing info from <executable> with <raw output>' error and tries the next configured command before failing the segment.","triggerScenarios":"A language tool is installed but its `--version` output format changed or is non-standard, a wrapper (e.g. shim, version manager like nvm/pyenv stub) prints extra lines or a warning before the version, or a locale/env var changes the output so the regex in command.parse no longer matches.","commonSituations":"Version managers (asdf, pyenv, nvm) emitting shim warnings; tools printing deprecation notices to stdout; a custom `display_mode: text` command whose output the built-in parser cannot handle; broken tool installs printing usage/error text instead of a version.","solutions":["Run the version command the segment uses (e.g. `node --version`, `python --version`) and check the raw output for extra or non-standard text","Check for shell wrappers/shims or env vars (locale, PYENV shell) injecting extra output and fix or bypass them","Reinstall or repair the language tool so it emits a standard version string","Set the segment's `missing_command_text`/custom command with `version_format` adjusted, or point the segment at a different executable via the command config"],"exampleFix":"// before (segment config pointing at a custom wrapper)\n\"commands\": [{ \"executable\": \"python\", \"args\": [\"--version\"] }]\n// after (bypass the pyenv shim warning that broke parsing)\n\"commands\": [{ \"executable\": \"/usr/bin/python3\", \"args\": [\"--version\"] }]","handlingStrategy":"validation","validationCode":"// run the command yourself and check the output parses\nout, err := exec.Command(\"python\", \"--version\").CombinedOutput()\nif err != nil || !regexp.MustCompile(`\\d+\\.\\d+`).Match(out) {\n    log.Printf(\"version output not parseable: %q\", out)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Test each language tool's --version output after upgrades","Bypass version-manager shims in prompt configs where extra output appears","Pin locale-independent env vars for version commands","Keep oh-my-posh updated for new tool output formats"],"tags":["go","parsing","language-segment","version-parsing"],"backgroundTag":"version-output-parse-failure","analyzedSha":"0976794618c5ed95de0985dded50de1b4dc914cb","analyzedAt":"2026-08-31T23:41:19.708Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}