JanDeDobbeleer/oh-my-posh · error

err parsing info from %s with %s

Error message

err parsing info from %s with %s

What it means

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.

Source

Thrown at src/segments/language.go:406

	cacheKey := fmt.Sprintf("version_%s", l.name)

	if versionCache, OK := cache.Device.Get[Version](cacheKey); OK {
		l.Version = versionCache
		return nil
	}

	for _, command := range l.commands {
		versionStr, err := l.runCommand(command)
		if err != nil {
			log.Error(err)
			lastError = err
			continue
		}

		version, err := command.parse(versionStr)
		if err != nil {
			log.Error(err)
			lastError = fmt.Errorf("err parsing info from %s with %s", command.executable, versionStr)
			continue
		}

		l.Version = *version
		if command.versionURLTemplate != "" {
			l.versionURLTemplate = command.versionURLTemplate
		}

		l.buildVersionURL()
		l.Executable = command.executable

		duration := l.options.String(options.CacheDuration, string(cache.NONE))
		cache.Device.Set(cacheKey, l.Version, cache.Duration(duration))

		return nil
	}

	if lastError != nil {

View on GitHub (pinned to 0976794618)

Solutions

  1. Run the version command the segment uses (e.g. `node --version`, `python --version`) and check the raw output for extra or non-standard text
  2. Check for shell wrappers/shims or env vars (locale, PYENV shell) injecting extra output and fix or bypass them
  3. Reinstall or repair the language tool so it emits a standard version string
  4. 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

Example fix

// before (segment config pointing at a custom wrapper)
"commands": [{ "executable": "python", "args": ["--version"] }]
// after (bypass the pyenv shim warning that broke parsing)
"commands": [{ "executable": "/usr/bin/python3", "args": ["--version"] }]
Defensive patterns

Strategy: validation

Validate before calling

// run the command yourself and check the output parses
out, err := exec.Command("python", "--version").CombinedOutput()
if err != nil || !regexp.MustCompile(`\d+\.\d+`).Match(out) {
    log.Printf("version output not parseable: %q", out)
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


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