diff --git a/src/cli/config_export_image.go b/src/cli/config_export_image.go index 7c1fa3df..22eb2a9b 100644 --- a/src/cli/config_export_image.go +++ b/src/cli/config_export_image.go @@ -58,7 +58,7 @@ Exports the config to an image file using customized output options.`, defer env.Close() cfg := engine.LoadConfig(env) ansi := &color.Ansi{} - ansi.InitPlain(shell.PLAIN) + ansi.InitPlain() writerColors := cfg.MakeColors(env) writer := &color.AnsiWriter{ Ansi: ansi, diff --git a/src/cli/debug.go b/src/cli/debug.go index d28a4bcd..b575b9bf 100644 --- a/src/cli/debug.go +++ b/src/cli/debug.go @@ -31,7 +31,7 @@ var debugCmd = &cobra.Command{ defer env.Close() cfg := engine.LoadConfig(env) ansi := &color.Ansi{} - ansi.InitPlain(shell.PLAIN) + ansi.InitPlain() writerColors := cfg.MakeColors(env) writer := &color.AnsiWriter{ Ansi: ansi, diff --git a/src/cli/print.go b/src/cli/print.go index f44bbf2c..4714fede 100644 --- a/src/cli/print.go +++ b/src/cli/print.go @@ -68,7 +68,7 @@ var printCmd = &cobra.Command{ ansi.Init(env.Shell()) var writer color.Writer if plain { - ansi.InitPlain(env.Shell()) + ansi.InitPlain() writer = &color.PlainWriter{ Ansi: ansi, } diff --git a/src/color/ansi.go b/src/color/ansi.go index 63862e2b..307a598d 100644 --- a/src/color/ansi.go +++ b/src/color/ansi.go @@ -128,7 +128,7 @@ func (a *Ansi) Init(shellName string) { } } -func (a *Ansi) InitPlain(shellName string) { +func (a *Ansi) InitPlain() { a.Init(shell.PLAIN) } diff --git a/src/color/ansi_test.go b/src/color/ansi_test.go index a1a36466..2dd0a230 100644 --- a/src/color/ansi_test.go +++ b/src/color/ansi_test.go @@ -80,7 +80,7 @@ func TestFormatText(t *testing.T) { } for _, tc := range cases { a := Ansi{} - a.InitPlain(shell.PLAIN) + a.InitPlain() formattedText := a.formatText(tc.Text) assert.Equal(t, tc.Expected, formattedText, tc.Case) } diff --git a/src/console/title_test.go b/src/console/title_test.go index 5df2de4c..0bdd0a71 100644 --- a/src/console/title_test.go +++ b/src/console/title_test.go @@ -61,7 +61,7 @@ func TestGetTitle(t *testing.T) { Folder: "vagrant", }) ansi := &color.Ansi{} - ansi.InitPlain(tc.ShellName) + ansi.InitPlain() ct := &Title{ Env: env, Ansi: ansi, @@ -116,7 +116,7 @@ func TestGetConsoleTitleIfGethostnameReturnsError(t *testing.T) { HostName: "", }) ansi := &color.Ansi{} - ansi.InitPlain(tc.ShellName) + ansi.InitPlain() ct := &Title{ Env: env, Ansi: ansi, diff --git a/src/engine/block.go b/src/engine/block.go index 28cc5974..ae01cd7c 100644 --- a/src/engine/block.go +++ b/src/engine/block.go @@ -53,7 +53,7 @@ func (b *Block) Init(env environment.Environment, writer color.Writer, ansi *col func (b *Block) InitPlain(env environment.Environment, config *Config) { b.ansi = &color.Ansi{} - b.ansi.InitPlain(env.Shell()) + b.ansi.InitPlain() b.writer = &color.AnsiWriter{ Ansi: b.ansi, TerminalBackground: shell.ConsoleBackgroundColor(env, config.TerminalBackground), diff --git a/src/engine/engine_test.go b/src/engine/engine_test.go index 4a97f15a..3f39d20d 100644 --- a/src/engine/engine_test.go +++ b/src/engine/engine_test.go @@ -58,7 +58,7 @@ func engineRender() { defer testClearDefaultConfig() ansi := &color.Ansi{} - ansi.InitPlain(env.Shell()) + ansi.InitPlain() writerColors := cfg.MakeColors(env) writer := &color.AnsiWriter{ Ansi: ansi, diff --git a/src/engine/image_test.go b/src/engine/image_test.go index f58cd149..5ba82a8a 100644 --- a/src/engine/image_test.go +++ b/src/engine/image_test.go @@ -3,7 +3,6 @@ package engine import ( "io/ioutil" "oh-my-posh/color" - "oh-my-posh/shell" "os" "path/filepath" "testing" @@ -33,7 +32,7 @@ func runImageTest(config, content string) (string, error) { } defer os.Remove(file.Name()) ansi := &color.Ansi{} - ansi.InitPlain(shell.PLAIN) + ansi.InitPlain() image := &ImageRenderer{ AnsiString: content, Ansi: ansi,