diff --git a/docs/docs/config-debug-prompt.md b/docs/docs/config-debug-prompt.md new file mode 100644 index 00000000..16efb042 --- /dev/null +++ b/docs/docs/config-debug-prompt.md @@ -0,0 +1,59 @@ +--- +id: config-debug-prompt +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 extended with [sprig][sprig] to enrich the text. +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", + "blocks": { + ... + }, + "debug_prompt": { + "background": "transparent", + "foreground": "#ffffff", + "template": "Debugging " + } +} +``` + +The configuration has the following properties: + +- foreground: `string` [color][colors] +- foreground_templates: foreground [color templates][color-templates] +- background: `string` [color][colors] +- background_templates: background [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]: ` + +## Template ([info][templates]) + +- `.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 +- `.Env.VarName`: `string` - Any environment variable where `VarName` is the environment variable name + +[go-text-template]: https://golang.org/pkg/text/template/ +[sprig]: https://masterminds.github.io/sprig/ +[console-title]: /docs/config-title#console-title-template +[templates]: /docs/config-templates +[colors]: /docs/config-colors +[color-templates]: /docs/config-colors#color-templates diff --git a/docs/docs/config-secondary-prompt.md b/docs/docs/config-secondary-prompt.md index e4a233c4..196f3cf8 100644 --- a/docs/docs/config-secondary-prompt.md +++ b/docs/docs/config-secondary-prompt.md @@ -36,7 +36,7 @@ The configuration has the following properties: - background: `string` [color][colors] - foreground: `string` [color][colors] - template: `string` - A go [text/template][go-text-template] template extended with [sprig][sprig] utilizing the -properties below - defaults to ` ` +properties below - defaults to `> ` ## Template ([info][templates]) @@ -52,3 +52,4 @@ properties below - defaults to ` ` [sprig]: https://masterminds.github.io/sprig/ [console-title]: /docs/config-title#console-title-template [templates]: /docs/config-templates +[colors]: /docs/config-colors diff --git a/docs/sidebars.js b/docs/sidebars.js index bb0d74ca..ff29a134 100644 --- a/docs/sidebars.js +++ b/docs/sidebars.js @@ -40,6 +40,7 @@ module.exports = { "config-colors", "config-templates", "config-secondary-prompt", + "config-debug-prompt", "config-transient", "config-line-error", "config-tooltips",