diff --git a/Themes/avit.json b/Themes/avit.json index 1fed161d89a7..3e8e2a1b7730 100644 --- a/Themes/avit.json +++ b/Themes/avit.json @@ -8,7 +8,6 @@ "type": "path", "style": "plain", "foreground": "#ffffff", - "background": "#193549", "properties": { "prefix": "", "home_icon": "~", @@ -19,7 +18,6 @@ "type": "git", "style": "plain", "foreground": "#C2C206", - "background": "#193549", "properties": { "branch_icon": "", "branch_identical_icon": "≡", @@ -34,7 +32,6 @@ "type": "root", "style": "plain", "foreground": "#B5B50D", - "background": "#193549", "properties": { "root_icon": "⚡" } @@ -43,7 +40,6 @@ "type": "exit", "style": "plain", "foreground": "#C94A16", - "background": "#193549", "properties": { "error_icon": "x" } @@ -61,7 +57,6 @@ "type": "text", "style": "plain", "foreground": "#007ACC", - "background": "#193549", "properties": { "prefix": "", "text": "▶" @@ -70,6 +65,5 @@ ] } ], - "console_background_color": "#193549", "end_space_enabled": true } diff --git a/Themes/darkblood.json b/Themes/darkblood.json index b7ebf249b73d..78cd1fd72ba9 100644 --- a/Themes/darkblood.json +++ b/Themes/darkblood.json @@ -8,7 +8,6 @@ "type": "session", "style": "plain", "foreground": "#ffffff", - "background": "#193549", "properties": { "user_info_separator": "", "display_computer": false, @@ -20,7 +19,6 @@ "type": "git", "style": "plain", "foreground": "#ffffff", - "background": "#193549", "properties": { "branch_icon": "", "branch_identical_icon": "≡", @@ -37,7 +35,6 @@ "type": "root", "style": "plain", "foreground": "#ffffff", - "background": "#193549", "properties": { "root_icon": "⚡", "prefix": "<#CB4B16>[", @@ -48,7 +45,6 @@ "type": "exit", "style": "plain", "foreground": "#ffffff", - "background": "#193549", "properties": { "error_icon": "x", "prefix": "<#CB4B16>[", @@ -68,7 +64,6 @@ "type": "path", "style": "plain", "foreground": "#ffffff", - "background": "#193549", "properties": { "home_icon": "~", "style": "short", @@ -79,6 +74,5 @@ ] } ], - "console_background_color": "#193549", "end_space_enabled": true } diff --git a/Themes/emodipt.json b/Themes/emodipt.json index 0ef8b659cb6e..9c0b50f6c28a 100644 --- a/Themes/emodipt.json +++ b/Themes/emodipt.json @@ -8,7 +8,6 @@ "type": "time", "style": "plain", "foreground": "#E5C07B", - "background": "#193549", "properties": { "time_format": "15:04:05", "prefix": "[ ", @@ -19,7 +18,6 @@ "type": "root", "style": "plain", "foreground": "#B5B50D", - "background": "#193549", "properties": { "root_icon": "⚡" } @@ -28,7 +26,6 @@ "type": "path", "style": "plain", "foreground": "#61AFEF", - "background": "#193549", "properties": { "home_icon": "~", "style": "agnoster", @@ -39,7 +36,6 @@ "type": "git", "style": "plain", "foreground": "#F3C267", - "background": "#193549", "properties": { "branch_icon": "🚦 ", "display_status": true, @@ -55,7 +51,6 @@ "type": "exit", "style": "plain", "foreground": "#C94A16", - "background": "#193549", "properties": { "error_icon": "x" } @@ -64,7 +59,6 @@ "type": "text", "style": "plain", "foreground": "#E06C75", - "background": "#193549", "properties": { "prefix": "", "text": " ❯" @@ -73,6 +67,5 @@ ] } ], - "console_background_color": "#193549", "end_space_enabled": true } diff --git a/Themes/fish.json b/Themes/fish.json index 2b31ba2dc3cf..fb03dafe3e49 100644 --- a/Themes/fish.json +++ b/Themes/fish.json @@ -9,7 +9,6 @@ "type": "exit", "style": "plain", "foreground": "#ffffff", - "background": "#193549", "properties": { "error_icon": " ", "postfix": "" @@ -19,7 +18,6 @@ "type": "root", "style": "plain", "foreground": "#100e23", - "background": "#193549", "properties": { "root_icon": "襁" } @@ -28,7 +26,6 @@ "type": "session", "style": "plain", "foreground": "#ffffff", - "background": "#193549", "properties": { "user_info_separator": "@" } @@ -69,7 +66,6 @@ "type": "text", "style": "plain", "foreground": "#007ACC", - "background": "#193549", "properties": { "prefix": "", "text": "" @@ -77,6 +73,5 @@ } ] } - ], - "console_background_color": "#193549" + ] } diff --git a/Themes/honukai.json b/Themes/honukai.json index 8ed67c15007a..14256c7a36fc 100644 --- a/Themes/honukai.json +++ b/Themes/honukai.json @@ -8,7 +8,6 @@ "type": "session", "style": "plain", "foreground": "#FFFFFF", - "background": "#193549", "properties": { "user_info_separator": " <#ffffff>in ", "prefix": "<#0377C8># ", @@ -20,7 +19,6 @@ "type": "path", "style": "plain", "foreground": "#0973C0", - "background": "#193549", "properties": { "home_icon": "~", "folder_icon": "", @@ -33,7 +31,6 @@ "type": "git", "style": "plain", "foreground": "#B8B80A", - "background": "#193549", "properties": { "branch_icon": "", "branch_identical_icon": "≡", @@ -55,7 +52,6 @@ "type": "time", "style": "plain", "foreground": "#ffffff", - "background": "#193549", "properties": { "prefix": "[", "postfix": "]" @@ -74,7 +70,6 @@ "type": "root", "style": "plain", "foreground": "#CECE04", - "background": "#193549", "properties": { "prefix": "", "root_icon": "襁" @@ -84,7 +79,6 @@ "type": "virtualenv", "style": "plain", "foreground": "#100e23", - "background": "#193549", "properties": { "prefix": "", "python_icon": "" @@ -94,7 +88,6 @@ "type": "exit", "style": "plain", "foreground": "#CB4B16", - "background": "#193549", "properties": { "prefix": "", "error_icon": "" @@ -104,7 +97,6 @@ "type": "text", "style": "plain", "foreground": "#CC4B16", - "background": "#193549", "properties": { "prefix": "", "text": "→" @@ -113,6 +105,5 @@ ] } ], - "console_background_color": "#193549", "end_space_enabled": true } diff --git a/Themes/lambda.json b/Themes/lambda.json index fe3420e51ed6..f82a13d51cc3 100644 --- a/Themes/lambda.json +++ b/Themes/lambda.json @@ -8,8 +8,8 @@ "type": "text", "style": "plain", "foreground": "#F5F5F5", - "background": "#193549", "properties": { + "prefix": "", "text": "ﬦ" } }, @@ -17,7 +17,6 @@ "type": "path", "style": "plain", "foreground": "#B80101", - "background": "#193549", "properties": { "style": "agnoster" } @@ -26,7 +25,6 @@ "type": "git", "style": "plain", "foreground": "#B80101", - "background": "#193549", "properties": { "branch_icon": "", "branch_identical_icon": "≡", @@ -41,6 +39,5 @@ ] } ], - "console_background_color": "#193549", "end_space_enabled": true } diff --git a/Themes/material.json b/Themes/material.json index 7e402a8a2cc9..37d790be5049 100644 --- a/Themes/material.json +++ b/Themes/material.json @@ -8,7 +8,6 @@ "type": "text", "style": "plain", "foreground": "#ffffff", - "background": "#193549", "properties": { "text": "<#C591E8>❭<#69FF94>❭" } @@ -17,7 +16,6 @@ "type": "path", "style": "plain", "foreground": "#56B6C2", - "background": "#193549", "properties": { "style": "folder" } @@ -26,7 +24,6 @@ "type": "git", "style": "plain", "foreground": "#D0666F", - "background": "#193549", "properties": { "branch_icon": "", "display_status": false, @@ -38,7 +35,6 @@ "type": "exit", "style": "plain", "foreground": "#DCB977", - "background": "#193549", "properties": { "error_icon": "✗", "display_error_code": false @@ -48,7 +44,6 @@ "type": "time", "style": "plain", "foreground": "#66F68F", - "background": "#193549", "properties": { "time_format": "15:04" } @@ -56,6 +51,5 @@ ] } ], - "console_background_color": "#193549", "end_space_enabled": true } diff --git a/Themes/paradox.json b/Themes/paradox.json index 0ec5b81abdcd..f41e6a169c22 100644 --- a/Themes/paradox.json +++ b/Themes/paradox.json @@ -82,7 +82,6 @@ "type": "text", "style": "plain", "foreground": "#007ACC", - "background": "#193549", "properties": { "prefix": "", "text": "" diff --git a/Themes/pararussel.json b/Themes/pararussel.json index 01447af3707f..37c62ec3afb1 100644 --- a/Themes/pararussel.json +++ b/Themes/pararussel.json @@ -8,7 +8,6 @@ "type": "text", "style": "plain", "foreground": "#ffffff", - "background": "#193549", "properties": { "prefix": "", "text": "<#C591E8>❭<#69FF94>❭" @@ -18,7 +17,6 @@ "type": "path", "style": "plain", "foreground": "#56B6C2", - "background": "#193549", "properties": { "style": "folder" } @@ -27,7 +25,6 @@ "type": "git", "style": "plain", "foreground": "#D0666F", - "background": "#193549", "properties": { "branch_icon": "", "display_status": false, @@ -39,7 +36,6 @@ "type": "exit", "style": "plain", "foreground": "#DCB977", - "background": "#193549", "properties": { "error_icon": "✗", "display_error_code": false @@ -55,7 +51,6 @@ "type": "command", "style": "plain", "foreground": "#ffffff", - "background": "#193549", "properties": { "shell": "bash", "command": "git log --pretty=format:%cr -1 || date +%H:%m:%S" @@ -74,15 +69,13 @@ "type": "text", "style": "plain", "foreground": "#ffffff", - "background": "#193549", "properties": { "prefix": "", - "text": " " + "text": "" } } ] } ], - "console_background_color": "#193549", "end_space_enabled": true } diff --git a/Themes/powerlevel10k_classic.json b/Themes/powerlevel10k_classic.json index 08292ac6da66..5827ce94dae7 100644 --- a/Themes/powerlevel10k_classic.json +++ b/Themes/powerlevel10k_classic.json @@ -91,7 +91,6 @@ "type": "exit", "style": "plain", "foreground": "#D4E157", - "background": "#193549", "properties": { "prefix": "", "error_icon": "❯", @@ -102,7 +101,5 @@ } ] } - ], - "console_background_color": "#193549", - "end_space_enabled": true + ] } diff --git a/Themes/powerlevel10k_lean.json b/Themes/powerlevel10k_lean.json index 4dcb4b5f2e69..235e4b0df50d 100644 --- a/Themes/powerlevel10k_lean.json +++ b/Themes/powerlevel10k_lean.json @@ -9,7 +9,6 @@ "type": "time", "style": "plain", "foreground": "#00C5C7", - "background": "#193549", "properties": { "time_format": "15:04:05" } @@ -28,7 +27,6 @@ "type": "path", "style": "plain", "foreground": "#77E4F7", - "background": "#193549", "properties": { "prefix": "", "home_icon": "~", @@ -39,8 +37,8 @@ "type": "git", "style": "plain", "foreground": "#FFE700", - "background": "#193549", "properties": { + "prefix": "", "branch_icon": "", "branch_identical_icon": "≡", "branch_ahead_icon": "↑", @@ -54,14 +52,12 @@ "type": "text", "style": "plain", "foreground": "#43D426", - "background": "#193549", "properties": { + "prefix": "", "text": "❯" } } ] } - ], - "console_background_color": "#193549", - "end_space_enabled": true + ] } diff --git a/Themes/powerline.json b/Themes/powerline.json index 698da542c5eb..5809cf526d45 100644 --- a/Themes/powerline.json +++ b/Themes/powerline.json @@ -9,7 +9,6 @@ "type": "root", "style": "plain", "foreground": "#FFEE58", - "background": "#193549", "properties": { "root_icon": "襁" } @@ -18,7 +17,6 @@ "type": "session", "style": "plain", "foreground": "#ffffff", - "background": "#193549", "properties": { "user_info_separator": "@" } diff --git a/Themes/robbyrussel.json b/Themes/robbyrussel.json index dc0ffcc39c0c..53f010724b12 100644 --- a/Themes/robbyrussel.json +++ b/Themes/robbyrussel.json @@ -8,16 +8,15 @@ "type": "text", "style": "plain", "foreground": "#98C379", - "background": "#193549", "properties": { - "text": "→" + "text": "→", + "postfix": "" } }, { "type": "path", "style": "plain", "foreground": "#56B6C2", - "background": "#193549", "properties": { "style": "folder" } @@ -26,7 +25,6 @@ "type": "git", "style": "plain", "foreground": "#D0666F", - "background": "#193549", "properties": { "branch_icon": "", "display_status": false, @@ -38,7 +36,6 @@ "type": "exit", "style": "plain", "foreground": "#DCB977", - "background": "#193549", "properties": { "error_icon": "✗", "display_error_code": false @@ -47,6 +44,5 @@ ] } ], - "console_background_color": "#193549", "end_space_enabled": true } diff --git a/Themes/sorin.json b/Themes/sorin.json index b25dd2bafa78..b79b05feeb67 100644 --- a/Themes/sorin.json +++ b/Themes/sorin.json @@ -8,7 +8,6 @@ "type": "exit", "style": "plain", "foreground": "#CB4B16", - "background": "#193549", "properties": { "error_icon": "" } @@ -17,7 +16,6 @@ "type": "root", "style": "plain", "foreground": "#CECE04", - "background": "#193549", "properties": { "root_icon": "襁" } @@ -26,7 +24,6 @@ "type": "session", "style": "plain", "foreground": "#FFFFFF", - "background": "#193549", "properties": { "user_info_separator": "@" } @@ -35,7 +32,6 @@ "type": "path", "style": "plain", "foreground": "#0973C0", - "background": "#193549", "properties": { "home_icon": "", "folder_icon": "", @@ -48,7 +44,6 @@ "type": "git", "style": "plain", "foreground": "#C1C106", - "background": "#193549", "properties": { "branch_icon": "", "branch_identical_icon": "≡", @@ -64,7 +59,6 @@ "type": "virtualenv", "style": "plain", "foreground": "#100e23", - "background": "#193549", "properties": { "python_icon": "" } @@ -73,14 +67,12 @@ "type": "text", "style": "plain", "foreground": "#ffffff", - "background": "#193549", "properties": { + "prefix": "", "text": "<#CB4B16>❭<#CACA02>❭<#4E9A06>❭" } } ] } - ], - "console_background_color": "#193549", - "end_space_enabled": true + ] } diff --git a/Themes/star.json b/Themes/star.json index 13a2bac58a73..62534fa36856 100644 --- a/Themes/star.json +++ b/Themes/star.json @@ -8,7 +8,6 @@ "type": "path", "style": "plain", "foreground": "#ffffff", - "background": "#193549", "properties": { "prefix": "", "home_icon": "~", @@ -20,7 +19,6 @@ "type": "git", "style": "plain", "foreground": "#F3C267", - "background": "#193549", "properties": { "branch_icon": "", "display_status": false, @@ -31,7 +29,6 @@ "type": "command", "style": "plain", "foreground": "#C49EE9", - "background": "#193549", "properties": { "shell": "bash", "command": "find . -name package.json -depth 1 -exec echo \" <#ffffff>via node\" \\;" @@ -41,7 +38,6 @@ "type": "root", "style": "plain", "foreground": "#B5B50D", - "background": "#193549", "properties": { "root_icon": "⚡" } @@ -50,7 +46,6 @@ "type": "exit", "style": "plain", "foreground": "#C94A16", - "background": "#193549", "properties": { "error_icon": "x" } @@ -68,7 +63,6 @@ "type": "text", "style": "plain", "foreground": "#63F08C", - "background": "#193549", "properties": { "prefix": "", "text": "→" @@ -76,7 +70,5 @@ } ] } - ], - "console_background_color": "#193549", - "end_space_enabled": true + ] } diff --git a/Themes/zash.json b/Themes/zash.json index 7153b576500a..bc18599de37f 100644 --- a/Themes/zash.json +++ b/Themes/zash.json @@ -8,7 +8,6 @@ "type": "session", "style": "plain", "foreground": "#E36464", - "background": "#193549", "properties": { "user_info_separator": "", "display_computer": false, @@ -19,7 +18,6 @@ "type": "text", "style": "plain", "foreground": "#62ED8B", - "background": "#193549", "properties": { "text": "→", "postfix": "", @@ -30,7 +28,6 @@ "type": "path", "style": "plain", "foreground": "#56B6C2", - "background": "#193549", "properties": { "style": "folder", "postfix": "" @@ -40,7 +37,6 @@ "type": "git", "style": "plain", "foreground": "#D4AAFC", - "background": "#193549", "properties": { "branch_icon": "", "display_status": false, @@ -52,15 +48,14 @@ "type": "exit", "style": "plain", "foreground": "#DCB977", - "background": "#193549", "properties": { "error_icon": "✗", - "display_error_code": false + "display_error_code": false, + "postfix": "" } } ] } ], - "console_background_color": "#193549", "end_space_enabled": true } diff --git a/color_writer.go b/color_writer.go index d15c54c51a1e..b457ae3e26b6 100755 --- a/color_writer.go +++ b/color_writer.go @@ -14,9 +14,15 @@ type ColorWriter struct { } func (w *ColorWriter) writeColoredText(background string, foreground string, text string) { - style := color.HEXStyle(foreground, background) - text = style.Sprint(text) - w.Buffer.WriteString(text) + var coloredText string + if background != "" { + style := color.HEXStyle(foreground, background) + coloredText = style.Sprint(text) + } else { + style := color.HEX(foreground) + coloredText = style.Sprint(text) + } + w.Buffer.WriteString(coloredText) } func (w *ColorWriter) writeAndRemoveText(background string, foreground string, text string, textToRemove string, parentText string) string { @@ -25,9 +31,6 @@ func (w *ColorWriter) writeAndRemoveText(background string, foreground string, t } func (w *ColorWriter) write(background string, foreground string, text string) { - style := color.HEXStyle(foreground, background) - text = style.Sprint(text) - r := regexp.MustCompile(`<\s*(?P#[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})>(?P.*?)<\s*/\s*>`) match := r.FindAllStringSubmatch(text, -1) for i := range match {