-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Default value of "home_enabled" of python segment #3674
Replies: 2 comments · 10 replies
|
@xsjk can you show me the output of |
All reactions
|
All reactions
|
@xsjk can you upgrade to the latest? I noticed it lacks some info in debug to correctly assess everything. Added some more logging. |
All reactions
|
All reactions
|
@xsjk it's not enabled: Can you show the contents of the config? |
All reactions
{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"blocks": [
{
"alignment": "left",
"segments": [
{
"foreground": "lightBlue",
"foreground_templates": [
"{{ if .Root }}lightRed{{ end }}"
],
"properties": {
"display_host": true
},
"style": "plain",
"template": "<{{ if .Root }}lightBlue{{ else }}green{{ end }}>\u250c\u2500\u2500(</><b>{{ .UserName }}</b>{{ if .Root }}💀{{ else }}㉿{{ end }}<b>{{ .HostName }}</b><{{ if .Root }}lightBlue{{ else }}green{{ end }}>)</>",
"type": "session"
},
{
"foreground": "yellow",
"properties": {
"fetch_version": false,
"fetch_virtual_env": true
},
"style": "plain",
"template": "<{{ if .Root }}lightBlue{{ else }}green{{ end }}>-[</><b>\ue235 {{ if .Error }}{{ .Error }}{{ else }}{{ if .Venv }}{{ .Venv }}{{ end }}{{ .Full }}{{ end }}</b><{{ if .Root }}lightBlue{{ else }}green{{ end }}>]</>",
"type": "python"
},
{
"foreground": "lightWhite",
"properties": {
"folder_separator_icon": "/",
"style": "full"
},
"style": "plain",
"template": "<{{ if .Root }}lightBlue{{ else }}green{{ end }}>-[</><b>{{ .Path }}</b><{{ if .Root }}lightBlue{{ else }}green{{ end }}>]</>",
"type": "path"
},
{
"foreground": "white",
"style": "plain",
"template": "<{{ if .Root }}lightBlue{{ else }}green{{ end }}>-[</>{{ .HEAD }}<{{ if .Root }}lightBlue{{ else }}green{{ end }}>]</>",
"type": "git"
}
],
"type": "prompt"
},
{
"alignment": "right",
"segments": [
{
"foreground": "white",
"properties": {
"always_enabled": true,
"style": "round"
},
"style": "plain",
"template": " {{ .FormattedMs }} ",
"type": "executiontime"
},
{
"foreground": "green",
"foreground_templates": [
"{{ if gt .Code 0 }}red{{ end }}"
],
"properties": {
"always_enabled": true
},
"style": "plain",
"template": " {{ if gt .Code 0 }}\u2a2f{{else}}\u2713{{ end }} ",
"type": "exit"
}
],
"type": "prompt"
},
{
"alignment": "left",
"newline": true,
"segments": [
{
"foreground": "lightBlue",
"style": "plain",
"template": "<{{ if .Root }}lightBlue{{ else }}green{{ end }}>\u2514\u2500</>{{ if .Root }}<lightRed>#</>{{ else }}${{ end }} ",
"type": "text"
}
],
"type": "prompt"
}
],
"version": 2
} |
All reactions
|
@xsjk I'm confused. Python is disabled with |
All reactions
|
It's really strange. The same config behaves differently on windows and ubuntu. |
All reactions
|
It's can't be the same config, you said it displays on Linux regardless of it being set or not, which clearly shows false here. So either I'm missing something, or it behaves according to spec. |
All reactions
|
The python segement will not appear only if I manually set {
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"blocks": [
{
"alignment": "left",
"segments": [
{
"foreground": "lightBlue",
"foreground_templates": [
"{{ if .Root }}lightRed{{ end }}"
],
"properties": {
"display_host": true
},
"style": "plain",
"template": "<{{ if .Root }}lightBlue{{ else }}green{{ end }}>\u250c\u2500\u2500(</><b>{{ .UserName }}</b>{{ if .Root }}💀{{ else }}㉿{{ end }}<b>{{ .HostName }}</b><{{ if .Root }}lightBlue{{ else }}green{{ end }}>)</>",
"type": "session"
},
{
"foreground": "yellow",
"properties": {
"home_enabled": false,
"fetch_version": false,
"fetch_virtual_env": true
},
"style": "plain",
"template": "<{{ if .Root }}lightBlue{{ else }}green{{ end }}>-[</><b>\ue235 {{ if .Error }}{{ .Error }}{{ else }}{{ if .Venv }}{{ .Venv }}{{ end }}{{ .Full }}{{ end }}</b><{{ if .Root }}lightBlue{{ else }}green{{ end }}>]</>",
"type": "python"
},
{
"foreground": "lightWhite",
"properties": {
"folder_separator_icon": "/",
"style": "full"
},
"style": "plain",
"template": "<{{ if .Root }}lightBlue{{ else }}green{{ end }}>-[</><b>{{ .Path }}</b><{{ if .Root }}lightBlue{{ else }}green{{ end }}>]</>",
"type": "path"
},
{
"foreground": "white",
"style": "plain",
"template": "<{{ if .Root }}lightBlue{{ else }}green{{ end }}>-[</>{{ .HEAD }}<{{ if .Root }}lightBlue{{ else }}green{{ end }}>]</>",
"type": "git"
}
],
"type": "prompt"
},
{
"alignment": "right",
"segments": [
{
"foreground": "white",
"properties": {
"always_enabled": true,
"style": "round"
},
"style": "plain",
"template": " {{ .FormattedMs }} ",
"type": "executiontime"
},
{
"foreground": "green",
"foreground_templates": [
"{{ if gt .Code 0 }}red{{ end }}"
],
"properties": {
"always_enabled": true
},
"style": "plain",
"template": " {{ if gt .Code 0 }}\u2a2f{{else}}\u2713{{ end }} ",
"type": "exit"
}
],
"type": "prompt"
},
{
"alignment": "left",
"newline": true,
"segments": [
{
"foreground": "lightBlue",
"style": "plain",
"template": "<{{ if .Root }}lightBlue{{ else }}green{{ end }}>\u2514\u2500</>{{ if .Root }}<lightRed>#</>{{ else }}${{ end }} ",
"type": "text"
}
],
"type": "prompt"
}
],
"version": 2
}And here's the debug info on ubuntu after manually set. |
All reactions
|
@xsjk OK, but |


Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
{ "foreground": "yellow", "properties": { // "home_enabled": true, "fetch_version": false, "fetch_virtual_env": true }, "style": "plain", "template": "...", "type": "python" },It's strange that on Windows, when
"home_enabled":trueis not set, python segment will not show in~.However, on Linux when
"home_enabled":trueis not set, python segment still shows in~.Are the default values of "home_enabled" different on different platforms?
Is there a way to config the default value of "home_enabled"?
I'm using the latest version 🏷️ v14.25.1. I notice that there was a bug fix about


python: set home_enabled to false by defaultat the old release 🏷️ v12.33.1. And it did take effect to my windowsBut it makes no difference on my ubuntu
I don't know if the bug hasn't been completely repaired. And I'm confused as the document claims that
home_enabledbooleanfalseAll reactions