Repository: JanDeDobbeleer/oh-my-posh
Pull request #6319 (2025-03-29 19:45:41)

next
### 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

- **chore(log): add cache logging**
- **fix(pwsh): set upgrade_check only during upgrade process**

<!---

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/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json
index b233a653..58224998 100644
--- a/.devcontainer/devcontainer.json
+++ b/.devcontainer/devcontainer.json
@@ -58,7 +58,7 @@
           }
         },
         "terminal.integrated.defaultProfile.linux": "pwsh",
-        "terminal.integrated.defaultProfile.windows": "pwsh",
+        "terminal.integrated.defaultProfile.windows": "PowerShell",
         "terminal.integrated.defaultProfile.osx": "pwsh",
         "terminal.integrated.shellIntegration.enabled": false,
         "tasks.statusbar.default.hide": true
diff --git a/.github/workflows/code.yml b/.github/workflows/code.yml
index d886577a..abc0c3dc 100644
--- a/.github/workflows/code.yml
+++ b/.github/workflows/code.yml
@@ -24,7 +24,7 @@ jobs:
     - name: Install Go 🗳
       uses: ./.github/workflows/composite/bootstrap-go
     - name: Golang CI
-      uses: golangci/golangci-lint-action@55c2c1448f86e01eaae002a5a3a9624417608d84
+      uses: golangci/golangci-lint-action@1481404843c368bc19ca9406f87d6e0fc97bdcfd
       with:
         working-directory: src
     - name: Fieldalignment
diff --git a/src/.golangci.yml b/src/.golangci.yml
index dd429748..5fb57bf6 100644
--- a/src/.golangci.yml
+++ b/src/.golangci.yml
@@ -1,45 +1,61 @@
+version: "2"
 run:
-  timeout: 10m
   allow-parallel-runners: true
 linters:
-  disable-all: true
+  default: none
   enable:
     - bodyclose
+    - copyloopvar
     - dupl
     - errcheck
     - exhaustive
     - goconst
     - gocritic
     - gocyclo
-    - gofmt
-    - goimports
-    - revive
     - goprintffuncname
-    - gosimple
     - govet
     - ineffassign
+    - lll
     - misspell
     - nakedret
     - noctx
     - nolintlint
+    - revive
     - rowserrcheck
-    - copyloopvar
     - staticcheck
-    - typecheck
     - unconvert
     - unparam
     - unused
     - whitespace
-    - lll
-linters-settings:
-  gocritic:
-    enabled-tags:
-      - diagnostic
-      # - experimental
-      - opinionated
-      - performance
-      - style
-    disabled-tags:
-      - experimental
-  lll:
-    line-length: 180
+  settings:
+    gocritic:
+      enabled-tags:
+        - diagnostic
+        - opinionated
+        - performance
+        - style
+      disabled-tags:
+        - experimental
+    lll:
+      line-length: 180
+  exclusions:
+    generated: lax
+    presets:
+      - comments
+      - common-false-positives
+      - legacy
+      - std-error-handling
+    paths:
+      - third_party$
+      - builtin$
+      - examples$
+formatters:
+  enable:
+    - gofmt
+    - goimports
+  exclusions:
+    generated: lax
+    paths:
+      - third_party$
+      - builtin$
+      - examples$
diff --git a/src/cache/file.go b/src/cache/file.go
index 37cc018a..0087863a 100644
--- a/src/cache/file.go
+++ b/src/cache/file.go
@@ -66,13 +66,16 @@ func (fc *File) Close() {
 func (fc *File) Get(key string) (string, bool) {
 	val, found := fc.cache.Get(key)
 	if !found {
+		log.Debug("cache key not found:", key)
 		return "", false
 	}
 
 	if co, ok := val.(*Entry); ok {
+		log.Debug("getting cache key:", key, "with value:", co.Value)
 		return co.Value, true
 	}
 
+	log.Debug("unable to parse cache key:", key)
 	return "", false
 }
 
@@ -84,6 +87,8 @@ func (fc *File) Set(key, value string, duration Duration) {
 		return
 	}
 
+	log.Debug("setting cache key:", key, "with duration:", string(duration))
+
 	fc.cache.Set(key, &Entry{
 		Value:     value,
 		Timestamp: time.Now().Unix(),
@@ -95,6 +100,7 @@ func (fc *File) Set(key, value string, duration Duration) {
 
 // delete the key from the cache
 func (fc *File) Delete(key string) {
+	log.Debug("deleting cache key:", key)
 	fc.cache.Delete(key)
 	fc.dirty = true
 }
diff --git a/src/cli/root.go b/src/cli/root.go
index c5b7e044..9b617682 100644
--- a/src/cli/root.go
+++ b/src/cli/root.go
@@ -61,7 +61,8 @@ on getting started, have a look at the docs at https://ohmyposh.dev`,
 		}
 
 		timestamp := time.Now().Format("20060102T150405.000")
-		filename := fmt.Sprintf("%s-%s-%s.log", timestamp, cmd.Name(), strings.Join(args, "-"))
+		cli := append([]string{cmd.Name()}, args...)
+		filename := fmt.Sprintf("%s-%s.log", timestamp, strings.Join(cli, "-"))
 
 		home, err := os.UserHomeDir()
 		if err != nil {
diff --git a/src/cli/upgrade.go b/src/cli/upgrade.go
index 4241a8f5..ede7f5a3 100644
--- a/src/cli/upgrade.go
+++ b/src/cli/upgrade.go
@@ -74,6 +74,9 @@ var upgradeCmd = &cobra.Command{
 		cfg := config.Load(configFile, sh, false)
 		cfg.Upgrade.Cache = env.Cache()
 
+		// always reset the cache key so we respect the interval no matter what the outcome
+		defer env.Cache().Set(upgrade.CACHEKEY, "", cfg.Upgrade.Interval)
+
 		latest, err := cfg.Upgrade.Latest()
 		if err != nil {
 			log.Debug("failed to get latest version")
diff --git a/src/config/config.go b/src/config/config.go
index 340b8830..f6132ec7 100644
--- a/src/config/config.go
+++ b/src/config/config.go
@@ -161,9 +161,6 @@ func (cfg *Config) UpgradeFeatures(env runtime.Environment) shell.Features {
 		return feats
 	}
 
-	// always reset the cache key so we respect the interval no matter what the outcome
-	env.Cache().Set(upgrade.CACHEKEY, "", cfg.Upgrade.Interval)
-
 	autoUpgrade := cfg.Upgrade.Auto
 	if _, OK := env.Cache().Get(AUTOUPGRADE); OK {
 		log.Debug("auto upgrade key found")
@@ -186,7 +183,5 @@ func (cfg *Config) UpgradeFeatures(env runtime.Environment) shell.Features {
 		feats = append(feats, shell.Upgrade)
 	}
 
-	log.Debugf("upgrade features: %v", feats)
-
 	return feats
 }
diff --git a/src/config/load.go b/src/config/load.go
index a30b6c2a..33b0b2af 100644
--- a/src/config/load.go
+++ b/src/config/load.go
@@ -4,7 +4,6 @@ import (
 	"bytes"
 	"fmt"
 	"os"
-	stdOS "os"
 	"path/filepath"
 	"runtime"
 	"strings"
@@ -128,7 +127,7 @@ func loadConfig(configFile string) *Config {
 	cfg.origin = configFile
 	cfg.Format = strings.TrimPrefix(filepath.Ext(configFile), ".")
 
-	data, err := stdOS.ReadFile(configFile)
+	data, err := os.ReadFile(configFile)
 	if err != nil {
 		log.Error(err)
 		return Default(true)
diff --git a/src/font/download.go b/src/font/download.go
index 8d3ebfbd..d67f3072 100644
--- a/src/font/download.go
+++ b/src/font/download.go
@@ -81,7 +81,7 @@ func getRemoteFile(location string) (data []byte, err error) {
 	defer resp.Body.Close()
 
 	if resp.StatusCode != httplib.StatusOK {
-		return data, fmt.Errorf("Failed to download zip file: %s\n→ %s", resp.Status, location)
+		return data, fmt.Errorf("failed to download zip file: %s\n→ %s", resp.Status, location)
 	}
 
 	data, err = io.ReadAll(resp.Body)
diff --git a/src/image/image.go b/src/image/image.go
index 10c42843..7ae0c46b 100644
--- a/src/image/image.go
+++ b/src/image/image.go
@@ -513,7 +513,7 @@ func (ir *Renderer) SavePNG() error {
 	}
 
 	// Apply the actual text into the prepared content area of the window
-	var x, y float64 = xOffset + paddingX, yOffset + paddingY + titleOffset + ir.fontHeight()
+	var x, y = xOffset + paddingX, yOffset + paddingY + titleOffset + ir.fontHeight()
 
 	for len(ir.AnsiString) != 0 {
 		if !ir.shouldPrint() {
diff --git a/src/runtime/battery/battery_darwin.go b/src/runtime/battery/battery_darwin.go
index 63bba524..083108c3 100644
--- a/src/runtime/battery/battery_darwin.go
+++ b/src/runtime/battery/battery_darwin.go
@@ -31,14 +31,13 @@ func mapMostLogicalState(state string) State {
 func parseBatteryOutput(output string) (*Info, error) {
 	matches := regex.FindNamedRegexMatch(`(?P<PERCENTAGE>[0-9]{1,3})%; (?P<STATE>[a-zA-Z\s]+);`, output)
 	if len(matches) != 2 {
-		msg := "Unable to find battery state based on output"
-		return nil, errors.New(msg)
+		return nil, errors.New("unable to find battery state based on output")
 	}
 
 	var percentage int
 	var err error
 	if percentage, err = strconv.Atoi(matches["PERCENTAGE"]); err != nil {
-		return nil, errors.New("Unable to parse battery percentage")
+		return nil, errors.New("unable to parse battery percentage")
 	}
 
 	// sometimes it reports discharging when at 100, so let's force it to Full
diff --git a/src/runtime/battery/battery_linux.go b/src/runtime/battery/battery_linux.go
index a2244d8a..295d6743 100644
--- a/src/runtime/battery/battery_linux.go
+++ b/src/runtime/battery/battery_linux.go
@@ -38,7 +38,8 @@ func newState(name string) (State, error) {
 			return State(i), nil
 		}
 	}
-	return Unknown, fmt.Errorf("Invalid state `%s`", name)
+
+	return Unknown, fmt.Errorf("invalid state `%s`", name)
 }
 
 func readFloat(path, filename string) (float64, error) {
@@ -46,13 +47,16 @@ func readFloat(path, filename string) (float64, error) {
 	if err != nil {
 		return 0, err
 	}
+
 	if len(str) == 0 {
 		return 0, ErrNotFound
 	}
+
 	num, err := strconv.ParseFloat(string(str[:len(str)-1]), 64)
 	if err != nil {
 		return 0, err
 	}
+
 	return num / 1000, nil // Convert micro->milli
 }
 
@@ -61,6 +65,7 @@ func readAmp(path, filename string, volts float64) (float64, error) {
 	if err != nil {
 		return 0, err
 	}
+
 	return val * volts, nil
 }
 
diff --git a/src/runtime/battery/battery_netbsd.go b/src/runtime/battery/battery_netbsd.go
index d083c6fa..0fb776ec 100644
--- a/src/runtime/battery/battery_netbsd.go
+++ b/src/runtime/battery/battery_netbsd.go
@@ -15,7 +15,7 @@ func Get() (*Info, error) {
 	}
 	percentage, err := strconv.Atoi(strings.TrimSpace(output))
 	if err != nil {
-		return nil, errors.New("Unable to parse battery percentage")
+		return nil, errors.New("unable to parse battery percentage")
 	}
 	return &Info{
 		Percentage: percentage,
diff --git a/src/runtime/battery/battery_openandfreebsd.go b/src/runtime/battery/battery_openandfreebsd.go
index fe192cd2..42bb43ae 100644
--- a/src/runtime/battery/battery_openandfreebsd.go
+++ b/src/runtime/battery/battery_openandfreebsd.go
@@ -27,7 +27,7 @@ func mapMostLogicalState(state string) State {
 func parseBatteryOutput(apm_percentage string, apm_status string) (*Info, error) {
 	percentage, err := strconv.Atoi(strings.TrimSpace(apm_percentage))
 	if err != nil {
-		return nil, errors.New("Unable to parse battery percentage")
+		return nil, errors.New("unable to parse battery percentage")
 	}
 
 	if percentage == 100 {
diff --git a/src/runtime/battery/battery_windows.go b/src/runtime/battery/battery_windows.go
index a5d4b294..9c88f945 100644
--- a/src/runtime/battery/battery_windows.go
+++ b/src/runtime/battery/battery_windows.go
@@ -86,7 +86,7 @@ var guidDeviceBattery = guid{
 
 func uint32ToFloat64(num uint32) (float64, error) {
 	if num == 0xffffffff { // BATTERY_UNKNOWN_CAPACITY
-		return 0, errors.New("Unknown value received")
+		return 0, errors.New("unknown value received")
 	}
 	return float64(num), nil
 }
diff --git a/src/runtime/battery/errors.go b/src/runtime/battery/errors.go
index 7dd0fd48..0333f6f5 100644
--- a/src/runtime/battery/errors.go
+++ b/src/runtime/battery/errors.go
@@ -23,7 +23,7 @@ package battery
 
 import "fmt"
 
-var ErrNotFound = fmt.Errorf("Not found")
+var ErrNotFound = fmt.Errorf("not found")
 
 type Errors []error
 
diff --git a/src/runtime/networks_windows.go b/src/runtime/networks_windows.go
index 70a6b024..329d42de 100644
--- a/src/runtime/networks_windows.go
+++ b/src/runtime/networks_windows.go
@@ -239,7 +239,7 @@ func (term *Terminal) wifiNetwork() (*Connection, error) {
 		return term.parseNetworkInterface(network, phClientHandle)
 	}
 
-	return nil, errors.New("Not connected")
+	return nil, errors.New("not connected")
 }
 
 func (term *Terminal) parseNetworkInterface(network *WLAN_INTERFACE_INFO, clientHandle uint32) (*Connection, error) {
diff --git a/src/runtime/terminal_darwin.go b/src/runtime/terminal_darwin.go
index 0e434e0d..fcedf290 100644
--- a/src/runtime/terminal_darwin.go
+++ b/src/runtime/terminal_darwin.go
@@ -34,7 +34,7 @@ func mapMostLogicalState(state string) battery.State {
 func (term *Terminal) parseBatteryOutput(output string) (*battery.Info, error) {
 	matches := regex.FindNamedRegexMatch(`(?P<PERCENTAGE>[0-9]{1,3})%; (?P<STATE>[a-zA-Z\s]+);`, output)
 	if len(matches) != 2 {
-		err := errors.New("Unable to find battery state based on output")
+		err := errors.New("unable to find battery state based on output")
 		log.Error(err)
 		return nil, err
 	}
@@ -42,7 +42,7 @@ func (term *Terminal) parseBatteryOutput(output string) (*battery.Info, error) {
 	var err error
 	if percentage, err = strconv.Atoi(matches["PERCENTAGE"]); err != nil {
 		log.Error(err)
-		return nil, errors.New("Unable to parse battery percentage")
+		return nil, errors.New("unable to parse battery percentage")
 	}
 	return &battery.Info{
 		Percentage: percentage,
@@ -58,7 +58,7 @@ func (term *Terminal) BatteryState() (*battery.Info, error) {
 		return nil, err
 	}
 	if !strings.Contains(output, "Battery") {
-		return nil, errors.New("No battery found")
+		return nil, errors.New("no battery found")
 	}
 	return term.parseBatteryOutput(output)
 }
diff --git a/src/runtime/terminal_windows.go b/src/runtime/terminal_windows.go
index 0330777a..6a4d146a 100644
--- a/src/runtime/terminal_windows.go
+++ b/src/runtime/terminal_windows.go
@@ -220,7 +220,7 @@ func (term *Terminal) Connection(connectionType ConnectionType) (*Connection, er
 	if term.networks == nil {
 		networks := term.getConnections()
 		if len(networks) == 0 {
-			return nil, errors.New("No connections found")
+			return nil, errors.New("no connections found")
 		}
 		term.networks = networks
 	}
@@ -231,6 +231,6 @@ func (term *Terminal) Connection(connectionType ConnectionType) (*Connection, er
 		}
 	}
 
-	log.Error(fmt.Errorf("Network type '%s' not found", connectionType))
+	log.Error(fmt.Errorf("network type '%s' not found", connectionType))
 	return nil, &NotImplemented{}
 }
diff --git a/src/segments/battery.go b/src/segments/battery.go
index 4b886a88..dd610e27 100644
--- a/src/segments/battery.go
+++ b/src/segments/battery.go
@@ -42,11 +42,11 @@ func (b *Battery) Enabled() bool {
 	b.Info = *info
 
 	// case on computer without batteries(no error, empty array)
-	if err == nil && b.Info.Percentage == 0 {
+	if err == nil && b.Percentage == 0 {
 		return false
 	}
 
-	switch b.Info.State {
+	switch b.State {
 	case battery.Discharging:
 		b.Icon = b.props.GetString(DischargingIcon, "")
 	case battery.NotCharging:
diff --git a/src/segments/brewfather.go b/src/segments/brewfather.go
index 59887638..931b27b6 100644
--- a/src/segments/brewfather.go
+++ b/src/segments/brewfather.go
@@ -95,8 +95,8 @@ func (bf *Brewfather) Enabled() bool {
 	}
 	bf.Batch = *data
 
-	if bf.Batch.Reading != nil {
-		readingDate := time.UnixMilli(bf.Batch.Reading.Time)
+	if bf.Reading != nil {
+		readingDate := time.UnixMilli(bf.Reading.Time)
 		bf.ReadingAge = int(time.Since(readingDate).Hours())
 	} else {
 		bf.ReadingAge = -1
@@ -105,10 +105,10 @@ func (bf *Brewfather) Enabled() bool {
 	bf.TemperatureTrendIcon = bf.getTrendIcon(bf.TemperatureTrend)
 	bf.StatusIcon = bf.getBatchStatusIcon(data.Status)
 
-	fermStartDate := time.UnixMilli(bf.Batch.FermentStartDate)
-	bottlingDate := time.UnixMilli(bf.Batch.BottlingDate)
+	fermStartDate := time.UnixMilli(bf.FermentStartDate)
+	bottlingDate := time.UnixMilli(bf.BottlingDate)
 
-	switch bf.Batch.Status {
+	switch bf.Status {
 	case BFStatusFermenting:
 		// in the fermenter now, so relative to today.
 		bf.DaysFermenting = uint(time.Since(fermStartDate).Hours() / 24)
diff --git a/src/segments/dotnet.go b/src/segments/dotnet.go
index c6ba9ab2..0f93abb0 100644
--- a/src/segments/dotnet.go
+++ b/src/segments/dotnet.go
@@ -42,6 +42,6 @@ func (d *Dotnet) Enabled() bool {
 	if !enabled {
 		return false
 	}
-	d.Unsupported = d.language.exitCode == constants.DotnetExitCode
+	d.Unsupported = d.exitCode == constants.DotnetExitCode
 	return true
 }
diff --git a/src/segments/golang.go b/src/segments/golang.go
index 2cc6d944..b3228b6f 100644
--- a/src/segments/golang.go
+++ b/src/segments/golang.go
@@ -54,12 +54,12 @@ func (g *Golang) getVersion() (string, error) {
 }
 
 func (g *Golang) parseModFile() (string, error) {
-	gomod, err := g.language.env.HasParentFilePath("go.mod", false)
+	gomod, err := g.env.HasParentFilePath("go.mod", false)
 	if err != nil {
 		return "", err
 	}
 
-	contents := g.language.env.FileContent(gomod.Path)
+	contents := g.env.FileContent(gomod.Path)
 	file, err := modfile.Parse(gomod.Path, []byte(contents), nil)
 	if err != nil {
 		return "", err
@@ -74,12 +74,12 @@ func (g *Golang) parseModFile() (string, error) {
 }
 
 func (g *Golang) parseWorkFile() (string, error) {
-	goWork, err := g.language.env.HasParentFilePath("go.work", false)
+	goWork, err := g.env.HasParentFilePath("go.work", false)
 	if err != nil {
 		return "", err
 	}
 
-	contents := g.language.env.FileContent(goWork.Path)
+	contents := g.env.FileContent(goWork.Path)
 	version := regex.FindStringMatch(`go (\d(\.\d{1,2})?(\.\d{1,2})?)`, contents, 1)
 	if len(version) > 0 {
 		return version, nil
diff --git a/src/segments/haskell.go b/src/segments/haskell.go
index 0ec9dcb0..4c4a6502 100644
--- a/src/segments/haskell.go
+++ b/src/segments/haskell.go
@@ -38,12 +38,12 @@ func (h *Haskell) Enabled() bool {
 
 	switch h.props.GetString(StackGhcMode, "never") {
 	case "always":
-		h.language.commands = []*cmd{stackGhcCmd}
+		h.commands = []*cmd{stackGhcCmd}
 		h.StackGhc = true
 	case "package":
-		_, err := h.language.env.HasParentFilePath("stack.yaml", false)
+		_, err := h.env.HasParentFilePath("stack.yaml", false)
 		if err == nil {
-			h.language.commands = []*cmd{stackGhcCmd}
+			h.commands = []*cmd{stackGhcCmd}
 			h.StackGhc = true
 		}
 	}
diff --git a/src/segments/language.go b/src/segments/language.go
index d4e30bfe..7953b894 100644
--- a/src/segments/language.go
+++ b/src/segments/language.go
@@ -240,7 +240,7 @@ func (l *language) setVersion() error {
 		}
 
 		l.buildVersionURL()
-		l.version.Executable = command.executable
+		l.Executable = command.executable
 
 		if marchalled, err := json.Marshal(l.version); err == nil {
 			duration := l.props.GetString(properties.CacheDuration, string(cache.NONE))
@@ -314,7 +314,7 @@ func (l *language) buildVersionURL() {
 		return
 	}
 
-	l.version.URL = url
+	l.URL = url
 }
 
 func (l *language) hasNodePackage(name string) bool {
diff --git a/src/segments/lastfm.go b/src/segments/lastfm.go
index 818f3c37..ec2aa67a 100644
--- a/src/segments/lastfm.go
+++ b/src/segments/lastfm.go
@@ -95,7 +95,7 @@ func (d *LastFM) setStatus() error {
 	}
 
 	if len(q.TracksInfo.Tracks) == 0 {
-		return errors.New("No data found")
+		return errors.New("no data found")
 	}
 
 	track := q.TracksInfo.Tracks[0]
@@ -104,10 +104,7 @@ func (d *LastFM) setStatus() error {
 	d.Track = track.Name
 	d.Full = fmt.Sprintf("%s - %s", d.Artist, d.Track)
 
-	isPlaying := false
-	if track.Info != nil && track.Info.IsPlaying != nil && *track.Info.IsPlaying == "true" {
-		isPlaying = true
-	}
+	isPlaying := track.Info != nil && track.Info.IsPlaying != nil && *track.Info.IsPlaying == "true"
 
 	if isPlaying {
 		d.Icon = d.props.GetString(PlayingIcon, "\uE602 ")
diff --git a/src/segments/mojo.go b/src/segments/mojo.go
index b33f4c8e..acb105e2 100644
--- a/src/segments/mojo.go
+++ b/src/segments/mojo.go
@@ -32,12 +32,13 @@ func (m *Mojo) Enabled() bool {
 }
 
 func (m *Mojo) loadContext() {
-	if !m.language.props.GetBool(FetchVirtualEnv, true) {
+	if !m.props.GetBool(FetchVirtualEnv, true) {
 		return
 	}
+
 	// Magic, the official package manager and virtual env manager,
 	// is built on top of pixi: https://github.com/prefix-dev/pixi
-	venv := m.language.env.Getenv("PIXI_ENVIRONMENT_NAME")
+	venv := m.env.Getenv("PIXI_ENVIRONMENT_NAME")
 	if len(venv) > 0 && m.canUseVenvName(venv) {
 		m.Venv = venv
 	}
@@ -49,9 +50,11 @@ func (m *Mojo) inContext() bool {
 
 func (m *Mojo) canUseVenvName(name string) bool {
 	defaultNames := []string{"default"}
-	if m.language.props.GetBool(properties.DisplayDefault, true) ||
+
+	if m.props.GetBool(properties.DisplayDefault, true) ||
 		!slices.Contains(defaultNames, name) {
 		return true
 	}
+
 	return false
 }
diff --git a/src/segments/nbgv.go b/src/segments/nbgv.go
index d95cf602..7c2aeffd 100644
--- a/src/segments/nbgv.go
+++ b/src/segments/nbgv.go
@@ -30,14 +30,18 @@ func (n *Nbgv) Enabled() bool {
 	if !n.env.HasCommand(nbgv) {
 		return false
 	}
+
 	response, err := n.env.RunCommand(nbgv, "get-version", "--format=json")
 	if err != nil {
 		return false
 	}
+
 	n.VersionInfo = VersionInfo{}
 	err = json.Unmarshal([]byte(response), &n.VersionInfo)
+
 	if err != nil {
 		return false
 	}
-	return n.VersionInfo.VersionFileFound
+
+	return n.VersionFileFound
 }
diff --git a/src/segments/node.go b/src/segments/node.go
index 953b6fa9..e2f6caab 100644
--- a/src/segments/node.go
+++ b/src/segments/node.go
@@ -47,30 +47,30 @@ func (n *Node) Enabled() bool {
 }
 
 func (n *Node) loadContext() {
-	if !n.language.props.GetBool(FetchPackageManager, false) {
+	if !n.props.GetBool(FetchPackageManager, false) {
 		return
 	}
 
-	if n.language.env.HasFiles("pnpm-lock.yaml") {
+	if n.env.HasFiles("pnpm-lock.yaml") {
 		n.PackageManagerName = "pnpm"
-		n.PackageManagerIcon = n.language.props.GetString(PnpmIcon, "\U000F02C1")
+		n.PackageManagerIcon = n.props.GetString(PnpmIcon, "\U000F02C1")
 		return
 	}
 
-	if n.language.env.HasFiles("yarn.lock") {
+	if n.env.HasFiles("yarn.lock") {
 		n.PackageManagerName = "yarn"
-		n.PackageManagerIcon = n.language.props.GetString(YarnIcon, "\U000F011B")
+		n.PackageManagerIcon = n.props.GetString(YarnIcon, "\U000F011B")
 		return
 	}
 
-	if n.language.env.HasFiles("package-lock.json") || n.language.env.HasFiles("package.json") {
+	if n.env.HasFiles("package-lock.json") || n.env.HasFiles("package.json") {
 		n.PackageManagerName = "npm"
-		n.PackageManagerIcon = n.language.props.GetString(NPMIcon, "\uE71E")
+		n.PackageManagerIcon = n.props.GetString(NPMIcon, "\uE71E")
 	}
 }
 
 func (n *Node) matchesVersionFile() (string, bool) {
-	fileVersion := n.language.env.FileContent(".nvmrc")
+	fileVersion := n.env.FileContent(".nvmrc")
 	if len(fileVersion) == 0 {
 		return "", true
 	}
@@ -104,9 +104,9 @@ func (n *Node) matchesVersionFile() (string, bool) {
 
 	re := fmt.Sprintf(
 		`(?im)^v?%s(\.?%s)?(\.?%s)?$`,
-		n.language.version.Major,
-		n.language.version.Minor,
-		n.language.version.Patch,
+		n.Major,
+		n.Minor,
+		n.Patch,
 	)
 
 	version := strings.TrimSpace(fileVersion)
diff --git a/src/segments/owm.go b/src/segments/owm.go
index 692bdb78..9ce8719c 100644
--- a/src/segments/owm.go
+++ b/src/segments/owm.go
@@ -113,12 +113,12 @@ func (d *Owm) setStatus() error {
 	}
 
 	if len(q.Data) == 0 {
-		return errors.New("No data found")
+		return errors.New("no data found")
 	}
 
 	id := q.Data[0].TypeID
 
-	d.Temperature = int(math.Round(q.temperature.Value))
+	d.Temperature = int(math.Round(q.Value))
 	icon := ""
 	switch id {
 	case "01n":
diff --git a/src/segments/project.go b/src/segments/project.go
index baa05233..1b827f0a 100644
--- a/src/segments/project.go
+++ b/src/segments/project.go
@@ -121,7 +121,7 @@ func (n *Project) Enabled() bool {
 				continue
 			}
 			n.ProjectData = *data
-			n.ProjectData.Type = item.Name
+			n.Type = item.Name
 			return true
 		}
 	}
diff --git a/src/segments/python.go b/src/segments/python.go
index 2bcecf3a..d42c4043 100644
--- a/src/segments/python.go
+++ b/src/segments/python.go
@@ -62,7 +62,7 @@ func (p *Python) Enabled() bool {
 }
 
 func (p *Python) loadContext() {
-	if !p.language.props.GetBool(FetchVirtualEnv, true) {
+	if !p.props.GetBool(FetchVirtualEnv, true) {
 		return
 	}
 	if prompt := p.pyvenvCfgPrompt(); len(prompt) > 0 {
@@ -76,15 +76,15 @@ func (p *Python) loadContext() {
 		"CONDA_DEFAULT_ENV",
 	}
 
-	folderNameFallback := p.language.props.GetBool(FolderNameFallback, true)
-	defaultVenvNames := p.language.props.GetStringArray(DefaultVenvNames, []string{
+	folderNameFallback := p.props.GetBool(FolderNameFallback, true)
+	defaultVenvNames := p.props.GetStringArray(DefaultVenvNames, []string{
 		".venv",
 		"venv",
 	})
 
 	var venv string
 	for _, venvVar := range venvVars {
-		venv = p.language.env.Getenv(venvVar)
+		venv = p.env.Getenv(venvVar)
 		if len(venv) == 0 {
 			continue
 		}
@@ -109,7 +109,7 @@ func (p *Python) inContext() bool {
 }
 
 func (p *Python) canUseVenvName(name string) bool {
-	if p.language.props.GetBool(properties.DisplayDefault, true) {
+	if p.props.GetBool(properties.DisplayDefault, true) {
 		return true
 	}
 
@@ -175,9 +175,9 @@ func (p *Python) pyenvVersion() (string, error) {
 }
 
 func (p *Python) pyvenvCfgPrompt() string {
-	cmdPath := p.language.env.CommandPath("python")
+	cmdPath := p.env.CommandPath("python")
 	if len(cmdPath) == 0 {
-		cmdPath = p.language.env.CommandPath("python3")
+		cmdPath = p.env.CommandPath("python3")
 	}
 
 	if len(cmdPath) == 0 {
@@ -185,11 +185,11 @@ func (p *Python) pyvenvCfgPrompt() string {
 	}
 
 	pyvenvDir := filepath.Dir(cmdPath)
-	if !p.language.env.HasFilesInDir(pyvenvDir, "pyvenv.cfg") {
+	if !p.env.HasFilesInDir(pyvenvDir, "pyvenv.cfg") {
 		pyvenvDir = filepath.Dir(pyvenvDir)
 	}
 
-	if !p.language.env.HasFilesInDir(pyvenvDir, "pyvenv.cfg") {
+	if !p.env.HasFilesInDir(pyvenvDir, "pyvenv.cfg") {
 		return ""
 	}
 
diff --git a/src/segments/quasar.go b/src/segments/quasar.go
index de51a401..9096d254 100644
--- a/src/segments/quasar.go
+++ b/src/segments/quasar.go
@@ -50,12 +50,12 @@ func (q *Quasar) Template() string {
 }
 
 func (q *Quasar) fetchDependencies() {
-	if !q.language.env.HasFilesInDir(q.projectRoot.ParentFolder, "package-lock.json") {
+	if !q.env.HasFilesInDir(q.projectRoot.ParentFolder, "package-lock.json") {
 		return
 	}
 
 	packageFilePath := filepath.Join(q.projectRoot.ParentFolder, "package-lock.json")
-	content := q.language.env.FileContent(packageFilePath)
+	content := q.env.FileContent(packageFilePath)
 
 	var objmap map[string]json.RawMessage
 	if err := json.Unmarshal([]byte(content), &objmap); err != nil {
diff --git a/src/segments/talosctl.go b/src/segments/talosctl.go
index df7feff7..549fede6 100644
--- a/src/segments/talosctl.go
+++ b/src/segments/talosctl.go
@@ -43,7 +43,7 @@ func (t *TalosCTL) getActiveConfig(cfgDir string) (string, error) {
 	activeConfigFile := filepath.Join(cfgDir, "config")
 	activeConfigData := t.env.FileContent(activeConfigFile)
 	if len(activeConfigData) == 0 {
-		return "", errors.New("NO ACTIVE CONFIG FOUND")
+		return "", errors.New("no active config found")
 	}
 	return activeConfigData, nil
 }
diff --git a/src/segments/unity.go b/src/segments/unity.go
index 7e0b321c..a2777516 100644
--- a/src/segments/unity.go
+++ b/src/segments/unity.go
@@ -66,7 +66,7 @@ func (u *Unity) GetUnityVersion() (string, error) {
 		version := strings.TrimPrefix(line, versionPrefix)
 		version = strings.TrimSpace(version)
 		if len(version) == 0 {
-			return "", errors.New("Empty m_EditorVersion")
+			return "", errors.New("empty m_EditorVersion")
 		}
 		fIndex := strings.Index(version, "f")
 		if fIndex > 0 {
diff --git a/src/segments/ytm.go b/src/segments/ytm.go
index 2d8924f2..d9c33792 100644
--- a/src/segments/ytm.go
+++ b/src/segments/ytm.go
@@ -73,14 +73,14 @@ func (y *Ytm) setStatus() error {
 	}
 	y.Status = playing
 	y.Icon = y.props.GetString(PlayingIcon, "\uE602 ")
-	if !q.player.HasSong {
+	if !q.HasSong {
 		y.Status = stopped
 		y.Icon = y.props.GetString(StoppedIcon, "\uF04D ")
-	} else if q.player.IsPaused {
+	} else if q.IsPaused {
 		y.Status = paused
 		y.Icon = y.props.GetString(PausedIcon, "\uF8E3 ")
 	}
-	y.Artist = q.track.Author
-	y.Track = q.track.Title
+	y.Artist = q.Author
+	y.Track = q.Title
 	return nil
 }
diff --git a/src/shell/init.go b/src/shell/init.go
index cb6eb072..32d179f3 100644
--- a/src/shell/init.go
+++ b/src/shell/init.go
@@ -145,6 +145,8 @@ func PrintInit(env runtime.Environment, features Features, startTime *time.Time)
 
 	shellScript := features.Lines(shell).String(init)
 
+	log.Debug(shellScript)
+
 	if !env.Flags().Debug {
 		return shellScript
 	}
@@ -153,9 +155,6 @@ func PrintInit(env runtime.Environment, features Features, startTime *time.Time)
 
 	builder.WriteString(fmt.Sprintf("\n%s %s\n", log.Text("Init duration:").Green().Bold().Plain(), time.Since(*startTime)))
 
-	builder.WriteString(log.Text("\nScript:\n\n").Green().Bold().Plain().String())
-	builder.WriteString(shellScript)
-
 	builder.WriteString(log.Text("\n\nLogs:\n\n").Green().Bold().Plain().String())
 	builder.WriteString(env.Logs())
 


Test patch:
diff --git a/src/segments/language_test.go b/src/segments/language_test.go
index b34b16e0..a3482d68 100644
--- a/src/segments/language_test.go
+++ b/src/segments/language_test.go
@@ -421,7 +421,7 @@ func TestLanguageHyperlinkEnabled(t *testing.T) {
 	}
 	lang := bootStrapLanguageTest(args)
 	assert.True(t, lang.Enabled())
-	assert.Equal(t, "https://unicor.org/doc/1.3.307", lang.version.URL)
+	assert.Equal(t, "https://unicor.org/doc/1.3.307", lang.URL)
 }
 
 func TestLanguageHyperlinkEnabledWrongRegex(t *testing.T) {
@@ -508,7 +508,7 @@ func TestLanguageInnerHyperlink(t *testing.T) {
 	}
 	lang := bootStrapLanguageTest(args)
 	assert.True(t, lang.Enabled())
-	assert.Equal(t, "https://unicor.org/doc/1.3.307", lang.version.URL)
+	assert.Equal(t, "https://unicor.org/doc/1.3.307", lang.URL)
 }
 
 func TestLanguageHyperlinkTemplatePropertyTakesPriority(t *testing.T) {
@@ -531,7 +531,7 @@ func TestLanguageHyperlinkTemplatePropertyTakesPriority(t *testing.T) {
 	}
 	lang := bootStrapLanguageTest(args)
 	assert.True(t, lang.Enabled())
-	assert.Equal(t, "https://custom/url/template/1.3", lang.version.URL)
+	assert.Equal(t, "https://custom/url/template/1.3", lang.URL)
 }
 
 type mockedLanguageParams struct {
diff --git a/src/segments/lastfm_test.go b/src/segments/lastfm_test.go
index 2c02c6fe..a24a9b3f 100644
--- a/src/segments/lastfm_test.go
+++ b/src/segments/lastfm_test.go
@@ -53,7 +53,7 @@ func TestLFMSegmentSingle(t *testing.T) {
 
 	for _, tc := range cases {
 		env := &mock.Environment{}
-		var props properties.Map = properties.Map{
+		props := properties.Map{
 			APIKey:                 "key",
 			Username:               "KibbeWater",
 			properties.HTTPTimeout: 20000,
diff --git a/src/segments/lua_test.go b/src/segments/lua_test.go
index 1b01853d..c07a2c82 100644
--- a/src/segments/lua_test.go
+++ b/src/segments/lua_test.go
@@ -78,7 +78,7 @@ func TestLua(t *testing.T) {
 		failMsg := fmt.Sprintf("Failed in case: %s", tc.Case)
 		assert.True(t, l.Enabled(), failMsg)
 		assert.Equal(t, tc.ExpectedString, renderTemplate(env, l.Template(), l), failMsg)
-		assert.Equal(t, tc.ExpectedURL, l.version.URL, failMsg)
-		assert.Equal(t, strings.ToLower(strings.Split(tc.Case, " ")[0]), l.version.Executable, failMsg)
+		assert.Equal(t, tc.ExpectedURL, l.URL, failMsg)
+		assert.Equal(t, strings.ToLower(strings.Split(tc.Case, " ")[0]), l.Executable, failMsg)
 	}
 }
diff --git a/src/segments/talosctl_test.go b/src/segments/talosctl_test.go
index 05fc3ef4..31f65891 100644
--- a/src/segments/talosctl_test.go
+++ b/src/segments/talosctl_test.go
@@ -70,7 +70,7 @@ func TestGetTalosctlActiveConfig(t *testing.T) {
 		{
 			Case:          "no active config",
 			ActiveConfig:  "",
-			ExpectedError: "NO ACTIVE CONFIG FOUND",
+			ExpectedError: "no active config found",
 		},
 	}
 
diff --git a/src/segments/winreg_test.go b/src/segments/winreg_test.go
index 0764faae..1e3ff027 100644
--- a/src/segments/winreg_test.go
+++ b/src/segments/winreg_test.go
@@ -24,7 +24,7 @@ func TestWinReg(t *testing.T) {
 		{
 			CaseDescription: "Error",
 			Path:            "HKLLM\\Software\\Microsoft\\Windows NT\\CurrentVersion\\ProductName",
-			Err:             errors.New("No match"),
+			Err:             errors.New("no match"),
 			ExpectedSuccess: false,
 		},
 		{
@@ -38,7 +38,7 @@ func TestWinReg(t *testing.T) {
 			CaseDescription: "Fallback value",
 			Path:            "HKLM\\Software\\Microsoft\\Windows NT\\CurrentVersion\\InstallTime",
 			Fallback:        "cortana",
-			Err:             errors.New("No match"),
+			Err:             errors.New("no match"),
 			ExpectedSuccess: true,
 			ExpectedValue:   "cortana",
 		},