调试提示符
非官方测试版翻译
本页面由 PageTurner AI 翻译(测试版)。未经项目官方认可。 发现错误? 报告问题 →
信息
目前此功能仅适用于 powershell。
调试提示符会在命令行或 Visual Studio Code 中调试脚本时显示,默认值为 [DBG]: 。
你可以使用 go text/template 模板(通过 sprig 扩展)来定制文本,环境变量同样可用,就像 console_title_template 功能那样。
配置
你需要扩展或创建自定义主题来覆盖调试提示符设置,例如:
- json
- yaml
- toml
{
"debug_prompt": {
"background": "transparent",
"foreground": "#ffffff",
"template": "Debugging "
}
}
debug_prompt:
background: transparent
foreground: "#ffffff"
template: "Debugging "
[debug_prompt]
background = "transparent"
foreground = "#ffffff"
template = "Debugging "
选项
| Name | Type | Description |
|---|---|---|
foreground | string | color |
foreground_templates | string | color templates |
background | string | color |
background_templates | string | color templates |
template | string | a go text/template template extended with sprig utilizing the properties below - defaults to [DBG]: |
模板 (信息)
| 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 |