JanDeDobbeleer / oh-my-posh

The most customisable and low-latency cross platform/shell prompt renderer
https://ohmyposh.dev
MIT License
17.51k stars 2.4k forks source link

Node Language Segment is not updating the full version #5892

Closed yuniet87 closed 1 week ago

yuniet87 commented 1 week ago

Code of Conduct

What happened?

When use nvm to change node version, the language segment is not updating the version in terminal. image

Theme

{
  "$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
  "blocks": [
    {
      "type": "prompt",
      "alignment": "left",
      "segments": [
        {
          "style": "plain",
          "template": "root <#ffffff>in</> ",
          "foreground": "#E06C75",
          "type": "root"
        },
        {
          "properties": {
            "style": "folder"
          },
          "style": "plain",
          "template": "{{ .Path }} ",
          "foreground": "#55B9C4",
          "type": "path"
        },
        {
          "properties": {
            "fetch_status": true,
            "fetch_upstream_icon": true
          },
          "style": "plain",
          "template": "<#ffffff>on</> {{ .UpstreamIcon }}{{ .HEAD }}{{if .BranchStatus }} {{ .BranchStatus }}{{ end }}{{ if .Working.Changed }} \uf044 {{ .Working.String }}{{ end }}{{ if and (.Working.Changed) (.Staging.Changed) }} |{{ end }}{{ if .Staging.Changed }} \uf046 {{ .Staging.String }}{{ end }} ",
          "foreground": "#C678DD",
          "type": "git"
        },
        {
          "properties": {
            "fetch_version": true
          },
          "style": "plain",
          "template": "<#ffffff>via</> \ue781 {{ if .PackageManagerIcon }}{{ .PackageManagerIcon }} {{ end }}{{ .Full }} ",
          "foreground": "#98C379",
          "type": "node"
        },
        {
          "style": "plain",
          "template": "x ",
          "foreground": "#C94A16",
          "type": "status"
        }
      ]
    },
    {
      "type": "prompt",
      "alignment": "right",
      "segments": [
        {
          "properties": {
            "style": "dallas",
            "threshold": 0
          },
          "style": "diamond",
          "template": " <#BBC4B9>{{ .Ms }}ms</> <#fff>\udb80\udddd</> ",
          "foreground": "#fff",
          "type": "executiontime"
        },
        {
          "style": "plain",
          "template": "{{ .Name }}",
          "foreground": "#007acc",
          "type": "shell"
        },
        {
          "style": "plain",
          "template": " <#757575,>as</> root",
          "foreground": "#ff8080",
          "type": "root"
        },
        {
          "properties": {
            "time_format": "Monday, January 2 at 3:04 PM"
          },
          "style": "plain",
          "template": " <#fff>\udb80\udddd</> {{ .CurrentDate | date .Format }}",
          "foreground": "#689f38",
          "type": "time"
        }
      ]
    },
    {
      "type": "prompt",
      "alignment": "left",
      "segments": [
        {
          "style": "plain",
          "template": "➜ ",
          "foreground": "#63F08C",
          "type": "text"
        }
      ],
      "newline": true
    }
  ],
  "version": 3
}

What OS are you seeing the problem on?

Windows

Which shell are you using?

powershell

Log output

Version: 24.5.1

Shell: pwsh (7.4.6)

Prompt:

ponyracer on master ≢  ~2 |  +1 via  20.11.0                                                                                               0ms 󰇝 pwsh 󰇝 Thursday, November 14 at 8:11 PM
➜

Segments:

ConsoleTitle(false)                        -   0 ms
Root(false)                                -   0 ms
Path(true)                                 -   2 ms
Git(true)                                  - 116 ms
Node(true)                                 -   1 ms
Status(false)                              -   1 ms
Executiontime(true)                        -   0 ms
Shell(true)                                -   0 ms
Root(false)                                -   0 ms
Time(true)                                 -   0 ms
Text(true)                                 -   0 ms

Run duration: 120.56ms

Cache path: C:\Users\Yuniet\AppData\Local\oh-my-posh

Config path: C:\Users\Yuniet\AppData\Local\Programs\oh-my-posh\themes\yuniet.omp.json

Logs:

[DEBUG] 20:11:07.942 command.go:execute:989 → debug mode enabled
[DEBUG] 20:11:07.943 debug.go:40 → config set using POSH_THEME: C:\Users\Yuniet\AppData\Local\Programs\oh-my-posh\themes\yuniet.omp.json
[TRACE] 20:11:07.943 debug.go() - 0s
[TRACE] 20:11:07.944 load.go:Load() - 1.0482ms
[TRACE] 20:11:07.944 debug.go() - 1.0482ms
[DEBUG] 20:11:07.944 debug.go:52 → plain mode enabled
[TRACE] 20:11:07.944 terminal.go() - 0s
[DEBUG] 20:11:07.944 terminal.go:59 → loading cache file: C:\Users\Yuniet\AppData\Local\oh-my-posh\omp.cache
[DEBUG] 20:11:07.944 terminal.go:59 → loading cache key: version_node
[TRACE] 20:11:07.944 terminal.go(C:\Users\Yuniet\AppData\Local\oh-my-posh\omp.cache) - 0s
[TRACE] 20:11:07.944 terminal.go() - 0s
[DEBUG] 20:11:07.944 terminal.go:59 → loading cache file: C:\Users\Yuniet\AppData\Local\oh-my-posh\omp.cache.665123a9-e18e-4766-82df-f6e72e6ec4d1
[DEBUG] 20:11:07.944 terminal.go:59 → loading cache key: prompt_count_cache
[TRACE] 20:11:07.944 terminal.go(C:\Users\Yuniet\AppData\Local\oh-my-posh\omp.cache.665123a9-e18e-4766-82df-f6e72e6ec4d1) - 0s
[TRACE] 20:11:07.944 terminal.go:Init() - 0s
[TRACE] 20:11:07.944 terminal.go() - 0s
[DEBUG] 20:11:07.944 terminal.go:Init:67 → D:\Projects\00-Extra\angular\ponyracer
[TRACE] 20:11:07.944 terminal.go:Init() - 0s
[TRACE] 20:11:07.944 debug.go() - 0s
[TRACE] 20:11:07.944 init.go:Init() - 0s
[TRACE] 20:11:07.944 cache.go:loadCache() - 0s
[TRACE] 20:11:07.944 cache.go:loadCache() - 0s
[TRACE] 20:11:07.944 cache.go:loadCache() - 0s
[TRACE] 20:11:07.944 cache.go:loadCache() - 0s
[TRACE] 20:11:07.944 cache.go:loadCache() - 0s
[TRACE] 20:11:07.944 cache.go:loadCache() - 0s
[TRACE] 20:11:07.945 cache.go:loadCache() - 0s
[TRACE] 20:11:07.945 cache.go:loadCache() - 0s
[TRACE] 20:11:07.945 cache.go:loadCache() - 0s
[DEBUG] 20:11:07.945 home.go:Home:26 → C:\Users\Yuniet
[TRACE] 20:11:07.945 cache.go:loadCache() - 0s
[TRACE] 20:11:07.945 cache.go:loadCache() - 0s
[TRACE] 20:11:07.945 cache.go:loadCache() - 0s
[TRACE] 20:11:07.945 cache.go:loadCache() - 0s
[DEBUG] 20:11:07.945 cache.go:loadCache:60 → Yuniet
[TRACE] 20:11:07.945 cache.go:loadCache() - 0s
[DEBUG] 20:11:07.945 cache.go:loadCache:61 → VICTUS
[TRACE] 20:11:07.945 cache.go:loadCache() - 0s
[TRACE] 20:11:07.945 cache.go:loadCache() - 0s
[DEBUG] 20:11:07.945 cache.go:loadCache:71 → NO DATA
[TRACE] 20:11:07.945 cache.go:loadCache(SHLVL) - 0s
[DEBUG] 20:11:07.945 debug.go:61 → terminal program: Windows Terminal
[DEBUG] 20:11:07.945 debug.go:61 → terminal shell: shell
[DEBUG] 20:11:07.945 config.go:MakeColors:56 → NO DATA
[TRACE] 20:11:07.945 config.go:MakeColors(OMP_CACHE_DISABLED) - 0s
[TRACE] 20:11:07.945 colors_windows.go:GetAccentColor(HKEY_CURRENT_USER\Software\Microsoft\Windows\DWM\ColorizationColor) - 0s
[DEBUG] 20:11:07.945 colors_windows.go:GetAccentColor:19 → ColorizationColor(DWORD): 0xC40078D4
[TRACE] 20:11:07.945 colors.go:SetAccentColor() - 0s
[TRACE] 20:11:07.945 colors.go:MakeColors() - 0s
[TRACE] 20:11:07.945 debug.go:PrintDebug() - 0s
[DEBUG] 20:11:07.945 debug.go:PrintDebug:16 → 7.4.6
[TRACE] 20:11:07.945 debug.go:PrintDebug(POSH_SHELL_VERSION) - 0s
[DEBUG] 20:11:07.945 debug.go:72 → segment: Title
[TRACE] 20:11:07.945 engine.go:getTitleTemplateText() - 0s
[TRACE] 20:11:07.945 primary.go:needsPrimaryRightPrompt() - 0s
[DEBUG] 20:11:07.945 terminal.go:CursorPosition:590 → 10
[TRACE] 20:11:07.945 terminal.go:CursorPosition(POSH_CURSOR_LINE) - 0s
[DEBUG] 20:11:07.945 terminal.go:CursorPosition:594 → 1
[TRACE] 20:11:07.945 terminal.go:CursorPosition(POSH_CURSOR_COLUMN) - 0s
[TRACE] 20:11:07.945 primary.go:writePrimaryPrompt() - 0s
[TRACE] 20:11:07.945 primary.go:writePrimaryPrompt() - 0s
[TRACE] 20:11:07.945 segment.go:Execute() - 0s
[TRACE] 20:11:07.945 segment.go:Execute() - 0s
[DEBUG] 20:11:07.945 home.go:Home:26 → C:\Users\Yuniet
[DEBUG] 20:11:07.945 home.go:Home:26 → C:\Users\Yuniet
[TRACE] 20:11:07.945 terminal.go:DirMatchesOneOf() - 0s
[TRACE] 20:11:07.945 terminal.go:DirMatchesOneOf() - 0s
[DEBUG] 20:11:07.945 segment.go:Execute:109 → segment: Status
[DEBUG] 20:11:07.945 segment.go:Execute:109 → segment: Root
[TRACE] 20:11:07.945 status.go:Enabled() - 0s
[DEBUG] 20:11:07.945 status.go:formatStatus:45 → {{ .Code }}
[TRACE] 20:11:07.945 root.go:Enabled() - 0s
[TRACE] 20:11:07.945 segment.go:Execute() - 0s
[TRACE] 20:11:07.945 segment.go:Execute() - 0s
[DEBUG] 20:11:07.945 home.go:Home:26 → C:\Users\Yuniet
[TRACE] 20:11:07.945 terminal.go:DirMatchesOneOf() - 0s
[DEBUG] 20:11:07.945 segment.go:Execute:109 → segment: Node
[TRACE] 20:11:07.945 segment.go:Execute() - 0s
[DEBUG] 20:11:07.945 home.go:Home:26 → C:\Users\Yuniet
[TRACE] 20:11:07.945 terminal.go:DirMatchesOneOf() - 0s
[DEBUG] 20:11:07.945 segment.go:Execute:109 → segment: Path
[DEBUG] 20:11:07.945 path.go:147 → display_cygpath: false
[TRACE] 20:11:07.945 path.go:setPaths() - 0s
[TRACE] 20:11:07.945 path.go:setPaths() - 0s
[TRACE] 20:11:07.945 path.go:setPaths() - 0s
[TRACE] 20:11:07.945 path.go:setPaths() - 0s
[DEBUG] 20:11:07.945 language.go:Enabled:117 → extensions: [*.js *.ts package.json .nvmrc pnpm-workspace.yaml .pnpmfile.cjs .vue]
[DEBUG] 20:11:07.946 home.go:Home:26 → C:\Users\Yuniet
[DEBUG] 20:11:07.946 language.go:Enabled:118 → folders: []
[TRACE] 20:11:07.946 terminal.go:DirMatchesOneOf() - 0s
[DEBUG] 20:11:07.946 language.go:Enabled:125 → home_enabled: false
[DEBUG] 20:11:07.946 segment.go:Execute:109 → segment: Git
[DEBUG] 20:11:07.946 home.go:Home:26 → C:\Users\Yuniet
[DEBUG] 20:11:07.946 language.go:Enabled:137 → files
[DEBUG] 20:11:07.946 node.go:loadContext:48 → fetch_package_manager: false
[TRACE] 20:11:07.946 scm.go:hasCommand() - 0s
[DEBUG] 20:11:07.946 path.go:setMappedLocations:557 → mapped_locations_enabled: true
[DEBUG] 20:11:07.946 path.go:setMappedLocations:558 → 
[DEBUG] 20:11:07.946 path.go:setMappedLocations:559 → 
[DEBUG] 20:11:07.946 home.go:Home:26 → C:\Users\Yuniet
[TRACE] 20:11:07.946 clean.go:Clean() - 0s
[TRACE] 20:11:07.946 path.go:normalize() - 0s
[DEBUG] 20:11:07.946 path.go:setMappedLocations:560 → ~
[DEBUG] 20:11:07.946 path.go:setMappedLocations:565 → mapped_locations: map[]
[TRACE] 20:11:07.946 clean.go:Clean() - 0s
[TRACE] 20:11:07.946 path.go:normalize() - 0s
[TRACE] 20:11:07.946 clean.go:Clean() - 0s
[TRACE] 20:11:07.946 path.go:normalize() - 0s
[TRACE] 20:11:07.946 path.go:parsePath() - 0s
[TRACE] 20:11:07.946 path.go:parsePath() - 0s
[TRACE] 20:11:07.946 path.go:parsePath() - 0s
[DEBUG] 20:11:07.946 path.go:makeFolderFormatMap:833 → NO DATA
[DEBUG] 20:11:07.946 path.go:setStyle:213 → folder
[DEBUG] 20:11:07.946 terminal.go:HasFiles:114 → false
[DEBUG] 20:11:07.946 path.go:getFolderSeparator:267 → NO DATA
[TRACE] 20:11:07.946 terminal.go:HasFiles(*.ts) - 0s
[DEBUG] 20:11:07.946 path.go:getFolderSeparator:269 → \
[DEBUG] 20:11:07.946 terminal.go:HasFiles:114 → true
[DEBUG] 20:11:07.946 path.go:colorizePath:737 → cycle_folder_separator: false
[TRACE] 20:11:07.946 terminal.go:HasFiles(package.json) - 0s
[DEBUG] 20:11:07.946 path.go:colorizePath:738 → %s
[DEBUG] 20:11:07.946 path.go:colorizePath:740 → %s
[TRACE] 20:11:07.946 status.go:formatStatus({{ .Code }}) - 1.5759ms
[DEBUG] 20:11:07.946 language.go:Enabled:156 → fetch_version: true
[DEBUG] 20:11:07.946 path.go:colorizePath:741 → %s
[DEBUG] 20:11:07.946 path.go:colorizePath:742 → %s
[DEBUG] 20:11:07.946 status.go:Enabled:37 → always_enabled: false
[TRACE] 20:11:07.946 path.go:Enabled() - 0s
[TRACE] 20:11:07.946 path.go:Enabled() - 0s
[TRACE] 20:11:07.946 path.go:Enabled() - 0s
[ERROR] 20:11:07.946 node.go:matchesVersionFile:65 → open D:\Projects\00-Extra\angular\ponyracer\.nvmrc: The system cannot find the file specified.
[TRACE] 20:11:07.946 node.go:matchesVersionFile(.nvmrc) - 0s
[DEBUG] 20:11:07.947 terminal_windows.go:DirIsWritable:216 → current user is member of S-1-5-32-544
[DEBUG] 20:11:07.947 win32_windows.go:isWriteable:271 ↓
    WRITE_DAC
    WRITE_OWNER
    SYNCHRONIZE
    DELETE
    READ_CONTROL
[DEBUG] 20:11:07.947 terminal_windows.go:DirIsWritable:216 → user has write access
[TRACE] 20:11:07.947 path.go:Enabled() - 525.9µs
[TRACE] 20:11:07.947 segment.go:string({{ .Path }} ) - 0s
[TRACE] 20:11:07.947 segment.go:resolve(plain) - 0s
[DEBUG] 20:11:07.952 terminal.go:HasCommand:323 → C:\Users\Yuniet\scoop\shims\git.exe
[TRACE] 20:11:07.952 terminal.go:HasCommand(git.exe) - 6.7732ms
[TRACE] 20:11:07.952 scm.go:hasCommand(git.exe) - 6.7732ms
[DEBUG] 20:11:07.952 git.go:shouldDisplay:328 → fetch_bare_info: false
[DEBUG] 20:11:07.953 terminal.go:HasParentFilePath:453 → D:\Projects\00-Extra\angular\ponyracer
[TRACE] 20:11:07.953 terminal.go:HasParentFilePath(D:\Projects\00-Extra\angular\ponyracer) - 524.2µs
[TRACE] 20:11:07.953 git.go:shouldDisplay(.git) - 524.2µs
[DEBUG] 20:11:07.953 home.go:Home:26 → C:\Users\Yuniet
[TRACE] 20:11:07.953 git.go:setDir() - 0s
[TRACE] 20:11:07.953 scm.go:convertToWindowsPath() - 0s
[DEBUG] 20:11:07.953 git.go:Enabled:174 → fetch_user: false
[DEBUG] 20:11:07.953 git.go:Enabled:189 → cli
[DEBUG] 20:11:07.953 git.go:Enabled:194 → fetch_status: true
[DEBUG] 20:11:07.953 git.go:shouldIgnoreStatus:466 → ignore_status: []
[DEBUG] 20:11:07.953 home.go:Home:26 → C:\Users\Yuniet
[TRACE] 20:11:07.953 terminal.go:DirMatchesOneOf() - 0s
[DEBUG] 20:11:07.953 git.go:setGitStatus:612 → status_formats: map[]
[DEBUG] 20:11:07.953 git.go:getSwitchMode:911 → untracked_modes: map[]
[DEBUG] 20:11:07.953 git.go:getSwitchMode:911 → ignore_submodules: map[]
[DEBUG] 20:11:08.010 git.go:getGitCommandOutput:663 ↓
    # branch.oid b4e5f6df49e86e30f2e50c5046bb8d4171dfffd0
    # branch.head master
    1 .M N... 100644 100644 100644 5d90e2bf028a84e57bf06093f1f535b9b62cb781 5d90e2bf028a84e57bf06093f1f535b9b62cb781 src/app/app.component.ts
    1 AM N... 000000 100644 100644 0000000000000000000000000000000000000000 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 src/app/races.component.ts
[TRACE] 20:11:08.010 git.go:getGitCommandOutput(git.exe -C D:/Projects/00-Extra/angular/ponyracer --no-optional-locks -c core.quotepath=false -c color.status=false status -unormal --branch --porcelain=2) - 56.6534ms
[DEBUG] 20:11:08.010 git.go:setGitHEADContext:671 → 
[DEBUG] 20:11:08.010 scm.go:formatBranch:106 → mapped_branches: map[]
[DEBUG] 20:11:08.010 scm.go:formatBranch:122 → full_branch_path: true
[DEBUG] 20:11:08.010 scm.go:formatBranch:128 → branch_max_length: 0
[DEBUG] 20:11:08.010 git.go:setGitHEADContext:699 → false
[TRACE] 20:11:08.010 git.go:setGitHEADContext(D:\Projects\00-Extra\angular\ponyracer\.git/rebase-merge) - 0s
[DEBUG] 20:11:08.010 git.go:setGitHEADContext:711 → false
[TRACE] 20:11:08.010 git.go:setGitHEADContext(D:\Projects\00-Extra\angular\ponyracer\.git/rebase-apply) - 0s
[DEBUG] 20:11:08.010 git.go:setGitHEADContext:722 → 
[DEBUG] 20:11:08.010 git.go:hasGitFile:801 → false
[TRACE] 20:11:08.010 git.go:hasGitFile(MERGE_MSG) - 0s
[DEBUG] 20:11:08.010 git.go:hasGitFile:801 → false
[TRACE] 20:11:08.010 git.go:hasGitFile(CHERRY_PICK_HEAD) - 0s
[DEBUG] 20:11:08.010 git.go:hasGitFile:801 → false
[TRACE] 20:11:08.010 git.go:hasGitFile(REVERT_HEAD) - 0s
[DEBUG] 20:11:08.010 git.go:hasGitFile:801 → false
[TRACE] 20:11:08.010 git.go:hasGitFile(sequencer/todo) - 0s
[DEBUG] 20:11:08.010 git.go:482 → ≢
[DEBUG] 20:11:08.010 git.go:Enabled:207 → fetch_upstream_icon: true
[ERROR] 20:11:08.061 git.go:getGitCommandOutput:663 → exit status 2
[DEBUG] 20:11:08.061 git.go:getGitCommandOutput:663 ↓
    error: No such remote 'origin'

[TRACE] 20:11:08.061 git.go:getGitCommandOutput(git.exe -C D:/Projects/00-Extra/angular/ponyracer --no-optional-locks -c core.quotepath=false -c color.status=false remote get-url origin) - 51.3984ms
[TRACE] 20:11:08.062 segment.go:string(<#ffffff>on</> {{ .UpstreamIcon }}{{ .HEAD }}{{if .BranchStatus }} {{ .BranchStatus }}{{ end }}{{ if .Working.Changed }}  {{ .Working.String }}{{ end }}{{ if and (.Working.Changed) (.Staging.Changed) }} |{{ end }}{{ if .Staging.Changed }}  {{ .Staging.String }}{{ end }} ) - 1.0078ms
[TRACE] 20:11:08.062 segment.go:resolve(plain) - 0s
[TRACE] 20:11:08.062 segment.go:string(<#ffffff>via</>  {{ if .PackageManagerIcon }}{{ .PackageManagerIcon }} {{ end }}{{ .Full }} ) - 0s
[TRACE] 20:11:08.062 segment.go:resolve(plain) - 0s
[TRACE] 20:11:08.062 segment.go:resolve(plain) - 0s
[TRACE] 20:11:08.062 engine.go:applyPowerShellBleedPatch() - 0s
[TRACE] 20:11:08.062 segment.go:Execute() - 0s
[TRACE] 20:11:08.062 segment.go:Execute() - 0s
[TRACE] 20:11:08.062 segment.go:Execute() - 0s
[DEBUG] 20:11:08.062 home.go:Home:26 → C:\Users\Yuniet
[TRACE] 20:11:08.062 terminal.go:DirMatchesOneOf() - 0s
[DEBUG] 20:11:08.062 segment.go:Execute:109 → segment: Executiontime
[DEBUG] 20:11:08.062 home.go:Home:26 → C:\Users\Yuniet
[TRACE] 20:11:08.062 terminal.go:DirMatchesOneOf() - 0s
[DEBUG] 20:11:08.062 segment.go:Execute:109 → segment: Time
[DEBUG] 20:11:08.062 executiontime.go:Enabled:55 → always_enabled: false
[TRACE] 20:11:08.062 executiontime.go:Enabled() - 0s
[DEBUG] 20:11:08.062 executiontime.go:Enabled:57 → threshold: 0.000000
[DEBUG] 20:11:08.062 executiontime.go:Enabled:61 → dallas
[TRACE] 20:11:08.062 segment.go:Execute() - 0s
[DEBUG] 20:11:08.062 home.go:Home:26 → C:\Users\Yuniet
[TRACE] 20:11:08.062 terminal.go:DirMatchesOneOf() - 0s
[DEBUG] 20:11:08.062 time.go:Enabled:27 → Monday, January 2 at 3:04 PM
[DEBUG] 20:11:08.062 segment.go:Execute:109 → segment: Shell
[DEBUG] 20:11:08.062 home.go:Home:26 → C:\Users\Yuniet
[TRACE] 20:11:08.062 terminal.go:DirMatchesOneOf() - 0s
[DEBUG] 20:11:08.062 segment.go:Execute:109 → segment: Root
[TRACE] 20:11:08.062 segment.go:string( <#BBC4B9>{{ .Ms }}ms</> <#fff>󰇝</> ) - 0s
[TRACE] 20:11:08.062 root.go:Enabled() - 0s
[TRACE] 20:11:08.062 segment.go:resolve(diamond) - 0s
[DEBUG] 20:11:08.062 shell.go:Enabled:26 → mapped_shell_names: map[]
[TRACE] 20:11:08.062 shell.go:Enabled() - 0s
[TRACE] 20:11:08.062 shell.go:Enabled() - 0s
[TRACE] 20:11:08.063 segment.go:string({{ .Name }}) - 1.0063ms
[TRACE] 20:11:08.063 segment.go:resolve(plain) - 0s
[TRACE] 20:11:08.063 segment.go:resolve(plain) - 0s
[TRACE] 20:11:08.063 segment.go:string( <#fff>󰇝</> {{ .CurrentDate | date .Format }}) - 0s
[TRACE] 20:11:08.063 segment.go:resolve(plain) - 0s
[DEBUG] 20:11:08.063 terminal_windows.go:TerminalWidth:99 → terminal width: 188
[TRACE] 20:11:08.063 engine.go:canWriteRightBlock() - 0s
[TRACE] 20:11:08.063 engine.go:applyPowerShellBleedPatch() - 0s
[TRACE] 20:11:08.063 segment.go:Execute() - 0s
[DEBUG] 20:11:08.063 home.go:Home:26 → C:\Users\Yuniet
[TRACE] 20:11:08.063 terminal.go:DirMatchesOneOf() - 0s
[DEBUG] 20:11:08.063 segment.go:Execute:109 → segment: Text
[TRACE] 20:11:08.063 segment.go:string(➜ ) - 0s
[TRACE] 20:11:08.063 segment.go:resolve(plain) - 0s
[TRACE] 20:11:08.063 engine.go:applyPowerShellBleedPatch() - 0s
[TRACE] 20:11:08.063 primary.go:Primary() - 0s
[TRACE] 20:11:08.063 debug.go:PrintDebug() - 0s
[TRACE] 20:11:08.063 debug.go:PrintDebug() - 0s
ernstc commented 1 week ago

@yuniet87 try adding the "cache_duration" property

        {
          "properties": {
            "fetch_version": true,
            "cache_duration": "1m"
          },
          "style": "plain",
          "template": "<#ffffff>via</> \ue781 {{ if .PackageManagerIcon }}{{ .PackageManagerIcon }} {{ end }}{{ .Full }} ",
          "foreground": "#98C379",
          "type": "node"
        },

The duration is a string in the format 1h2m3s and is parsed using the time.ParseDuration function from the Go standard library. To disable the cache, use none

yuniet87 commented 1 week ago

@ernstc unfortunately still doesn't work… image

image

Previously it worked without this property, but yesterday I realized that it didn't work.

JanDeDobbeleer commented 1 week ago

@yuniet87 remove the cache first with oh-my-posh cache clear, this should work.

yuniet87 commented 1 week ago

@JanDeDobbeleer clearing cache and setting cache_duration to none, image work like a charm, image Thanks a lot!

JanDeDobbeleer commented 1 week ago

I'm wondering if this should be the default behavior. The reason I changed that is because I wanted to optimize for performance, but maybe the behavior is counterintuitive.

yuniet87 commented 1 week ago

I'm wondering if this should be the default behavior. The reason I changed that is because I wanted to optimize for performance, but maybe the behavior is counterintuitive.

Maybe a little... Imho, in this specific situation is expected that the version change as soon as you change with nvm.