mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-11-13 14:34:06 -08:00
f47da9592f
BREAKING CHANGE: exit segment is now called status segment. The exit keyword is now deprecated and will be removed in a future release. Please use the status keyword instead: ```diff "segments": { { - "type": "exit" + "type": "status" } } ``` Additionally, the status segment configuration has changed to support $PIPESTATUS. You can include a status template to customize the rendering of each individual status code (supported in fish, zsh and bash). ```json "segments": { { "type": "status", "properties": { "status_template": "{{ if gt .Code 0 }}\uf071{{ else }}\uf00c{{ end }}", "status_separator": " " } } } ``` In case no $PIPESTATUS is available, the status segment will fall back to the exit code of the last command using the status template for rendering. The `{{ .Meaning }}` property has been marked as deprecated and can be replaced with `{{ reason .Code }}`, allowing it to be reused in cross segment templates. resolves #4070
118 lines
3.4 KiB
JSON
118 lines
3.4 KiB
JSON
{
|
|
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
|
|
"blocks": [
|
|
{
|
|
"alignment": "left",
|
|
"segments": [
|
|
{
|
|
"foreground": "#26C6DA",
|
|
"style": "plain",
|
|
"template": "{{ if .WSL }}WSL at {{ end }}{{.Icon}} ",
|
|
"type": "os"
|
|
},
|
|
{
|
|
"foreground": "#26C6DA",
|
|
"style": "diamond",
|
|
"template": "{{ .UserName }}@{{ .HostName }} ",
|
|
"type": "session"
|
|
},
|
|
{
|
|
"foreground": "#0fc469",
|
|
"style": "powerline",
|
|
"template": "\u279c \ue235({{ if .Error }}{{ .Error }}{{ else }}{{ if .Venv }}{{ .Venv }} {{ end }}{{ .Major }}.{{ .Minor }}{{ end }}) ",
|
|
"type": "python"
|
|
},
|
|
{
|
|
"foreground": "#FFE700",
|
|
"foreground_templates": [
|
|
"{{ if and (gt .Ahead 0) (gt .Behind 0) }}#FFCC80{{ end }}",
|
|
"{{ if gt .Ahead 0 }}#16c60c{{ end }}",
|
|
"{{ if gt .Behind 0 }}#f450de{{ end }}"
|
|
],
|
|
"properties": {
|
|
"fetch_status": true,
|
|
"fetch_upstream_icon": true
|
|
},
|
|
"style": "plain",
|
|
"template": "{{ .UpstreamIcon }}{{ .HEAD }}{{if .BranchStatus }} {{ .BranchStatus }}{{ end }}{{ if .Working.Changed }} \uf044 {{ .Working.String }}{{ end }}{{ if and (.Working.Changed) (.Staging.Changed) }} |{{ end }}{{ if .Staging.Changed }} \uf046 {{ .Staging.String }}{{ end }}{{ if gt .StashCount 0 }} \ueb4b {{ .StashCount }}{{ end }} ",
|
|
"type": "git"
|
|
}
|
|
],
|
|
"type": "prompt"
|
|
},
|
|
{
|
|
"alignment": "right",
|
|
"segments": [
|
|
{
|
|
"background": "#6CA35E",
|
|
"foreground": "#ffffff",
|
|
"leading_diamond": "\ue0b6",
|
|
"style": "diamond",
|
|
"template": "\ue718 {{ .Full }} ",
|
|
"trailing_diamond": "\ue0b4",
|
|
"type": "node"
|
|
},
|
|
{
|
|
"background": "#4c1f5e",
|
|
"foreground": "#ffffff",
|
|
"leading_diamond": " \ue0b6",
|
|
"style": "diamond",
|
|
"template": "\ue738 {{ .Full }} ",
|
|
"trailing_diamond": "\ue0b4",
|
|
"type": "java"
|
|
},
|
|
{
|
|
"properties": {
|
|
"always_enabled": true
|
|
},
|
|
"style": "plain",
|
|
"template": " {{ if gt .Code 0 }}<#ff0000>\uf00d</>{{ else }}<#23d18b>\uf42e</>{{ end }} ",
|
|
"type": "status"
|
|
},
|
|
{
|
|
"foreground": "#bab02a",
|
|
"properties": {
|
|
"threshold": 10
|
|
},
|
|
"style": "plain",
|
|
"template": "took \uf252 {{ .FormattedMs }} ",
|
|
"type": "executiontime"
|
|
},
|
|
{
|
|
"foreground": "#00C5C7",
|
|
"properties": {
|
|
"time_format": "15:04:05"
|
|
},
|
|
"style": "plain",
|
|
"template": " {{ .CurrentDate | date .Format }} \uf017 ",
|
|
"type": "time"
|
|
}
|
|
],
|
|
"type": "prompt"
|
|
},
|
|
{
|
|
"alignment": "left",
|
|
"newline": true,
|
|
"segments": [
|
|
{
|
|
"foreground": "#77E4F7",
|
|
"properties": {
|
|
"style": "full"
|
|
},
|
|
"style": "plain",
|
|
"template": "{{ .Path }} ",
|
|
"type": "path"
|
|
},
|
|
{
|
|
"foreground": "#43D426",
|
|
"style": "plain",
|
|
"template": "\u276f ",
|
|
"type": "text"
|
|
}
|
|
],
|
|
"type": "prompt"
|
|
}
|
|
],
|
|
"version": 2
|
|
}
|