I was setting up existing repo with .terraform-version file of the project that I've just pulled and there is a issue that I was facing:
data-infra $ terraform -v
/opt/homebrew/Cellar/tfenv/3.0.0/lib/tfenv-version-name.sh: line 75: requested: unbound variable
The root cause of the issue is that the .terraform-version had the following content (WITH new line in the end of the file):
The issue fix probably should be located here: https://github.com/tfutils/tfenv/blob/v3.0.0/libexec/tfenv-resolve-version#L132