Invite de débogage
Traduction Bêta Non Officielle
Cette page a été traduite par PageTurner AI (bêta). Non approuvée officiellement par le projet. Vous avez trouvé une erreur ? Signaler un problème →
info
Cette fonctionnalité ne fonctionne actuellement que dans powershell.
L'invite de débogage s'affiche lorsque vous déboguez un script depuis la ligne de commande ou Visual Studio Code.
Par défaut, elle est définie sur [DBG]: .
Vous pouvez utiliser les modèles Go templates étendus avec sprig pour enrichir le texte.
Les variables d'environnement sont accessibles, comme pour la fonctionnalité console_title_template.
Configuration
Vous devez étendre ou créer un thème personnalisé avec votre remplacement d'invite de débogage. Par exemple :
- 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 "
Options
| 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]: |
Modèle (info)
| 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 |