Aller au contenu principal

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 :

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

Options

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

Modèle (info)

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