Repository: JanDeDobbeleer/oh-my-posh
Pull request #1788 (2022-02-19 15:52:20)

feat(pwsh): support PromptText
### Prerequisites

- [x] I have read and understood the `CONTRIBUTING` guide
- [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

Adds support for PSReadLine `-PromptText` in PowerShell

https://user-images.githubusercontent.com/2492783/154808249-0ddb23a5-2ec5-42e0-a6f6-6f851ede11cf.mp4


<!---

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.

-->

[cc]: https://www.conventionalcommits.org/en/v1.0.0/#summary



Patch:
diff --git a/docs/docs/config-line-error.md b/docs/docs/config-line-error.md
new file mode 100644
index 00000000..149a1571
--- /dev/null
+++ b/docs/docs/config-line-error.md
@@ -0,0 +1,86 @@
+---
+id: config-line-error
+title: Line error
+sidebar_label: Line error
+---
+
+:::info
+This feature only works in `powershell` for the time being.
+:::
+
+Line error, when enabled, replaces the last part of the prompt when the text entered is invalid. It leverages
+[PSReadLine's][psreadline] `-PromptText` setting by adding two distinct prompts. One for a valid line,
+and one for when there's an error. As PSReadLine will rewrite the last part of
+your prompt with the value of either based on the line's context, you will need to make sure everything
+is compatible with your config as **these values are only set once** on shell start.
+
+There are two config settings you need to tweak:
+
+- `valid_line`:  displays when the line is valid (again)
+- `error_line`:  displays when the line is faulty
+
+You can use go [text/template][go-text-template] templates extended with [sprig][sprig] to enrich the text.
+Environment variables are available, just like the [`console_title_template`][console-title] functionality.
+
+## Configuration
+
+You need to extend or create a custom theme with your prompt overrides. For example:
+
+```json
+{
+    "$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
+    "blocks": {
+        ...
+    }
+    "valid_line": {
+        "background": "transparent",
+        "foreground": "#ffffff",
+        "template": "<#e0def4,#286983>\uf42e </><#286983,transparent>\ue0b4</> "
+    },
+    "error_line": {
+        "background": "transparent",
+        "foreground": "#ffffff",
+        "template": "<#eb6f92,#286983>\ue009 </><#286983,transparent>\ue0b4</> "
+    }
+}
+```
+
+The configuration has the following properties:
+
+- background: `string` [color][colors]
+- foreground: `string` [color][colors]
+- template: `string` - A go [text/template][go-text-template] template extended with [sprig][sprig] utilizing the
+properties below - defaults to ` `
+
+## Template ([info][templates])
+
+- `.Root`: `boolean` - is the current user root/admin or not
+- `.PWD`: `string` - the current working directory
+- `.Folder`: `string` - the current working folder
+- `.Shell`: `string` - the current shell name
+- `.UserName`: `string` - the current user name
+- `.HostName`: `string` - the host name
+- `.Env.VarName`: `string` - Any environment variable where `VarName` is the environment variable name
+
+## Enable the feature
+
+Invoke Oh My Posh in your `$PROFILE` and add the following line below.
+
+```powershell
+oh-my-posh --init --shell pwsh --config $env:POSH_THEMES_PATH/jandedobbeleer.omp.json | Invoke-Expression
+// highlight-start
+Enable-PoshLineError
+// highlight-end
+```
+
+:::caution
+If you import **PSReadLine** separately, make sure to import it before the `Enable-PoshLineError` command.
+:::
+
+Restart your shell or reload your `$PROFILE` using `. $PROFILE` for the changes to take effect.
+
+[go-text-template]: https://golang.org/pkg/text/template/
+[sprig]: https://masterminds.github.io/sprig/
+[console-title]: /docs/config-title#console-title-template
+[psreadline]: https://github.com/PowerShell/PSReadLine
+[templates]: /docs/config-templates
diff --git a/docs/docs/config-transient.mdx b/docs/docs/config-transient.mdx
index 98ba8084..474a1862 100644
--- a/docs/docs/config-transient.mdx
+++ b/docs/docs/config-transient.mdx
@@ -118,3 +118,4 @@ Restart your shell or reload `.zshrc` using `source ~/.zshrc` for the changes to
 [console-title]: /docs/config-title#console-title-template
 [sprig]: https://masterminds.github.io/sprig/
 [clink]: https://chrisant996.github.io/clink/
+[templates]: /docs/config-templates
diff --git a/docs/sidebars.js b/docs/sidebars.js
index 945a972f..3bab2ab8 100644
--- a/docs/sidebars.js
+++ b/docs/sidebars.js
@@ -27,6 +27,7 @@ module.exports = {
         "config-colors",
         "config-templates",
         "config-transient",
+        "config-line-error",
         "config-tooltips",
         "config-fonts",
       ],
diff --git a/src/engine/config.go b/src/engine/config.go
index bf8b51c7..6183e03b 100644
--- a/src/engine/config.go
+++ b/src/engine/config.go
@@ -30,17 +30,19 @@ const (
 
 // Config holds all the theme for rendering the prompt
 type Config struct {
-	Version              int              `json:"version"`
-	FinalSpace           bool             `json:"final_space,omitempty"`
-	OSC99                bool             `json:"osc99,omitempty"`
-	ConsoleTitle         bool             `json:"console_title,omitempty"`
-	ConsoleTitleStyle    console.Style    `json:"console_title_style,omitempty"`
-	ConsoleTitleTemplate string           `json:"console_title_template,omitempty"`
-	TerminalBackground   string           `json:"terminal_background,omitempty"`
-	Blocks               []*Block         `json:"blocks,omitempty"`
-	Tooltips             []*Segment       `json:"tooltips,omitempty"`
-	TransientPrompt      *TransientPrompt `json:"transient_prompt,omitempty"`
-	Palette              color.Palette    `json:"palette,omitempty"`
+	Version              int           `json:"version"`
+	FinalSpace           bool          `json:"final_space,omitempty"`
+	OSC99                bool          `json:"osc99,omitempty"`
+	ConsoleTitle         bool          `json:"console_title,omitempty"`
+	ConsoleTitleStyle    console.Style `json:"console_title_style,omitempty"`
+	ConsoleTitleTemplate string        `json:"console_title_template,omitempty"`
+	TerminalBackground   string        `json:"terminal_background,omitempty"`
+	Blocks               []*Block      `json:"blocks,omitempty"`
+	Tooltips             []*Segment    `json:"tooltips,omitempty"`
+	TransientPrompt      *ExtraPrompt  `json:"transient_prompt,omitempty"`
+	ValidLine            *ExtraPrompt  `json:"valid_line,omitempty"`
+	ErrorLine            *ExtraPrompt  `json:"error_line,omitempty"`
+	Palette              color.Palette `json:"palette,omitempty"`
 
 	format  string
 	origin  string
@@ -55,7 +57,7 @@ func (cfg *Config) MakeColors(env environment.Environment) color.AnsiColors {
 	return color.MakeColors(cfg.Palette, !cacheDisabled)
 }
 
-type TransientPrompt struct {
+type ExtraPrompt struct {
 	Template   string `json:"template,omitempty"`
 	Background string `json:"background,omitempty"`
 	Foreground string `json:"foreground,omitempty"`
@@ -119,7 +121,7 @@ func loadConfig(env environment.Environment) *Config {
 
 	// initialize default values
 	if cfg.TransientPrompt == nil {
-		cfg.TransientPrompt = &TransientPrompt{}
+		cfg.TransientPrompt = &ExtraPrompt{}
 	}
 
 	return &cfg
diff --git a/src/engine/engine.go b/src/engine/engine.go
index 6c2bd82c..323b0507 100644
--- a/src/engine/engine.go
+++ b/src/engine/engine.go
@@ -266,24 +266,48 @@ func (e *Engine) RenderTooltip(tip string) string {
 	return ""
 }
 
-func (e *Engine) RenderTransientPrompt() string {
-	if e.Config.TransientPrompt == nil {
+type ExtraPromptType int
+
+const (
+	Transient ExtraPromptType = iota
+	Valid
+	Error
+)
+
+func (e *Engine) RenderExtraPrompt(promptType ExtraPromptType) string {
+	var prompt *ExtraPrompt
+	switch promptType {
+	case Transient:
+		prompt = e.Config.TransientPrompt
+	case Valid:
+		prompt = e.Config.ValidLine
+	case Error:
+		prompt = e.Config.ErrorLine
+	}
+	if prompt == nil {
 		return ""
 	}
-	promptTemplate := e.Config.TransientPrompt.Template
-	if len(promptTemplate) == 0 {
-		promptTemplate = "{{ .Shell }}> "
+	getTemplate := func(template string) string {
+		if len(template) != 0 {
+			return template
+		}
+		switch promptType { // nolint: exhaustive
+		case Transient:
+			return "{{ .Shell }}> "
+		default:
+			return ""
+		}
 	}
 	tmpl := &template.Text{
-		Template: promptTemplate,
+		Template: getTemplate(prompt.Template),
 		Env:      e.Env,
 	}
-	prompt, err := tmpl.Render()
+	promptText, err := tmpl.Render()
 	if err != nil {
-		prompt = err.Error()
+		promptText = err.Error()
 	}
-	e.Writer.SetColors(e.Config.TransientPrompt.Background, e.Config.TransientPrompt.Foreground)
-	e.Writer.Write(e.Config.TransientPrompt.Background, e.Config.TransientPrompt.Foreground, prompt)
+	e.Writer.SetColors(prompt.Background, prompt.Foreground)
+	e.Writer.Write(prompt.Background, prompt.Foreground, promptText)
 	switch e.Env.Shell() {
 	case zsh:
 		// escape double quotes contained in the prompt
diff --git a/src/engine/init/omp.ps1 b/src/engine/init/omp.ps1
index c11d64b1..a135f3ae 100644
--- a/src/engine/init/omp.ps1
+++ b/src/engine/init/omp.ps1
@@ -3,7 +3,7 @@
 if ($ExecutionContext.SessionState.LanguageMode -ne "ConstrainedLanguage") {
     [console]::InputEncoding = [console]::OutputEncoding = New-Object System.Text.UTF8Encoding
 }
-elseif ($env:POSH_CONSTRAINED_LANGUAGE_MODE -ne $true){
+elseif ($env:POSH_CONSTRAINED_LANGUAGE_MODE -ne $true) {
     Write-Host "[WARNING] ConstrainedLanguage mode detected, unable to set console to UTF-8.
 When using PowerShell in ConstrainedLanguage mode, please set the
 console mode manually to UTF-8. See here for more information:
@@ -210,6 +210,13 @@ function global:Enable-PoshTransientPrompt {
     }
 }
 
+function global:Enable-PoshLineError {
+    $omp = "::OMP::"
+    $validLine = @(&$omp --config="$Env:POSH_THEME" --print-valid 2>&1) -join "`n"
+    $errorLine = @(&$omp --config="$Env:POSH_THEME" --print-error 2>&1) -join "`n"
+    Set-PSReadLineOption -PromptText $validLine, $errorLine
+}
+
 <#
  .SYNOPSIS
      Returns an ansi formatted hyperlink
diff --git a/src/environment/shell.go b/src/environment/shell.go
index 29776017..4b7d99c6 100644
--- a/src/environment/shell.go
+++ b/src/environment/shell.go
@@ -29,10 +29,14 @@ const (
 
 type Args struct {
 	ErrorCode      *int
+	PrintInit      *bool
 	PrintConfig    *bool
-	ConfigFormat   *string
 	PrintShell     *bool
+	PrintTransient *bool
+	PrintValid     *bool
+	PrintError     *bool
 	Config         *string
+	ConfigFormat   *string
 	Shell          *string
 	PWD            *string
 	PSWD           *string
@@ -42,7 +46,6 @@ type Args struct {
 	Millis         *bool
 	Eval           *bool
 	Init           *bool
-	PrintInit      *bool
 	ExportPNG      *bool
 	Author         *string
 	CursorPadding  *int
@@ -51,7 +54,6 @@ type Args struct {
 	BGColor        *string
 	StackCount     *int
 	Command        *string
-	PrintTransient *bool
 	Plain          *bool
 	CachePath      *bool
 	Migrate        *bool
@@ -145,7 +147,7 @@ type Environment interface {
 	Shell() string
 	Platform() string
 	ErrorCode() int
-	PathSeperator() string
+	PathSeparator() string
 	HasFiles(pattern string) bool
 	HasFilesInDir(dir, pattern string) bool
 	HasFolder(folder string) bool
@@ -300,7 +302,7 @@ func (env *ShellEnvironment) Pwd() string {
 func (env *ShellEnvironment) HasFiles(pattern string) bool {
 	defer env.trace(time.Now(), "HasFiles", pattern)
 	cwd := env.Pwd()
-	pattern = cwd + env.PathSeperator() + pattern
+	pattern = cwd + env.PathSeparator() + pattern
 	matches, err := filepath.Glob(pattern)
 	if err != nil {
 		env.log(Error, "HasFiles", err.Error())
@@ -311,7 +313,7 @@ func (env *ShellEnvironment) HasFiles(pattern string) bool {
 
 func (env *ShellEnvironment) HasFilesInDir(dir, pattern string) bool {
 	defer env.trace(time.Now(), "HasFilesInDir", pattern)
-	pattern = dir + env.PathSeperator() + pattern
+	pattern = dir + env.PathSeparator() + pattern
 	matches, err := filepath.Glob(pattern)
 	if err != nil {
 		env.log(Error, "HasFilesInDir", err.Error())
@@ -371,8 +373,8 @@ func (env *ShellEnvironment) FolderList(path string) []string {
 	return folderNames
 }
 
-func (env *ShellEnvironment) PathSeperator() string {
-	defer env.trace(time.Now(), "PathSeperator")
+func (env *ShellEnvironment) PathSeparator() string {
+	defer env.trace(time.Now(), "PathSeparator")
 	return string(os.PathSeparator)
 }
 
@@ -698,7 +700,7 @@ func Base(env Environment, path string) string {
 	}
 	volumeName := filepath.VolumeName(path)
 	// Strip trailing slashes.
-	for len(path) > 0 && string(path[len(path)-1]) == env.PathSeperator() {
+	for len(path) > 0 && string(path[len(path)-1]) == env.PathSeparator() {
 		path = path[0 : len(path)-1]
 	}
 	if volumeName == path {
@@ -708,7 +710,7 @@ func Base(env Environment, path string) string {
 	path = path[len(filepath.VolumeName(path)):]
 	// Find the last element
 	i := len(path) - 1
-	for i >= 0 && string(path[i]) != env.PathSeperator() {
+	for i >= 0 && string(path[i]) != env.PathSeparator() {
 		i--
 	}
 	if i >= 0 {
@@ -716,7 +718,7 @@ func Base(env Environment, path string) string {
 	}
 	// If empty now, it had only slashes.
 	if path == "" {
-		return env.PathSeperator()
+		return env.PathSeparator()
 	}
 	return path
 }
diff --git a/src/main.go b/src/main.go
index f891f12d..91e5af7b 100644
--- a/src/main.go
+++ b/src/main.go
@@ -133,6 +133,14 @@ func main() {
 			"terminal-width",
 			0,
 			"The width of the terminal"),
+		PrintValid: flag.Bool(
+			"print-valid",
+			false,
+			"Print the valid prompt"),
+		PrintError: flag.Bool(
+			"print-error",
+			false,
+			"Print the failed prompt"),
 	}
 	flag.Parse()
 	if *args.Version {
@@ -210,7 +218,15 @@ func main() {
 		return
 	}
 	if *args.PrintTransient {
-		fmt.Print(eng.RenderTransientPrompt())
+		fmt.Print(eng.RenderExtraPrompt(engine.Transient))
+		return
+	}
+	if *args.PrintValid {
+		fmt.Print(eng.RenderExtraPrompt(engine.Valid))
+		return
+	}
+	if *args.PrintError {
+		fmt.Print(eng.RenderExtraPrompt(engine.Error))
 		return
 	}
 	if len(*args.Command) != 0 {
diff --git a/src/mock/environment.go b/src/mock/environment.go
index c7547180..6f03cbf4 100644
--- a/src/mock/environment.go
+++ b/src/mock/environment.go
@@ -51,7 +51,7 @@ func (env *MockedEnvironment) FolderList(path string) []string {
 	return args.Get(0).([]string)
 }
 
-func (env *MockedEnvironment) PathSeperator() string {
+func (env *MockedEnvironment) PathSeparator() string {
 	args := env.Called()
 	return args.String(0)
 }
diff --git a/src/segments/path.go b/src/segments/path.go
index 956e2f19..7f4bb426 100644
--- a/src/segments/path.go
+++ b/src/segments/path.go
@@ -115,7 +115,7 @@ func (pt *Path) Init(props properties.Properties, env environment.Environment) {
 func (pt *Path) getMixedPath() string {
 	var buffer strings.Builder
 	pwd := pt.getPwd()
-	splitted := strings.Split(pwd, pt.env.PathSeperator())
+	splitted := strings.Split(pwd, pt.env.PathSeparator())
 	threshold := int(pt.props.GetFloat64(MixedThreshold, 4))
 	for i, part := range splitted {
 		if part == "" {
@@ -126,7 +126,7 @@ func (pt *Path) getMixedPath() string {
 		if len(part) > threshold && i != 0 && i != len(splitted)-1 {
 			folder = pt.props.GetString(FolderIcon, "..")
 		}
-		separator := pt.props.GetString(FolderSeparatorIcon, pt.env.PathSeperator())
+		separator := pt.props.GetString(FolderSeparatorIcon, pt.env.PathSeparator())
 		if i == 0 {
 			separator = ""
 		}
@@ -142,7 +142,7 @@ func (pt *Path) getAgnosterPath() string {
 	buffer.WriteString(pt.rootLocation())
 	pathDepth := pt.pathDepth(pwd)
 	folderIcon := pt.props.GetString(FolderIcon, "..")
-	separator := pt.props.GetString(FolderSeparatorIcon, pt.env.PathSeperator())
+	separator := pt.props.GetString(FolderSeparatorIcon, pt.env.PathSeparator())
 	for i := 1; i < pathDepth; i++ {
 		buffer.WriteString(fmt.Sprintf("%s%s", separator, folderIcon))
 	}
@@ -154,7 +154,7 @@ func (pt *Path) getAgnosterPath() string {
 
 func (pt *Path) getAgnosterLeftPath() string {
 	pwd := pt.getPwd()
-	separator := pt.env.PathSeperator()
+	separator := pt.env.PathSeparator()
 	pwd = strings.Trim(pwd, separator)
 	splitted := strings.Split(pwd, separator)
 	folderIcon := pt.props.GetString(FolderIcon, "..")
@@ -191,8 +191,8 @@ func (pt *Path) getRelevantLetter(folder string) string {
 func (pt *Path) getLetterPath() string {
 	var buffer strings.Builder
 	pwd := pt.getPwd()
-	splitted := strings.Split(pwd, pt.env.PathSeperator())
-	separator := pt.props.GetString(FolderSeparatorIcon, pt.env.PathSeperator())
+	splitted := strings.Split(pwd, pt.env.PathSeparator())
+	separator := pt.props.GetString(FolderSeparatorIcon, pt.env.PathSeparator())
 	for i := 0; i < len(splitted)-1; i++ {
 		folder := splitted[i]
 		if len(folder) == 0 {
@@ -210,8 +210,8 @@ func (pt *Path) getLetterPath() string {
 func (pt *Path) getUniqueLettersPath() string {
 	var buffer strings.Builder
 	pwd := pt.getPwd()
-	splitted := strings.Split(pwd, pt.env.PathSeperator())
-	separator := pt.props.GetString(FolderSeparatorIcon, pt.env.PathSeperator())
+	splitted := strings.Split(pwd, pt.env.PathSeparator())
+	separator := pt.props.GetString(FolderSeparatorIcon, pt.env.PathSeparator())
 	letters := make(map[string]bool, len(splitted))
 	for i := 0; i < len(splitted)-1; i++ {
 		folder := splitted[i]
@@ -236,7 +236,7 @@ func (pt *Path) getUniqueLettersPath() string {
 
 func (pt *Path) getAgnosterFullPath() string {
 	pwd := pt.getPwd()
-	if len(pwd) > 1 && string(pwd[0]) == pt.env.PathSeperator() {
+	if len(pwd) > 1 && string(pwd[0]) == pt.env.PathSeparator() {
 		pwd = pwd[1:]
 	}
 	return pt.replaceFolderSeparators(pwd)
@@ -252,7 +252,7 @@ func (pt *Path) getAgnosterShortPath() string {
 	if pathDepth <= maxDepth {
 		return pt.getAgnosterFullPath()
 	}
-	pathSeparator := pt.env.PathSeperator()
+	pathSeparator := pt.env.PathSeparator()
 	folderSeparator := pt.props.GetString(FolderSeparatorIcon, pathSeparator)
 	folderIcon := pt.props.GetString(FolderIcon, "..")
 	root := pt.rootLocation()
@@ -341,7 +341,7 @@ func (pt *Path) replaceMappedLocations(pwd string) string {
 }
 
 func (pt *Path) replaceFolderSeparators(pwd string) string {
-	defaultSeparator := pt.env.PathSeperator()
+	defaultSeparator := pt.env.PathSeparator()
 	if pwd == defaultSeparator {
 		return pwd
 	}
@@ -360,14 +360,14 @@ func (pt *Path) inHomeDir(pwd string) bool {
 
 func (pt *Path) rootLocation() string {
 	pwd := pt.getPwd()
-	pwd = strings.TrimPrefix(pwd, pt.env.PathSeperator())
-	splitted := strings.Split(pwd, pt.env.PathSeperator())
+	pwd = strings.TrimPrefix(pwd, pt.env.PathSeparator())
+	splitted := strings.Split(pwd, pt.env.PathSeparator())
 	rootLocation := splitted[0]
 	return rootLocation
 }
 
 func (pt *Path) pathDepth(pwd string) int {
-	splitted := strings.Split(pwd, pt.env.PathSeperator())
+	splitted := strings.Split(pwd, pt.env.PathSeparator())
 	depth := 0
 	for _, part := range splitted {
 		if part != "" {
diff --git a/themes/schema.json b/themes/schema.json
index 4824cf36..3dac20bb 100644
--- a/themes/schema.json
+++ b/themes/schema.json
@@ -64,6 +64,18 @@
       "description": "https://ohmyposh.dev/docs/config-templates",
       "default": ""
     },
+    "extra_prompt": {
+      "type": "object",
+      "default": {},
+      "properties": {
+        "template": {
+          "type": "string",
+          "title": "Prompt Template"
+        },
+        "background": { "$ref": "#/definitions/color" },
+        "foreground": { "$ref": "#/definitions/color" }
+      }
+    },
     "block": {
       "type": "object",
       "description": "https://ohmyposh.dev/docs/config-overview#block",
@@ -2008,7 +2020,7 @@
     "tooltips": {
       "type": "array",
       "title": "Tooltip list, prompt elements to display based on context",
-      "description": "https://ohmyposh.dev/docs/beta#tooltips",
+      "description": "https://ohmyposh.dev/docs/config-tooltips",
       "default": [],
       "items": {
         "allOf": [{ "$ref": "#/definitions/segment" }],
@@ -2025,19 +2037,19 @@
       }
     },
     "transient_prompt": {
-      "type": "object",
-      "title": "Transient Prompt Settings",
-      "description": "https://ohmyposh.dev/docs/beta#transient-prompt",
-      "default": {},
-      "properties": {
-        "template": {
-          "type": "string",
-          "title": "Transient Prompt Template",
-          "default": "{{ .Shell }}> <#f7dc66>{{ .Command }}</>"
-        },
-        "background": { "$ref": "#/definitions/color" },
-        "foreground": { "$ref": "#/definitions/color" }
-      }
+      "$ref": "#/definitions/extra_prompt",
+      "title": "Transient Prompt Setting",
+      "description": "https://ohmyposh.dev/docs/config-transient"
+    },
+    "valid_line": {
+      "$ref": "#/definitions/extra_prompt",
+      "title": "Valid Prompt Setting",
+      "description": "https://ohmyposh.dev/docs/config-prompt-override"
+    },
+    "error_line": {
+      "$ref": "#/definitions/extra_prompt",
+      "title": "Error Prompt Setting",
+      "description": "https://ohmyposh.dev/docs/config-prompt-override"
     },
     "palette": {
       "type": "object",


Test patch:
diff --git a/src/console/title_test.go b/src/console/title_test.go
index 18a10adc..f6af0f0b 100644
--- a/src/console/title_test.go
+++ b/src/console/title_test.go
@@ -16,17 +16,17 @@ func TestGetTitle(t *testing.T) {
 		Root          bool
 		User          string
 		Cwd           string
-		PathSeperator string
+		PathSeparator string
 		ShellName     string
 		Expected      string
 	}{
-		{Style: FolderName, Cwd: "/usr/home", PathSeperator: "/", ShellName: "default", Expected: "\x1b]0;~\a"},
-		{Style: FullPath, Cwd: "/usr/home/jan", PathSeperator: "/", ShellName: "default", Expected: "\x1b]0;~/jan\a"},
+		{Style: FolderName, Cwd: "/usr/home", PathSeparator: "/", ShellName: "default", Expected: "\x1b]0;~\a"},
+		{Style: FullPath, Cwd: "/usr/home/jan", PathSeparator: "/", ShellName: "default", Expected: "\x1b]0;~/jan\a"},
 		{
 			Style:         Template,
 			Template:      "{{.Env.USERDOMAIN}} :: {{.PWD}}{{if .Root}} :: Admin{{end}} :: {{.Shell}}",
 			Cwd:           "C:\\vagrant",
-			PathSeperator: "\\",
+			PathSeparator: "\\",
 			ShellName:     "PowerShell",
 			Root:          true,
 			Expected:      "\x1b]0;MyCompany :: C:\\vagrant :: Admin :: PowerShell\a",
@@ -35,7 +35,7 @@ func TestGetTitle(t *testing.T) {
 			Style:         Template,
 			Template:      "{{.Folder}}{{if .Root}} :: Admin{{end}} :: {{.Shell}}",
 			Cwd:           "C:\\vagrant",
-			PathSeperator: "\\",
+			PathSeparator: "\\",
 			ShellName:     "PowerShell",
 			Expected:      "\x1b]0;vagrant :: PowerShell\a",
 		},
@@ -44,7 +44,7 @@ func TestGetTitle(t *testing.T) {
 			Template:      "{{.UserName}}@{{.HostName}}{{if .Root}} :: Admin{{end}} :: {{.Shell}}",
 			Root:          true,
 			User:          "MyUser",
-			PathSeperator: "\\",
+			PathSeparator: "\\",
 			ShellName:     "PowerShell",
 			Expected:      "\x1b]0;MyUser@MyHost :: Admin :: PowerShell\a",
 		},
@@ -54,7 +54,7 @@ func TestGetTitle(t *testing.T) {
 		env := new(mock.MockedEnvironment)
 		env.On("Pwd").Return(tc.Cwd)
 		env.On("Home").Return("/usr/home")
-		env.On("PathSeperator").Return(tc.PathSeperator)
+		env.On("PathSeparator").Return(tc.PathSeparator)
 		env.On("TemplateCache").Return(&environment.TemplateCache{
 			Env: map[string]string{
 				"USERDOMAIN": "MyCompany",
@@ -86,7 +86,7 @@ func TestGetConsoleTitleIfGethostnameReturnsError(t *testing.T) {
 		Root          bool
 		User          string
 		Cwd           string
-		PathSeperator string
+		PathSeparator string
 		ShellName     string
 		Expected      string
 	}{
@@ -94,7 +94,7 @@ func TestGetConsoleTitleIfGethostnameReturnsError(t *testing.T) {
 			Style:         Template,
 			Template:      "Not using Host only {{.UserName}} and {{.Shell}}",
 			User:          "MyUser",
-			PathSeperator: "\\",
+			PathSeparator: "\\",
 			ShellName:     "PowerShell",
 			Expected:      "\x1b]0;Not using Host only MyUser and PowerShell\a",
 		},
@@ -102,7 +102,7 @@ func TestGetConsoleTitleIfGethostnameReturnsError(t *testing.T) {
 			Style:         Template,
 			Template:      "{{.UserName}}@{{.HostName}} :: {{.Shell}}",
 			User:          "MyUser",
-			PathSeperator: "\\",
+			PathSeparator: "\\",
 			ShellName:     "PowerShell",
 			Expected:      "\x1b]0;MyUser@ :: PowerShell\a",
 		},
diff --git a/src/segments/dotnet_test.go b/src/segments/dotnet_test.go
index c1eaed74..6e7742e9 100644
--- a/src/segments/dotnet_test.go
+++ b/src/segments/dotnet_test.go
@@ -36,7 +36,7 @@ func TestDotnetSegment(t *testing.T) {
 		}
 
 		env.On("HasFiles", "*.cs").Return(true)
-		env.On("PathSeperator").Return("")
+		env.On("PathSeparator").Return("")
 		env.On("Pwd").Return("/usr/home/project")
 		env.On("Home").Return("/usr/home")
 		env.On("TemplateCache").Return(&environment.TemplateCache{
diff --git a/src/segments/path_test.go b/src/segments/path_test.go
index bcdf33cc..f0cb0276 100644
--- a/src/segments/path_test.go
+++ b/src/segments/path_test.go
@@ -75,18 +75,18 @@ func TestRootLocationHome(t *testing.T) {
 		HomePath      string
 		Pswd          string
 		Pwd           string
-		PathSeperator string
+		PathSeparator string
 		HomeIcon      string
 		RegistryIcon  string
 	}{
-		{Expected: "~", HomeIcon: "~", HomePath: "/home/bill/", Pwd: "/home/bill/", PathSeperator: "/"},
-		{Expected: "usr", HomePath: "/home/bill/", Pwd: "/usr/error/what", PathSeperator: "/"},
-		{Expected: "C:", HomePath: "C:\\Users\\Bill", Pwd: "C:\\Program Files\\Go", PathSeperator: "\\"},
-		{Expected: "REG", RegistryIcon: "REG", HomePath: "C:\\Users\\Bill", Pwd: "HKCU:\\Program Files\\Go", PathSeperator: "\\"},
-		{Expected: "~", HomeIcon: "~", HomePath: "C:\\Users\\Bill", Pwd: "Microsoft.PowerShell.Core\\FileSystem::C:\\Users\\Bill", PathSeperator: "\\"},
-		{Expected: "C:", HomePath: "C:\\Users\\Jack", Pwd: "Microsoft.PowerShell.Core\\FileSystem::C:\\Users\\Bill", PathSeperator: "\\"},
-		{Expected: "", HomePath: "C:\\Users\\Jack", Pwd: "", PathSeperator: "\\"},
-		{Expected: "DRIVE:", HomePath: "/home/bill/", Pwd: "/usr/error/what", Pswd: "DRIVE:", PathSeperator: "/"},
+		{Expected: "~", HomeIcon: "~", HomePath: "/home/bill/", Pwd: "/home/bill/", PathSeparator: "/"},
+		{Expected: "usr", HomePath: "/home/bill/", Pwd: "/usr/error/what", PathSeparator: "/"},
+		{Expected: "C:", HomePath: "C:\\Users\\Bill", Pwd: "C:\\Program Files\\Go", PathSeparator: "\\"},
+		{Expected: "REG", RegistryIcon: "REG", HomePath: "C:\\Users\\Bill", Pwd: "HKCU:\\Program Files\\Go", PathSeparator: "\\"},
+		{Expected: "~", HomeIcon: "~", HomePath: "C:\\Users\\Bill", Pwd: "Microsoft.PowerShell.Core\\FileSystem::C:\\Users\\Bill", PathSeparator: "\\"},
+		{Expected: "C:", HomePath: "C:\\Users\\Jack", Pwd: "Microsoft.PowerShell.Core\\FileSystem::C:\\Users\\Bill", PathSeparator: "\\"},
+		{Expected: "", HomePath: "C:\\Users\\Jack", Pwd: "", PathSeparator: "\\"},
+		{Expected: "DRIVE:", HomePath: "/home/bill/", Pwd: "/usr/error/what", Pswd: "DRIVE:", PathSeparator: "/"},
 	}
 	for _, tc := range cases {
 		env := new(mock.MockedEnvironment)
@@ -96,7 +96,7 @@ func TestRootLocationHome(t *testing.T) {
 			PSWD: &tc.Pswd,
 		}
 		env.On("Args").Return(args)
-		env.On("PathSeperator").Return(tc.PathSeperator)
+		env.On("PathSeparator").Return(tc.PathSeparator)
 		env.On("GOOS").Return("")
 		path := &Path{
 			env: env,
@@ -127,7 +127,7 @@ func TestPathDepthMultipleLevelsDeep(t *testing.T) {
 		pwd += levelDir
 	}
 	env := new(mock.MockedEnvironment)
-	env.On("PathSeperator").Return("/")
+	env.On("PathSeparator").Return("/")
 	env.On("getRunteGOOS").Return("")
 	path := &Path{
 		env: env,
@@ -139,7 +139,7 @@ func TestPathDepthMultipleLevelsDeep(t *testing.T) {
 func TestPathDepthZeroLevelsDeep(t *testing.T) {
 	pwd := "/usr/"
 	env := new(mock.MockedEnvironment)
-	env.On("PathSeperator").Return("/")
+	env.On("PathSeparator").Return("/")
 	path := &Path{
 		env: env,
 	}
@@ -150,7 +150,7 @@ func TestPathDepthZeroLevelsDeep(t *testing.T) {
 func TestPathDepthOneLevelDeep(t *testing.T) {
 	pwd := "/usr/location"
 	env := new(mock.MockedEnvironment)
-	env.On("PathSeperator").Return("/")
+	env.On("PathSeparator").Return("/")
 	path := &Path{
 		env: env,
 	}
@@ -164,32 +164,32 @@ func TestAgnosterPathStyles(t *testing.T) {
 		HomePath            string
 		Pswd                string
 		Pwd                 string
-		PathSeperator       string
+		PathSeparator       string
 		HomeIcon            string
 		FolderSeparatorIcon string
 		Style               string
 		GOOS                string
 		MaxDepth            int
 	}{
-		{Style: AgnosterFull, Expected: "usr > location > whatever", HomePath: "/usr/home", Pwd: "/usr/location/whatever", PathSeperator: "/", FolderSeparatorIcon: " > "},
-		{Style: AgnosterShort, Expected: "usr > .. > man", HomePath: "/usr/home", Pwd: "/usr/location/whatever/man", PathSeperator: "/", FolderSeparatorIcon: " > "},
-		{Style: AgnosterShort, Expected: "~ > .. > man", HomePath: "/usr/home", Pwd: "/usr/home/whatever/man", PathSeperator: "/", FolderSeparatorIcon: " > "},
-		{Style: AgnosterShort, Expected: "~ > projects", HomePath: "/usr/home", Pwd: "/usr/home/projects", PathSeperator: "/", FolderSeparatorIcon: " > "},
-		{Style: AgnosterShort, Expected: "C:", HomePath: homeBillWindows, Pwd: "C:", PathSeperator: "\\", FolderSeparatorIcon: " > "},
-		{Style: AgnosterShort, Expected: "/", HomePath: homeBillWindows, Pwd: "/", PathSeperator: "/", FolderSeparatorIcon: " > "},
-		{Style: AgnosterShort, Expected: "foo", HomePath: homeBillWindows, Pwd: "/foo", PathSeperator: "/", FolderSeparatorIcon: " > "},
-
-		{Style: AgnosterShort, Expected: "usr > .. > bar > man", HomePath: "/usr/home", Pwd: "/usr/foo/bar/man", PathSeperator: "/", FolderSeparatorIcon: " > ", MaxDepth: 2},
-		{Style: AgnosterShort, Expected: "usr > foo > bar > man", HomePath: "/usr/home", Pwd: "/usr/foo/bar/man", PathSeperator: "/", FolderSeparatorIcon: " > ", MaxDepth: 3},
-		{Style: AgnosterShort, Expected: "~ > .. > bar > man", HomePath: "/usr/home", Pwd: "/usr/home/foo/bar/man", PathSeperator: "/", FolderSeparatorIcon: " > ", MaxDepth: 2},
-		{Style: AgnosterShort, Expected: "~ > foo > bar > man", HomePath: "/usr/home", Pwd: "/usr/home/foo/bar/man", PathSeperator: "/", FolderSeparatorIcon: " > ", MaxDepth: 3},
+		{Style: AgnosterFull, Expected: "usr > location > whatever", HomePath: "/usr/home", Pwd: "/usr/location/whatever", PathSeparator: "/", FolderSeparatorIcon: " > "},
+		{Style: AgnosterShort, Expected: "usr > .. > man", HomePath: "/usr/home", Pwd: "/usr/location/whatever/man", PathSeparator: "/", FolderSeparatorIcon: " > "},
+		{Style: AgnosterShort, Expected: "~ > .. > man", HomePath: "/usr/home", Pwd: "/usr/home/whatever/man", PathSeparator: "/", FolderSeparatorIcon: " > "},
+		{Style: AgnosterShort, Expected: "~ > projects", HomePath: "/usr/home", Pwd: "/usr/home/projects", PathSeparator: "/", FolderSeparatorIcon: " > "},
+		{Style: AgnosterShort, Expected: "C:", HomePath: homeBillWindows, Pwd: "C:", PathSeparator: "\\", FolderSeparatorIcon: " > "},
+		{Style: AgnosterShort, Expected: "/", HomePath: homeBillWindows, Pwd: "/", PathSeparator: "/", FolderSeparatorIcon: " > "},
+		{Style: AgnosterShort, Expected: "foo", HomePath: homeBillWindows, Pwd: "/foo", PathSeparator: "/", FolderSeparatorIcon: " > "},
+
+		{Style: AgnosterShort, Expected: "usr > .. > bar > man", HomePath: "/usr/home", Pwd: "/usr/foo/bar/man", PathSeparator: "/", FolderSeparatorIcon: " > ", MaxDepth: 2},
+		{Style: AgnosterShort, Expected: "usr > foo > bar > man", HomePath: "/usr/home", Pwd: "/usr/foo/bar/man", PathSeparator: "/", FolderSeparatorIcon: " > ", MaxDepth: 3},
+		{Style: AgnosterShort, Expected: "~ > .. > bar > man", HomePath: "/usr/home", Pwd: "/usr/home/foo/bar/man", PathSeparator: "/", FolderSeparatorIcon: " > ", MaxDepth: 2},
+		{Style: AgnosterShort, Expected: "~ > foo > bar > man", HomePath: "/usr/home", Pwd: "/usr/home/foo/bar/man", PathSeparator: "/", FolderSeparatorIcon: " > ", MaxDepth: 3},
 
 		{
 			Style:               AgnosterShort,
 			Expected:            "C: > .. > bar > man",
 			HomePath:            homeBillWindows,
 			Pwd:                 "C:\\usr\\foo\\bar\\man",
-			PathSeperator:       "\\",
+			PathSeparator:       "\\",
 			FolderSeparatorIcon: " > ",
 			MaxDepth:            2,
 		},
@@ -198,7 +198,7 @@ func TestAgnosterPathStyles(t *testing.T) {
 			Expected:            "C: > .. > foo > bar > man",
 			HomePath:            homeBillWindows,
 			Pwd:                 "C:\\usr\\foo\\bar\\man",
-			PathSeperator:       "\\",
+			PathSeparator:       "\\",
 			FolderSeparatorIcon: " > ",
 			MaxDepth:            3,
 		},
@@ -207,7 +207,7 @@ func TestAgnosterPathStyles(t *testing.T) {
 			Expected:            "~ > .. > bar > man",
 			HomePath:            homeBillWindows,
 			Pwd:                 "C:\\Users\\Bill\\foo\\bar\\man",
-			PathSeperator:       "\\",
+			PathSeparator:       "\\",
 			FolderSeparatorIcon: " > ",
 			MaxDepth:            2,
 		},
@@ -216,36 +216,36 @@ func TestAgnosterPathStyles(t *testing.T) {
 			Expected:            "~ > foo > bar > man",
 			HomePath:            homeBillWindows,
 			Pwd:                 "C:\\Users\\Bill\\foo\\bar\\man",
-			PathSeperator:       "\\",
+			PathSeparator:       "\\",
 			FolderSeparatorIcon: " > ",
 			MaxDepth:            3,
 		},
 
-		{Style: AgnosterFull, Expected: "PSDRIVE: | src", HomePath: homeBillWindows, Pwd: "/foo", Pswd: "PSDRIVE:/src", PathSeperator: "/", FolderSeparatorIcon: " | "},
-		{Style: AgnosterShort, Expected: "PSDRIVE: | .. | init", HomePath: homeBillWindows, Pwd: "/foo", Pswd: "PSDRIVE:/src/init", PathSeperator: "/", FolderSeparatorIcon: " | "},
-
-		{Style: Mixed, Expected: "~ > .. > man", HomePath: "/usr/home", Pwd: "/usr/home/whatever/man", PathSeperator: "/", FolderSeparatorIcon: " > "},
-		{Style: Mixed, Expected: "~ > ab > .. > man", HomePath: "/usr/home", Pwd: "/usr/home/ab/whatever/man", PathSeperator: "/", FolderSeparatorIcon: " > "},
-
-		{Style: Letter, Expected: "~ > a > w > man", HomePath: "/usr/home", Pwd: "/usr/home/ab/whatever/man", PathSeperator: "/", FolderSeparatorIcon: " > "},
-		{Style: Letter, Expected: "u > b > a > w > man", HomePath: "/usr/home", Pwd: "/usr/burp/ab/whatever/man", PathSeperator: "/", FolderSeparatorIcon: " > "},
-		{Style: Letter, Expected: "u > .b > a > w > man", HomePath: "/usr/home", Pwd: "/usr/.burp/ab/whatever/man", PathSeperator: "/", FolderSeparatorIcon: " > "},
-		{Style: Letter, Expected: "u > .b > a > .w > man", HomePath: "/usr/home", Pwd: "/usr/.burp/ab/.whatever/man", PathSeperator: "/", FolderSeparatorIcon: " > "},
-		{Style: Letter, Expected: "u > .b > a > ._w > man", HomePath: "/usr/home", Pwd: "/usr/.burp/ab/._whatever/man", PathSeperator: "/", FolderSeparatorIcon: " > "},
-		{Style: Letter, Expected: "u > .ä > ū > .w > man", HomePath: "/usr/home", Pwd: "/usr/.äufbau/ūmgebung/.whatever/man", PathSeperator: "/", FolderSeparatorIcon: " > "},
-		{Style: Letter, Expected: "u > .b > 1 > .w > man", HomePath: "/usr/home", Pwd: "/usr/.burp/12345/.whatever/man", PathSeperator: "/", FolderSeparatorIcon: " > "},
-		{Style: Letter, Expected: "u > .b > 1 > .w > man", HomePath: "/usr/home", Pwd: "/usr/.burp/12345abc/.whatever/man", PathSeperator: "/", FolderSeparatorIcon: " > "},
-		{Style: Letter, Expected: "u > .b > __p > .w > man", HomePath: "/usr/home", Pwd: "/usr/.burp/__pycache__/.whatever/man", PathSeperator: "/", FolderSeparatorIcon: " > "},
-		{Style: Letter, Expected: "➼ > .w > man", HomePath: "/usr/home", Pwd: "➼/.whatever/man", PathSeperator: "/", FolderSeparatorIcon: " > "},
-		{Style: Letter, Expected: "➼ s > .w > man", HomePath: "/usr/home", Pwd: "➼ something/.whatever/man", PathSeperator: "/", FolderSeparatorIcon: " > "},
-
-		{Style: Unique, Expected: "~ > a > ab > abcd", HomePath: "/usr/home", Pwd: "/usr/home/ab/abc/abcd", PathSeperator: "/", FolderSeparatorIcon: " > "},
-		{Style: Unique, Expected: "~ > a > .a > abcd", HomePath: "/usr/home", Pwd: "/usr/home/ab/.abc/abcd", PathSeperator: "/", FolderSeparatorIcon: " > "},
-		{Style: Unique, Expected: "~ > a > ab > abcd", HomePath: "/usr/home", Pwd: "/usr/home/ab/ab/abcd", PathSeperator: "/", FolderSeparatorIcon: " > "},
+		{Style: AgnosterFull, Expected: "PSDRIVE: | src", HomePath: homeBillWindows, Pwd: "/foo", Pswd: "PSDRIVE:/src", PathSeparator: "/", FolderSeparatorIcon: " | "},
+		{Style: AgnosterShort, Expected: "PSDRIVE: | .. | init", HomePath: homeBillWindows, Pwd: "/foo", Pswd: "PSDRIVE:/src/init", PathSeparator: "/", FolderSeparatorIcon: " | "},
+
+		{Style: Mixed, Expected: "~ > .. > man", HomePath: "/usr/home", Pwd: "/usr/home/whatever/man", PathSeparator: "/", FolderSeparatorIcon: " > "},
+		{Style: Mixed, Expected: "~ > ab > .. > man", HomePath: "/usr/home", Pwd: "/usr/home/ab/whatever/man", PathSeparator: "/", FolderSeparatorIcon: " > "},
+
+		{Style: Letter, Expected: "~ > a > w > man", HomePath: "/usr/home", Pwd: "/usr/home/ab/whatever/man", PathSeparator: "/", FolderSeparatorIcon: " > "},
+		{Style: Letter, Expected: "u > b > a > w > man", HomePath: "/usr/home", Pwd: "/usr/burp/ab/whatever/man", PathSeparator: "/", FolderSeparatorIcon: " > "},
+		{Style: Letter, Expected: "u > .b > a > w > man", HomePath: "/usr/home", Pwd: "/usr/.burp/ab/whatever/man", PathSeparator: "/", FolderSeparatorIcon: " > "},
+		{Style: Letter, Expected: "u > .b > a > .w > man", HomePath: "/usr/home", Pwd: "/usr/.burp/ab/.whatever/man", PathSeparator: "/", FolderSeparatorIcon: " > "},
+		{Style: Letter, Expected: "u > .b > a > ._w > man", HomePath: "/usr/home", Pwd: "/usr/.burp/ab/._whatever/man", PathSeparator: "/", FolderSeparatorIcon: " > "},
+		{Style: Letter, Expected: "u > .ä > ū > .w > man", HomePath: "/usr/home", Pwd: "/usr/.äufbau/ūmgebung/.whatever/man", PathSeparator: "/", FolderSeparatorIcon: " > "},
+		{Style: Letter, Expected: "u > .b > 1 > .w > man", HomePath: "/usr/home", Pwd: "/usr/.burp/12345/.whatever/man", PathSeparator: "/", FolderSeparatorIcon: " > "},
+		{Style: Letter, Expected: "u > .b > 1 > .w > man", HomePath: "/usr/home", Pwd: "/usr/.burp/12345abc/.whatever/man", PathSeparator: "/", FolderSeparatorIcon: " > "},
+		{Style: Letter, Expected: "u > .b > __p > .w > man", HomePath: "/usr/home", Pwd: "/usr/.burp/__pycache__/.whatever/man", PathSeparator: "/", FolderSeparatorIcon: " > "},
+		{Style: Letter, Expected: "➼ > .w > man", HomePath: "/usr/home", Pwd: "➼/.whatever/man", PathSeparator: "/", FolderSeparatorIcon: " > "},
+		{Style: Letter, Expected: "➼ s > .w > man", HomePath: "/usr/home", Pwd: "➼ something/.whatever/man", PathSeparator: "/", FolderSeparatorIcon: " > "},
+
+		{Style: Unique, Expected: "~ > a > ab > abcd", HomePath: "/usr/home", Pwd: "/usr/home/ab/abc/abcd", PathSeparator: "/", FolderSeparatorIcon: " > "},
+		{Style: Unique, Expected: "~ > a > .a > abcd", HomePath: "/usr/home", Pwd: "/usr/home/ab/.abc/abcd", PathSeparator: "/", FolderSeparatorIcon: " > "},
+		{Style: Unique, Expected: "~ > a > ab > abcd", HomePath: "/usr/home", Pwd: "/usr/home/ab/ab/abcd", PathSeparator: "/", FolderSeparatorIcon: " > "},
 	}
 	for _, tc := range cases {
 		env := new(mock.MockedEnvironment)
-		env.On("PathSeperator").Return(tc.PathSeperator)
+		env.On("PathSeparator").Return(tc.PathSeparator)
 		env.On("Home").Return(tc.HomePath)
 		env.On("Pwd").Return(tc.Pwd)
 		env.On("GOOS").Return(tc.GOOS)
@@ -366,7 +366,7 @@ func TestGetFullPath(t *testing.T) {
 		if len(tc.PathSeparator) == 0 {
 			tc.PathSeparator = "/"
 		}
-		env.On("PathSeperator").Return(tc.PathSeparator)
+		env.On("PathSeparator").Return(tc.PathSeparator)
 		env.On("Home").Return("/usr/home")
 		env.On("Pwd").Return(tc.Pwd)
 		env.On("GOOS").Return(tc.GOOS)
@@ -417,7 +417,7 @@ func TestGetFullPathCustomMappedLocations(t *testing.T) {
 
 	for _, tc := range cases {
 		env := new(mock.MockedEnvironment)
-		env.On("PathSeperator").Return("/")
+		env.On("PathSeparator").Return("/")
 		env.On("Home").Return("/usr/home")
 		env.On("Pwd").Return(tc.Pwd)
 		env.On("GOOS").Return("")
@@ -468,7 +468,7 @@ func TestNormalizePath(t *testing.T) {
 func TestGetFolderPathCustomMappedLocations(t *testing.T) {
 	pwd := "/a/b/c/d"
 	env := new(mock.MockedEnvironment)
-	env.On("PathSeperator").Return("/")
+	env.On("PathSeparator").Return("/")
 	env.On("Home").Return("/usr/home")
 	env.On("Pwd").Return(pwd)
 	env.On("GOOS").Return("")
@@ -516,7 +516,7 @@ func TestAgnosterPath(t *testing.T) { // nolint:dupl
 	for _, tc := range cases {
 		env := new(mock.MockedEnvironment)
 		env.On("Home").Return(tc.Home)
-		env.On("PathSeperator").Return(tc.PathSeparator)
+		env.On("PathSeparator").Return(tc.PathSeparator)
 		env.On("Pwd").Return(tc.PWD)
 		env.On("GOOS").Return("")
 		args := &environment.Args{
@@ -564,7 +564,7 @@ func TestAgnosterLeftPath(t *testing.T) { // nolint:dupl
 	for _, tc := range cases {
 		env := new(mock.MockedEnvironment)
 		env.On("Home").Return(tc.Home)
-		env.On("PathSeperator").Return(tc.PathSeparator)
+		env.On("PathSeparator").Return(tc.PathSeparator)
 		env.On("Pwd").Return(tc.PWD)
 		env.On("GOOS").Return("")
 		args := &environment.Args{
@@ -611,7 +611,7 @@ func TestGetPwd(t *testing.T) {
 
 	for _, tc := range cases {
 		env := new(mock.MockedEnvironment)
-		env.On("PathSeperator").Return("/")
+		env.On("PathSeparator").Return("/")
 		env.On("Home").Return("/usr/home")
 		env.On("Pwd").Return(tc.Pwd)
 		env.On("GOOS").Return("")
diff --git a/src/segments/python_test.go b/src/segments/python_test.go
index 4ed00254..4dd2a16b 100644
--- a/src/segments/python_test.go
+++ b/src/segments/python_test.go
@@ -52,7 +52,7 @@ func TestPythonTemplate(t *testing.T) {
 		env.On("Getenv", "CONDA_ENV_PATH").Return(tc.VirtualEnvName)
 		env.On("Getenv", "CONDA_DEFAULT_ENV").Return(tc.VirtualEnvName)
 		env.On("Getenv", "PYENV_VERSION").Return(tc.VirtualEnvName)
-		env.On("PathSeperator").Return("")
+		env.On("PathSeparator").Return("")
 		env.On("Pwd").Return("/usr/home/project")
 		env.On("Home").Return("/usr/home")
 		props := properties.Map{
@@ -80,7 +80,7 @@ func TestPythonPythonInContext(t *testing.T) {
 
 	for _, tc := range cases {
 		env := new(mock.MockedEnvironment)
-		env.On("PathSeperator").Return("")
+		env.On("PathSeparator").Return("")
 		env.On("Getenv", "VIRTUAL_ENV").Return(tc.VirtualEnvName)
 		env.On("Getenv", "CONDA_ENV_PATH").Return("")
 		env.On("Getenv", "CONDA_DEFAULT_ENV").Return("")
diff --git a/src/segments/text_test.go b/src/segments/text_test.go
index a091c698..040ce583 100644
--- a/src/segments/text_test.go
+++ b/src/segments/text_test.go
@@ -27,7 +27,7 @@ func TestTextSegment(t *testing.T) {
 
 	for _, tc := range cases {
 		env := new(mock.MockedEnvironment)
-		env.On("PathSeperator").Return("/")
+		env.On("PathSeparator").Return("/")
 		env.On("TemplateCache").Return(&environment.TemplateCache{
 			UserName: "Posh",
 			Env: map[string]string{