Error "can't evaluate field SHLVL in type template.Data" #4930
Unanswered
pfmoore
asked this question in
Troubleshoot
Replies: 1 comment 2 replies
-
To access environment variables, you do need to use |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm trying to add the shell level into my prompt. But when I do, I'm getting the above error.
As far as I can see, I need an environment variable
SHLVL
in order for this to work, and my shell (powershell) doesn't set that by default. But I would have expected that if I set$env:SHLVL=1
for instance, I'd get a 1 displayed, rather than an error. But it doesn't seem to do that, even if I rerun my profile. None of the example themes useSHLVL
, so I can't be sure if I'm using it correctly. But all I'm doing is"template": "PS {{ .SHLVL }}"
for testing, so it doesn't seem like it's that complicated.I tried omp debug prompt and it shows
It's not that important, as I can always use
.Env.SHLVL
, it just seems weird that it's not working. Am I doing something dumb here?Beta Was this translation helpful? Give feedback.
All reactions