Unable to display "full" path in prompt #3922
Answered
by
JanDeDobbeleer
mkanet
asked this question in
Troubleshoot
|
How do I display the full path in my prompt below? Full code: {
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"blocks": [
{
"alignment": "left",
"newline": true,
"segments": [
{
"background": "#1a1a1a",
"foreground": "#c00010",
"powerline_symbol": "\ue0b4",
"leading_diamond": "\ue0b6",
"style": "diamond",
"template": " PS: ",
"type": "text"
},
{
"type": "root",
"style": "diamond",
// "leading_diamond": "\ue0b6",
"background": "#181818",
"foreground": "#ecb606",
"template": "\uF0E7"
},
{
"background": "#002F9E",
"background_templates": [
"{{ if eq .Env.ElevatedPINNotAuthorized \"True\" }}#3B4863{{ end }}"
],
"foreground": "#D2D2D2",
"foreground_templates": [
"{{ if eq .Env.ElevatedPINNotAuthorized \"True\" }}lightblue{{ end }}"
],
"powerline_symbol": "\ue0b0",
"style": "powerline",
"template": "{{ if eq .Env.ElevatedPINNotAuthorized \"True\" }} <s>\uD83D\uDD11 {{ .Env.UserName }}</s>{{ else }} \uD83D\uDD11 {{ .Env.UserName }}{{ end }} ",
"type": "session"
},
{
"background": "#0456E5",
"foreground": "#D6D6D6",
"foreground_templates": [
"{{ if not .Writable }}#999999{{ end }}"
],
"powerline_symbol": "\ue0b0",
"properties": {
"style": "full"
},
"style": "powerline",
"template": " {{ $pathList := splitList \";\" .Env.Path }}{{ if has .Location $pathList }}\uD83D\uDD0E{{ else if eq .Env.USERPROFILE .Path}}\uD83C\uDFE0{{ else }}\uD83D\uDCC2{{ end }} {{ path .Path .Location }} ",
"type": "path"
},
{
"background": "#d81324",
"background_templates": [
"{{ if lt .Ms 1200 }}#ec9706{{ end }}",
"{{ if lt .Ms 3000 }}#E87400{{ end }}",
"{{ if lt .Ms 4500 }}#EA5200{{ end }}"
],
"foreground": "#000000",
"leading_diamond": "<transparent,background>\ue0b0</>",
"properties": {
"always_enabled": true,
"style": "austin"
},
"style": "diamond",
"template": " \ufbab\u2800{{ .FormattedMs }} ",
"trailing_diamond": "\ue0b4",
"type": "executiontime"
}
],
"type": "prompt"
}
],
"final_space": true,
"version": 2
}Maybe I didn't do below correctly in the full code above? "properties": {
"style": "full"
}, |
Answered by
JanDeDobbeleer
May 31, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

@mkanet that is the full path,
$HOMEis always replaced with~for.Path. If you want the actual non-replaced path, use.Locationinstead: