fix(debug): print non-escaped prompt

This commit is contained in:
Jan De Dobbeleer 2024-11-14 09:38:08 +01:00 committed by Jan De Dobbeleer
parent bebadac664
commit d023b76a7f

View file

@ -10,6 +10,7 @@ import (
"github.com/jandedobbeleer/oh-my-posh/src/log" "github.com/jandedobbeleer/oh-my-posh/src/log"
"github.com/jandedobbeleer/oh-my-posh/src/prompt" "github.com/jandedobbeleer/oh-my-posh/src/prompt"
"github.com/jandedobbeleer/oh-my-posh/src/runtime" "github.com/jandedobbeleer/oh-my-posh/src/runtime"
"github.com/jandedobbeleer/oh-my-posh/src/shell"
"github.com/jandedobbeleer/oh-my-posh/src/template" "github.com/jandedobbeleer/oh-my-posh/src/template"
"github.com/jandedobbeleer/oh-my-posh/src/terminal" "github.com/jandedobbeleer/oh-my-posh/src/terminal"
@ -34,16 +35,16 @@ func createDebugCmd() *cobra.Command {
log.Enable() log.Enable()
log.Debug("debug mode enabled") log.Debug("debug mode enabled")
shell := os.Getenv("POSH_SHELL") sh := os.Getenv("POSH_SHELL")
configFile := config.Path(configFlag) configFile := config.Path(configFlag)
cfg := config.Load(configFile, shell, false) cfg := config.Load(configFile, sh, false)
flags := &runtime.Flags{ flags := &runtime.Flags{
Config: configFile, Config: configFile,
Debug: true, Debug: true,
PWD: pwd, PWD: pwd,
Shell: shell, Shell: sh,
Plain: plain, Plain: plain,
} }
@ -57,7 +58,7 @@ func createDebugCmd() *cobra.Command {
env.Close() env.Close()
}() }()
terminal.Init(shell) terminal.Init(shell.GENERIC)
terminal.BackgroundColor = cfg.TerminalBackground.ResolveTemplate() terminal.BackgroundColor = cfg.TerminalBackground.ResolveTemplate()
terminal.Colors = cfg.MakeColors(env) terminal.Colors = cfg.MakeColors(env)
terminal.Plain = plain terminal.Plain = plain