跳转到主内容

调试提示符

非官方测试版翻译

本页面由 PageTurner AI 翻译(测试版)。未经项目官方认可。 发现错误? 报告问题 →

信息

目前此功能仅适用于 powershell

调试提示符会在命令行或 Visual Studio Code 中调试脚本时显示,默认值为 [DBG]:

你可以使用 go text/template 模板(通过 sprig 扩展)来定制文本,环境变量同样可用,就像 console_title_template 功能那样。

配置

你需要扩展或创建自定义主题来覆盖调试提示符设置,例如:

{
"debug_prompt": {
"background": "transparent",
"foreground": "#ffffff",
"template": "Debugging "
}
}

选项

NameTypeDescription
foregroundstringcolor
foreground_templatesstringcolor templates
backgroundstringcolor
background_templatesstringcolor templates
templatestringa go text/template template extended with sprig utilizing the properties below - defaults to [DBG]:

模板 (信息)

NameTypeDescription
.Rootbooleanis the current user root/admin or not
.PWDstringthe current working directory
.Folderstringthe current working folder
.Shellstringthe current shell name
.UserNamestringthe current user name
.HostNamestringthe host name
.Codeintthe last exit code
.Env.VarNamestringAny environment variable where VarName is the environment variable name