oh-my-posh/website/docs/segments/exit.mdx

53 lines
1,017 B
Plaintext
Raw Normal View History

2020-10-05 02:33:12 -07:00
---
id: exit
title: Exit code
sidebar_label: Exit code
---
## What
Displays the last exit code or that the last command failed based on the configuration.
## Sample Configuration
```json
{
"type": "exit",
"style": "diamond",
"foreground": "#ffffff",
"background": "#00897b",
2021-11-14 04:39:00 -08:00
"background_templates": [
"{{ if gt .Code 0 }}#e91e63{{ end }}",
],
2020-10-05 02:33:12 -07:00
"leading_diamond": "",
2020-10-16 08:12:34 -07:00
"trailing_diamond": "\uE0B4",
2022-03-27 01:12:47 -07:00
"template": "<#193549>\uE0B0</> \uE23A ",
2020-10-05 02:33:12 -07:00
"properties": {
2022-03-27 01:12:47 -07:00
"always_enabled": true
2020-10-05 02:33:12 -07:00
}
}
```
## Properties
2020-10-16 11:07:38 -07:00
- always_enabled: `boolean` - always show the status - defaults to `false`
2020-10-05 02:33:12 -07:00
2022-04-20 09:43:59 -07:00
[colors]: /docs/configuration/colors
2021-11-14 04:39:00 -08:00
2022-02-01 03:10:46 -08:00
## Template ([info][templates])
:::note default template
``` template
{{ if gt .Code 0 }}\uf00d {{ .Meaning }}{{ else }}\uf42e{{ end }}
```
:::
### Properties
2021-11-14 04:39:00 -08:00
- `.Code`: `number` - the last known exit code
2022-01-31 04:33:36 -08:00
- `.Meaning`: `string` - the textual meaning linked to exit code (if applicable, otherwise identical to `.Code`)
2022-01-22 10:46:56 -08:00
2022-04-20 09:43:59 -07:00
[templates]: /docs/configuration/templates