mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-11-10 04:54:03 -08:00
3057e474d7
this look a lot better
54 lines
1.4 KiB
Plaintext
54 lines
1.4 KiB
Plaintext
---
|
|
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",
|
|
"background_templates": ["{{ if gt .Code 0 }}#e91e63{{ end }}"],
|
|
"trailing_diamond": "\uE0B4",
|
|
"template": "<#193549>\uE0B0</> \uE23A ",
|
|
"properties": {
|
|
"always_enabled": true
|
|
}
|
|
}
|
|
```
|
|
|
|
## Properties
|
|
|
|
| Name | Type | Description |
|
|
| ---------------- | --------- | -------------------------------------------- |
|
|
| `always_enabled` | `boolean` | always show the status - defaults to `false` |
|
|
|
|
[colors]: /docs/configuration/colors
|
|
|
|
## Template ([info][templates])
|
|
|
|
:::note default template
|
|
|
|
```template
|
|
{{ if gt .Code 0 }}\uf00d {{ .Meaning }}{{ else }}\uf42e{{ end }}
|
|
```
|
|
|
|
:::
|
|
|
|
### Properties
|
|
|
|
| Name | Type | Description |
|
|
| ---------- | -------- | --------------------------------------------------------------------------------------- |
|
|
| `.Code` | `number` | the last known exit code |
|
|
| `.Meaning` | `string` | the textual meaning linked to exit code (if applicable, otherwise identical to `.Code`) |
|
|
|
|
[templates]: /docs/configuration/templates
|