mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-11-10 04:54:03 -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
125 lines
3.9 KiB
JSON
125 lines
3.9 KiB
JSON
{
|
|
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
|
|
"blocks": [
|
|
{
|
|
"alignment": "left",
|
|
"segments": [
|
|
{
|
|
"background": "#000000",
|
|
"foreground": "#dd1e1e",
|
|
"style": "plain",
|
|
"template": " \u26a1 ",
|
|
"type": "root"
|
|
},
|
|
{
|
|
"background": "transparent",
|
|
"foreground": "#ffffff",
|
|
"style": "plain",
|
|
"template": "{{ if .WSL }}WSL at {{ end }}{{.Icon}} ",
|
|
"type": "os"
|
|
},
|
|
{
|
|
"background": "#5a3d29",
|
|
"foreground": "#43CCEA",
|
|
"properties": {
|
|
"folder_icon": "...",
|
|
"folder_separator_icon": "<transparent> \ue0bd </>",
|
|
"home_icon": "\ueb06",
|
|
"style": "agnoster_short"
|
|
},
|
|
"style": "plain",
|
|
"template": " {{ .Path }} ",
|
|
"type": "path"
|
|
},
|
|
{
|
|
"background": "#00C853",
|
|
"background_templates": [
|
|
"{{ if or (.Working.Changed) (.Staging.Changed) }}#FFEB3B{{ end }}",
|
|
"{{ if and (gt .Ahead 0) (gt .Behind 0) }}#FFCC80{{ end }}",
|
|
"{{ if gt .Ahead 0 }}#B388FF{{ end }}",
|
|
"{{ if gt .Behind 0 }}#B388FF{{ end }}"
|
|
],
|
|
"foreground": "#000000",
|
|
"leading_diamond": "<parentBackground,background>\ue0b0</>",
|
|
"properties": {
|
|
"fetch_stash_count": true,
|
|
"fetch_status": true
|
|
},
|
|
"style": "diamond",
|
|
"template": " {{ .HEAD }}{{ if .Staging.Changed }}<#FF6F00> \uf046 {{ .Staging.String }}</>{{ end }}{{ if and (.Working.Changed) (.Staging.Changed) }} |{{ end }}{{ if .Working.Changed }} \uf044 {{ .Working.String }}{{ end }}{{ if gt .StashCount 0 }} \ueb4b {{ .StashCount }}{{ end }} ",
|
|
"type": "git"
|
|
},
|
|
{
|
|
"background": "#2ba1bb",
|
|
"foreground": "#5a3d29",
|
|
"leading_diamond": "<parentBackground,background>\ue0b0</>",
|
|
"properties": {
|
|
"style": "dallas",
|
|
"threshold": 0
|
|
},
|
|
"style": "diamond",
|
|
"template": " {{ .FormattedMs }}s ",
|
|
"type": "executiontime"
|
|
},
|
|
{
|
|
"background": "#910000",
|
|
"foreground": "#ffffff",
|
|
"powerline_symbol": "\ue0b0",
|
|
"properties": {
|
|
"always_enabled": true
|
|
},
|
|
"style": "plain",
|
|
"template": "{{ if gt .Code 0 }}<parentBackground,background>\ue0b0</><transparent> \uf12a</> {{ reason .Code }} <background,transparent>\ue0b0</>{{ else }}<parentBackground,transparent>\ue0b0</>{{ end }}",
|
|
"type": "status"
|
|
}
|
|
],
|
|
"type": "prompt"
|
|
},
|
|
{
|
|
"alignment": "right",
|
|
"segments": [
|
|
{
|
|
"background": "#5a3d29",
|
|
"foreground": "#43CCEA",
|
|
"leading_diamond": "\ue0c5",
|
|
"style": "diamond",
|
|
"template": " {{ if .SSHSession }}\ueba9 {{ end }}{{ .UserName }}<transparent> / </>{{ .HostName }}",
|
|
"type": "session"
|
|
},
|
|
{
|
|
"background": "#5a3d29",
|
|
"foreground": "#43CCEA",
|
|
"properties": {
|
|
"time_format": "3:04:05 PM"
|
|
},
|
|
"style": "plain",
|
|
"template": "<transparent> \ue0ba\ue0bc </>{{ .CurrentDate | date .Format }} ",
|
|
"type": "time"
|
|
}
|
|
],
|
|
"type": "prompt"
|
|
},
|
|
{
|
|
"alignment": "left",
|
|
"newline": true,
|
|
"segments": [
|
|
{
|
|
"foreground": "#ffffff",
|
|
"foreground_templates": [
|
|
"{{ if gt .Code 0 }}#ff0000{{ end }}"
|
|
],
|
|
"properties": {
|
|
"always_enabled": true
|
|
},
|
|
"style": "plain",
|
|
"template": "\u276f ",
|
|
"type": "status"
|
|
}
|
|
],
|
|
"type": "prompt"
|
|
}
|
|
],
|
|
"console_title_template": "{{if .Root}} \u26a1 {{end}}{{.Folder | replace \"~\" \"🏚\" }} @ {{.HostName}}",
|
|
"version": 2
|
|
}
|