JanDeDobbeleer/oh-my-posh · warning
no version found
Error message
no version found
What it means
For language commands that provide a custom getVersion function, runCommand() returns 'no version found' when that function succeeds but returns an empty string. This means the version could not be extracted from the tool even though no explicit error occurred.
Source
Thrown at src/segments/language.go:468
}
// Success only: a failed run (a non-CommandError err, or one the
// caller above already turned into an early return) never gets
// cached, so a transient failure cannot pin a bad result for a week.
if err == nil && cacheable {
cache.Device.Set(cacheKey, versionStr, cache.ONEWEEK)
}
return versionStr, nil
}
versionStr, err := command.getVersion()
if err != nil {
return "", err
}
if versionStr == "" {
return "", errors.New("no version found")
}
return versionStr, nil
}
// versionCacheKey reports the device-cache key for command's raw output, and
// whether command is eligible for that cache at all. Eligibility requires:
// opting in via versionCacheable, an environment that can resolve a real
// executable identity (DataOnly cannot), and a resolvable, statable
// executable path.
//
// The key mixes the resolved absolute path with the executable's mtime and
// size, the exact arguments, and any extra environment the command runs
// with, so a PATH change, a reinstalled or upgraded binary, different args,
// or different envs all produce a different key and therefore a cache miss -
// invalidation follows from what the output depends on, not from a guessed
// TTL. The TTL passed to cache.Set (see runCommand) exists only so a device
// cache nobody prunes doesn't grow forever; it plays no part in correctness.View on GitHub (pinned to 0976794618)
Solutions
- Run the segment's version command manually and confirm it prints a version string to stdout.
- Reinstall or repair the language tool if it prints nothing.
- Adjust the segment's display command/args so the version is printed on stdout.
- Check for shell profiles or wrappers that suppress command output.
Defensive patterns
Strategy: try-catch
Validate before calling
out=$(<tool> --version 2>/dev/null); [ -n "$out" ] || echo 'tool prints no version on stdout'
Try / catch
versionStr, err := command.getVersion()
if err != nil || versionStr == "" {
// skip this command / hide segment
} Prevention
- Confirm the tool prints its version to stdout, not stderr.
- Reinstall tools that print nothing for --version.
- Test custom display commands with `oh-my-posh debug`.
When it happens
Trigger: A custom getVersion implementation (used by specific language segments that need bespoke output handling) returns empty output with nil error — e.g. the underlying command produced nothing on stdout or a custom display command yields no version text.
Common situations: Tool installed but emits its version on stderr or nothing at all; custom display_mode commands in the theme return empty output; a broken tool installation silently printing nothing.
Related errors
- cannot parse version string
- err parsing info from %s with %s
- cf command output is empty
- NO VERSION
- err executing %s with %v
AI-assisted analysis of JanDeDobbeleer/oh-my-posh@0976794618 (2026-08-31).
Data as JSON: /api/errors/e86d09b392a893cb.
Report an issue: GitHub.