oh-my-posh/website/docs/configuration/debug-prompt.mdx

64 lines
3.5 KiB
Plaintext
Raw Normal View History

2022-03-27 01:05:46 -07:00
---
2022-04-20 09:43:59 -07:00
id: debug-prompt
2022-03-27 01:05:46 -07:00
title: Debug prompt
sidebar_label: Debug prompt
---
:::info
This feature only works in `powershell` for the time being.
:::
The debug prompt is displayed when you debug a script from the command line or Visual Studio Code.
The default is `[DBG]: `.
You can use go [text/template][go-text-template] [templates][templates] extended with [sprig][sprig] to enrich the text.
2022-03-27 01:05:46 -07:00
Environment variables are available, just like the [`console_title_template`][console-title] functionality.
## Configuration
You need to extend or create a custom theme with your debug prompt override. For example:
```json
{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
2022-04-23 23:45:11 -07:00
"blocks": [
2022-03-27 01:05:46 -07:00
...
2022-04-23 23:45:11 -07:00
],
2022-03-27 01:05:46 -07:00
"debug_prompt": {
"background": "transparent",
"foreground": "#ffffff",
"template": "Debugging "
}
}
```
## Properties
2022-03-27 01:05:46 -07:00
| Name | Type | Description |
| ---------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| `foreground` | `string` | [color][colors] |
| `foreground_templates` | `string` | [color templates][color-templates] |
| `background` | `string` | [color][colors] |
| `background_templates` | `string` | [color templates][color-templates] |
| `template` | `string` | a go [text/template][go-text-template] template extended with [sprig][sprig] utilizing the properties below - defaults to `[DBG]: ` |
2022-03-27 01:05:46 -07:00
## Template ([info][templates])
| Name | Type | Description |
| -------------- | --------- | ------------------------------------------------------------------------- |
| `.Root` | `boolean` | is the current user root/admin or not |
| `.PWD` | `string` | the current working directory |
| `.Folder` | `string` | the current working folder |
| `.Shell` | `string` | the current shell name |
| `.UserName` | `string` | the current user name |
| `.HostName` | `string` | the host name |
| `.Code` | `int` | the last exit code |
| `.Env.VarName` | `string` | Any environment variable where `VarName` is the environment variable name |
2022-03-27 01:05:46 -07:00
[go-text-template]: https://golang.org/pkg/text/template/
[sprig]: https://masterminds.github.io/sprig/
2022-04-20 09:43:59 -07:00
[console-title]: /docs/configuration/title#console-title-template
[templates]: /docs/configuration/templates
[colors]: /docs/configuration/colors
[color-templates]: /docs/configuration/colors#color-templates