Repository: JanDeDobbeleer/oh-my-posh
Pull request #5550 (2024-09-02 10:40:54)

Various
### Prerequisites

- [x] I have read and understood the [contributing guide][CONTRIBUTING.md].
- [x] The commit message follows the [conventional commits][cc] guidelines.
- [x] Tests for the changes have been added (for bug fixes / features).
- [x] Docs have been added/updated (for bug fixes / features).

### Description

multiple issues

<!---

Tips:

If you're not comfortable with working with Git,
we're working a guide (https://ohmyposh.dev/docs/contributing/git) to help you out.
Oh My Posh advises GitKraken (https://www.gitkraken.com/invite/nQmDPR9D) as your preferred cross platform Git GUI power tool.

-->

[CONTRIBUTING.md]: https://github.com/JanDeDobbeleer/oh-my-posh/blob/main/CONTRIBUTING.md
[cc]: https://www.conventionalcommits.org/en/v1.0.0/#summary



Patch:
diff --git a/.github/ISSUE_TEMPLATE/bug.yml b/.github/ISSUE_TEMPLATE/bug.yml
index 15403de6..a8232554 100644
--- a/.github/ISSUE_TEMPLATE/bug.yml
+++ b/.github/ISSUE_TEMPLATE/bug.yml
@@ -61,7 +61,7 @@ body:
     id: logs
     attributes:
       label: Log output
-      description: Please copy and paste the output generated by `oh-my-posh debug --plain`.
+      description: Please copy and paste the output generated by `oh-my-posh debug <shell> --plain`.
       render: Shell
     validations:
       required: true
diff --git a/src/config/config.go b/src/config/config.go
index 28bf2b11..3f77b8e9 100644
--- a/src/config/config.go
+++ b/src/config/config.go
@@ -65,16 +65,31 @@ func (cfg *Config) getPalette() color.Palette {
 	if cfg.Palettes == nil {
 		return cfg.Palette
 	}
+
 	tmpl := &template.Text{
 		Template: cfg.Palettes.Template,
 		Env:      cfg.env,
 	}
-	if palette, err := tmpl.Render(); err == nil {
-		if p, ok := cfg.Palettes.List[palette]; ok {
-			return p
+
+	key, err := tmpl.Render()
+	if err != nil {
+		return cfg.Palette
+	}
+
+	palette, ok := cfg.Palettes.List[key]
+	if !ok {
+		return cfg.Palette
+	}
+
+	for key, color := range cfg.Palette {
+		if _, ok := palette[key]; ok {
+			continue
 		}
+
+		palette[key] = color
 	}
-	return cfg.Palette
+
+	return palette
 }
 
 func (cfg *Config) Features() shell.Features {
diff --git a/src/properties/map.go b/src/properties/map.go
index 07632c7a..58b1dc51 100644
--- a/src/properties/map.go
+++ b/src/properties/map.go
@@ -53,6 +53,8 @@ const (
 	DefaultCacheTimeout = 10
 	// CacheTimeout cache timeout
 	CacheTimeout Property = "cache_timeout"
+	// Files to trigger the segment on
+	Files Property = "files"
 )
 
 type Map map[Property]any
diff --git a/src/segments/cf_target.go b/src/segments/cf_target.go
index 32bb942b..adb695a2 100644
--- a/src/segments/cf_target.go
+++ b/src/segments/cf_target.go
@@ -41,12 +41,17 @@ func (c *CfTarget) Enabled() bool {
 		return c.setCFTargetStatus()
 	}
 
-	manifest, err := c.env.HasParentFilePath("manifest.yml", false)
-	if err != nil || manifest.IsDir {
-		return false
+	files := c.props.GetStringArray(properties.Files, []string{"manifest.yml"})
+	for _, file := range files {
+		manifest, err := c.env.HasParentFilePath(file, false)
+		if err != nil || manifest.IsDir {
+			continue
+		}
+
+		return c.setCFTargetStatus()
 	}
 
-	return c.setCFTargetStatus()
+	return false
 }
 
 func (c *CfTarget) setCFTargetStatus() bool {
diff --git a/src/segments/kubectl.go b/src/segments/kubectl.go
index a3dc1c4f..d134a6c1 100644
--- a/src/segments/kubectl.go
+++ b/src/segments/kubectl.go
@@ -90,7 +90,7 @@ func (k *Kubectl) Enabled() bool {
 		}
 	}()
 
-	parseKubeConfig := k.props.GetBool(ParseKubeConfig, false)
+	parseKubeConfig := k.props.GetBool(ParseKubeConfig, true)
 
 	if parseKubeConfig {
 		return k.doParseKubeConfig()
diff --git a/src/segments/language.go b/src/segments/language.go
index db17b998..a643d53e 100644
--- a/src/segments/language.go
+++ b/src/segments/language.go
@@ -128,7 +128,9 @@ func (l *language) Enabled() bool {
 		if len(l.displayMode) == 0 {
 			l.displayMode = l.props.GetString(DisplayMode, DisplayModeFiles)
 		}
+
 		l.loadLanguageContext()
+
 		switch l.displayMode {
 		case DisplayModeAlways:
 			enabled = true
diff --git a/src/template/files.go b/src/template/files.go
index 862ef604..72c53cb5 100644
--- a/src/template/files.go
+++ b/src/template/files.go
@@ -2,7 +2,10 @@ package template
 
 import (
 	"os"
+	"os/exec"
 	"path/filepath"
+
+	"github.com/jandedobbeleer/oh-my-posh/src/log"
 )
 
 func glob(pattern string) (bool, error) {
@@ -17,3 +20,13 @@ func readFile(path string) string {
 	content, _ := os.ReadFile(path)
 	return string(content)
 }
+
+func stat(path string) string {
+	fullPath, err := exec.LookPath(path)
+	if err != nil {
+		log.Error(err)
+		return ""
+	}
+
+	return fullPath
+}
diff --git a/src/template/func_map.go b/src/template/func_map.go
index 0a13d03e..e1eed05d 100644
--- a/src/template/func_map.go
+++ b/src/template/func_map.go
@@ -1,6 +1,7 @@
 package template
 
 import (
+	"path/filepath"
 	"text/template"
 
 	"github.com/Masterminds/sprig/v3"
@@ -10,7 +11,7 @@ func funcMap() template.FuncMap {
 	funcMap := map[string]any{
 		"secondsRound": secondsRound,
 		"url":          url,
-		"path":         path,
+		"path":         filePath,
 		"glob":         glob,
 		"matchP":       matchP,
 		"replaceP":     replaceP,
@@ -20,11 +21,16 @@ func funcMap() template.FuncMap {
 		"hresult":      hresult,
 		"trunc":        trunc,
 		"readFile":     readFile,
+		"stat":         stat,
+		"dir":          filepath.Dir,
+		"base":         filepath.Base,
 	}
+
 	for key, fun := range sprig.TxtFuncMap() {
 		if _, ok := funcMap[key]; !ok {
 			funcMap[key] = fun
 		}
 	}
+
 	return template.FuncMap(funcMap)
 }
diff --git a/src/template/link.go b/src/template/link.go
index 3b180e54..93b38e5a 100644
--- a/src/template/link.go
+++ b/src/template/link.go
@@ -23,7 +23,7 @@ func url(text, url string) (string, error) {
 	return fmt.Sprintf("<LINK>%s<TEXT>%s</TEXT></LINK>", url, text), nil
 }
 
-func path(text, path string) (string, error) {
+func filePath(text, path string) (string, error) {
 	unsupported := []string{elvish, xonsh}
 	if slices.Contains(unsupported, shell) {
 		return text, nil
diff --git a/themes/schema.json b/themes/schema.json
index 2c981737..95c05480 100644
--- a/themes/schema.json
+++ b/themes/schema.json
@@ -2100,7 +2100,7 @@
                     "type": "boolean",
                     "title": "Parse kubeconfig",
                     "description": "Parse kubeconfig files instead of calling out to kubectl to improve performance.",
-                    "default": false
+                    "default": true
                   },
                   "context_aliases": {
                     "type": "object",
diff --git a/website/blog/2022-03-28-idiots-everywhere.md b/website/blog/2022-03-28-idiots-everywhere.md
index 9197b3ec..28f1900e 100644
--- a/website/blog/2022-03-28-idiots-everywhere.md
+++ b/website/blog/2022-03-28-idiots-everywhere.md
@@ -16,6 +16,8 @@ using an old and new version of Oh My Posh at the same time. Who does that you m
 using WSL on Windows, or VM’s on any system while sharing the same configuration cross installation.
 Not the main use-case, but also not exotic either.
 
+<!-- truncate -->
+
 ## What happened?
 
 In the beginning of the year, after what has been quite the struggle, I was finally able to deliver **the most important
diff --git a/website/docs/configuration/colors.mdx b/website/docs/configuration/colors.mdx
index 20a5f514..a29dd7ff 100644
--- a/website/docs/configuration/colors.mdx
+++ b/website/docs/configuration/colors.mdx
@@ -4,6 +4,8 @@ title: Colors
 sidebar_label: Colors
 ---
 
+import Config from "@site/src/components/Config.js";
+
 ## Standard colors
 
 Oh My Posh supports multiple different color references, being:
@@ -37,19 +39,19 @@ section in the documentation. The general template properties are listed [here][
 
 The following sample is based on the [AWS Segment][aws].
 
-```json
-{
-  "type": "aws",
-  "style": "powerline",
-  "powerline_symbol": "\uE0B0",
-  "foreground": "#ffffff",
-  "background": "#111111",
-  "foreground_templates": [
-    "{{if contains \"default\" .Profile}}#FFA400{{end}}",
-    "{{if contains \"jan\" .Profile}}#f1184c{{end}}"
-  ]
-}
-```
+<Config
+  data={{
+    type: "aws",
+    style: "powerline",
+    powerline_symbol: "\uE0B0",
+    foreground: "#ffffff",
+    background: "#111111",
+    foreground_templates: [
+      '{{if contains "default" .Profile}}#FFA400{{end}}',
+      '{{if contains "jan" .Profile}}#f1184c{{end}}',
+    ],
+  }}
+/>
 
 The logic is as follows: when `foreground_templates` contains an array, we will check every template line until there's
 one that returns a non-empty string. So, when the contents of `.Profile` contain the word `default`, the first template
@@ -66,53 +68,55 @@ Anything between the color start `<#FF479C>` and end `</>` will be colored accor
 If you want to print a colored bracket that isn't the same as the segment's `foreground`, you can
 do so like this:
 
-```json
-"template": "<#CB4B16>┏[</>",
-```
+<Config
+  data={{
+    template: "<#CB4B16>┏[</>",
+  }}
+/>
 
 If you also wanted to change the background color in the previous command, you would do so like this:
 
-```json
-"template": "<#CB4B16,#FFFFFF>┏[</>",
-```
+<Config
+  data={{
+    template: "<#CB4B16,#FFFFFF>┏[</>",
+  }}
+/>
 
 To change _only_ the background color, just omit the first color from the above string:
 
-```json
-"template": "<,#FFFFFF>┏[</>",
-```
+<Config
+  data={{
+    template: "<,#FFFFFF>┏[</>",
+  }}
+/>
 
 ## Palette
 
-If your theme defined the Palette, you can use the _Palette reference_ `p:<palette key>` in places where the
+If your configuration defined the Palette, you can use the _Palette reference_ `p:<palette key>` in places where the
 **Standard color** is expected.
 
 ### Defining a Palette
 
 Palette is a set of named **Standard colors**. To use a Palette, define a `"palette"` object
-at the top level of your theme:
-
-```json
-{
-    "$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
-    "palette": {
-        "git-foreground": "#193549",
-        "git": "#FFFB38",
-        "git-modified": "#FF9248",
-        "git-diverged": "#FF4500",
-        "git-ahead": "#B388FF",
-        "git-behind": "#B388FF",
-        "red":   "#FF0000",
-        "green": "#00FF00",
-        "blue":  "#0000FF",
-        "white": "#FFFFFF",
-        "black": "#111111"
+at the top level of your configuration:
+
+<Config
+  data={{
+    palette: {
+      "git-foreground": "#193549",
+      git: "#FFFB38",
+      "git-modified": "#FF9248",
+      "git-diverged": "#FF4500",
+      "git-ahead": "#B388FF",
+      "git-behind": "#B388FF",
+      red: "#FF0000",
+      green: "#00FF00",
+      blue: "#0000FF",
+      white: "#FFFFFF",
+      black: "#111111",
     },
-    "blocks": {
-        ...
-    }
-}
-```
+  }}
+/>
 
 Color names (palette keys) can have any string value, so be creative.
 Color values, on the other hand, should adhere to the **Standard color** format.
@@ -123,48 +127,47 @@ You can now use _Palette references_ in any [Segment's][segment] `foreground`, `
 `background`, `background_templates` properties, and other config properties that expect **Standard color** value.
 _Palette reference_ format is `p:<palette key>`. Take a look at the [Git][git] segment using _Palette references_:
 
-```json
-{
-    "type": "git",
-    "style": "powerline",
-    "powerline_symbol": "\uE0B0",
-    "foreground": "p:git-foreground",
-    "background": "p:git",
-    "background_templates": [
-        "{{ if or (.Working.Changed) (.Staging.Changed) }}p:git-modified{{ end }}",
-        "{{ if and (gt .Ahead 0) (gt .Behind 0) }}p:git-diverged{{ end }}",
-        "{{ if gt .Ahead 0 }}p:git-ahead{{ end }}",
-        "{{ if gt .Behind 0 }}p:git-behind{{ end }}"
+<Config
+  data={{
+    type: "git",
+    style: "powerline",
+    powerline_symbol: "\uE0B0",
+    foreground: "p:git-foreground",
+    background: "p:git",
+    background_templates: [
+      "{{ if or (.Working.Changed) (.Staging.Changed) }}p:git-modified{{ end }}",
+      "{{ if and (gt .Ahead 0) (gt .Behind 0) }}p:git-diverged{{ end }}",
+      "{{ if gt .Ahead 0 }}p:git-ahead{{ end }}",
+      "{{ if gt .Behind 0 }}p:git-behind{{ end }}",
     ],
-    ...
-},
-```
+  }}
+/>
 
-Having all of the colors defined in one place allows you to import existing color themes (usually with slight
+Having all of the colors defined in one place allows you to import existing color configurations (usually with slight
 tweaking to adhere to the format), easily change colors of multiple segments at once, and have a more
-organized theme overall. Be creative!
+organized configuration overall. Be creative!
 
 ### _Palette references_ and **Standard colors**
 
-Using Palette does not interfere with using **Standard colors** in your theme. You can still use **Standard colors**
+Using Palette does not interfere with using **Standard colors** in your configuration. You can still use **Standard colors**
 everywhere. This can be useful if you want to use a specific color for a single segment element, or in a
 _Color override_ ([Battery segment][battery]):
 
-```json
-{
-    "type": "battery",
-    "style": "powerline",
-    "invert_powerline": true,
-    "powerline_symbol": "\uE0B2",
-    "foreground": "p:white",
-    "background": "p:black",
-    "properties": {
-        "discharging_icon": "<#ffa500>-</> ",
-        "charging_icon": "+ ",
-        "charged_icon": "* ",
-    }
-},
-```
+<Config
+  data={{
+    type: "battery",
+    style: "powerline",
+    invert_powerline: true,
+    powerline_symbol: "\uE0B2",
+    foreground: "p:white",
+    background: "p:black",
+    properties: {
+      discharging_icon: "<#ffa500>-</> ",
+      charging_icon: "+ ",
+      charged_icon: "* ",
+    },
+  }}
+/>
 
 ### Handling of invalid references
 
@@ -178,18 +181,16 @@ Palette allows for recursive _Palette reference_ resolution. You can use a _Pale
 value in Palette. This allows you to define named colors, and use references to those colors as Palette values.
 For example, `p:foreground` and `p:background` will be correctly set to "#CAF0F80" and "#023E8A":
 
-```json
-    "$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
-    "palette": {
-        "light-blue": "#CAF0F8",
-        "dark-blue": "#023E8A",
-        "foreground": "p:light-blue",
-        "background": "p:dark-blue"
+<Config
+  data={{
+    palette: {
+      "light-blue": "#CAF0F8",
+      "dark-blue": "#023E8A",
+      foreground: "p:light-blue",
+      background: "p:dark-blue",
     },
-    "blocks": {
-        ...
-    }
-```
+  }}
+/>
 
 ## Palettes
 
@@ -199,67 +200,97 @@ runtime so your prompt can change at any time based on the outcome of the `templ
 
 Take the following configuration:
 
-```json
-{
-  "$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
-  "palettes": {
-    "template": "{{ if eq .Shell \"pwsh\" }}latte{{ else }}frappe{{ end }}",
-    "list": {
-      "latte": {
-        "black": "#262B44",
-        "green": "#59C9A5",
-        "orange": "#F07623",
-        "red": "#e64553",
-        "white": "#E0DEF4",
-        "yellow": "#df8e1d",
-        "blue": "#7287fd"
+<Config
+  data={{
+    palettes: {
+      template: '{{ if eq .Shell "pwsh" }}latte{{ else }}frappe{{ end }}',
+      list: {
+        latte: {
+          black: "#262B44",
+          green: "#59C9A5",
+          orange: "#F07623",
+          red: "#e64553",
+          white: "#E0DEF4",
+          yellow: "#df8e1d",
+          blue: "#7287fd",
+        },
+        frappe: {
+          black: "#262B44",
+          green: "#59C9A5",
+          orange: "#F07623",
+          red: "#D81E5B",
+          white: "#E0DEF4",
+          yellow: "#F3AE35",
+          blue: "#4B95E9",
+        },
       },
-      "frappe": {
-        "black": "#262B44",
-        "green": "#59C9A5",
-        "orange": "#F07623",
-        "red": "#D81E5B",
-        "white": "#E0DEF4",
-        "yellow": "#F3AE35",
-        "blue": "#4B95E9"
-      }
-    }
-  },
-  "blocks": [
-    ...
-  ]
-}
-```
+    },
+  }}
+/>
 
 In this case, when the shell is `pwsh`, the `latte` palette will be used, otherwise it uses the `frappe` palette. If you want,
 you could also add `frappe` as the default `palette`, given that one is used as a fallback when not match can be found based on what
 the `template` resolves to. In case no match is available and no `palette` is defined, it will also fallback to `transparent`
 for any palette color reference in templates/colors.
 
+If you want to avoid color duplication, you can use palettes in combination with the `palette` property. This way you can define
+a color once and reuse it in multiple palettes. For example:
+
+<Config
+  data={{
+    palette: {
+      black: "#262B44",
+      green: "#59C9A5",
+      orange: "#F07623",
+    },
+    palettes: {
+      template: '{{ if eq .Shell "pwsh" }}latte{{ else }}frappe{{ end }}',
+      list: {
+        latte: {
+          red: "#e64553",
+          white: "#E0DEF4",
+          yellow: "#df8e1d",
+          blue: "#7287fd",
+        },
+        frappe: {
+          red: "#D81E5B",
+          white: "#E0DEF4",
+          yellow: "#F3AE35",
+          blue: "#4B95E9",
+        },
+      },
+    },
+  }}
+/>
+
+:::info
+If a color is defined in both palette and palettes, the palettes' resolved color will take precedence.
+:::
+
 ## Cycle
 
 When you want to display the same **sequence of colors** (background and foreground) regardless of which segments are active, you can
 make use of the cycle property. This property is a list of colors which are used one after the other in a continuous loop. A defined
 cycle always gets precedence over everything else.
 
-```json
-...
-"cycle": [
-  {
-    "background": "p:blue",
-    "foreground": "p:white"
-  },
-  {
-    "background": "p:green",
-    "foreground": "p:black"
-  },
-  {
-    "background": "p:orange",
-    "foreground": "p:white"
-  }
-],
-...
-```
+<Config
+  data={{
+    cycle: [
+      {
+        background: "p:blue",
+        foreground: "p:white",
+      },
+      {
+        background: "p:green",
+        foreground: "p:black",
+      },
+      {
+        background: "p:orange",
+        foreground: "p:white",
+      },
+    ],
+  }}
+/>
 
 [hexcolors]: https://htmlcolorcodes.com/color-chart/material-design-color-chart/
 [ansicolors]: https://htmlcolorcodes.com/color-chart/material-design-color-chart/
diff --git a/website/docs/segments/cli/kubectl.mdx b/website/docs/segments/cli/kubectl.mdx
index 93b5f2df..61453c8d 100644
--- a/website/docs/segments/cli/kubectl.mdx
+++ b/website/docs/segments/cli/kubectl.mdx
@@ -30,12 +30,12 @@ import Config from "@site/src/components/Config.js";
 
 ## Properties
 
-| Name               | Type      | Default | Description                                                                     |
+| Name               |   Type    | Default | Description                                                                     |
 | ------------------ | :-------: | :-----: | ------------------------------------------------------------------------------- |
 | `display_error`    | `boolean` | `false` | show the error context when failing to retrieve the kubectl information         |
-| `parse_kubeconfig` | `boolean` | `false` | parse kubeconfig files instead of calling out to kubectl to improve performance |
+| `parse_kubeconfig` | `boolean` | `true`  | parse kubeconfig files instead of calling out to kubectl to improve performance |
 | `context_aliases`  | `object`  |         | custom context namespace                                                        |
-| `cache_timeout`    | `int`     |   `0`   | in minutes - how long is the context cached                                     |
+| `cache_timeout`    |   `int`   |   `0`   | in minutes - how long is the context cached                                     |
 
 ## Template ([info][templates])
 
@@ -64,6 +64,7 @@ render an empty current namespace using the word "default", you can use somethin
 ```
 {{.Context}} :: {{if .Namespace}}{{.Namespace}}{{else}}default{{end}}
 ```
+
 :::
 
 [templates]: /docs/configuration/templates
diff --git a/website/docs/segments/cloud/cftarget.mdx b/website/docs/segments/cloud/cftarget.mdx
index 58da8934..faa11c5f 100644
--- a/website/docs/segments/cloud/cftarget.mdx
+++ b/website/docs/segments/cloud/cftarget.mdx
@@ -10,22 +10,25 @@ Display the details of the logged [Cloud Foundry endpoint][cf-target] (`cf targe
 
 ## Sample Configuration
 
-import Config from '@site/src/components/Config.js';
-
-<Config data={{
-  "background": "#a7cae1",
-  "foreground": "#100e23",
-  "powerline_symbol": "\ue0b0",
-  "template": " \uf40a {{ .Org }}/{{ .Space }} ",
-  "style": "powerline",
-  "type": "cftarget"
-}}/>
+import Config from "@site/src/components/Config.js";
+
+<Config
+  data={{
+    background: "#a7cae1",
+    foreground: "#100e23",
+    powerline_symbol: "\ue0b0",
+    template: " \uf40a {{ .Org }}/{{ .Space }} ",
+    style: "powerline",
+    type: "cftarget",
+  }}
+/>
 
 ## Properties
 
-| Name           | Type     | Default  | Description                                                                                                                                       |
-| -------------- | :------: | :------: | ------------------------------------------------------------------------------------------------------------------------------------------------- |
-| `display_mode` | `string` | `always` | <ul><li>`always`: the segment is always displayed</li><li>`files`: the segment is only displayed when a `manifest.yml` file is present </li></ul> |
+| Name           |    Type    |      Default       | Description                                                                                                                                                                            |
+| -------------- | :--------: | :----------------: | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| `display_mode` |  `string`  |      `always`      | <ul><li>`always`: the segment is always displayed</li><li>`files`: the segment is only displayed when a `manifest.yml` file is present (or defined otherwise using `files`) </li></ul> |
+| `files`        | `[]string` | `["manifest.yml"]` | on which files to display the segment on. Will look in parent folders as well                                                                                                          |
 
 ## Template ([info][templates])
 
diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js
index 51bfccf0..b186b369 100644
--- a/website/docusaurus.config.js
+++ b/website/docusaurus.config.js
@@ -168,6 +168,9 @@ module.exports = {
             require.resolve('./src/css/custom.css')
           ],
         },
+        blog: {
+          onInlineAuthors: 'ignore'
+        },
       },
     ],
   ],


Test patch:
diff --git a/src/config/config_test.go b/src/config/config_test.go
index f10f27fd..2cd33f41 100644
--- a/src/config/config_test.go
+++ b/src/config/config_test.go
@@ -17,6 +17,7 @@ func TestGetPalette(t *testing.T) {
 		"red":  "#ff0000",
 		"blue": "#0000ff",
 	}
+
 	cases := []struct {
 		Case            string
 		Palettes        *color.Palettes
@@ -69,7 +70,26 @@ func TestGetPalette(t *testing.T) {
 			Case:            "no palettes",
 			ExpectedPalette: nil,
 		},
+		{
+			Case: "match, with override",
+			Palettes: &color.Palettes{
+				Template: "{{ .Shell }}",
+				List: map[string]color.Palette{
+					"bash": {
+						"red":    "#ff0001",
+						"yellow": "#ffff00",
+					},
+				},
+			},
+			Palette: palette,
+			ExpectedPalette: color.Palette{
+				"red":    "#ff0001",
+				"blue":   "#0000ff",
+				"yellow": "#ffff00",
+			},
+		},
 	}
+
 	for _, tc := range cases {
 		env := &mock.Environment{}
 		env.On("TemplateCache").Return(&cache.Template{