JanDeDobbeleer / oh-my-posh

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

Segment Project Error #2033

Closed neradp closed 2 years ago

neradp commented 2 years ago

Code of Conduct

What happened?

Segment throws unexpected end of JSON input on windows and pwsh or powershell.

Write-PoshDebug freezes powershell prompt.

Theme

{
  "$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
  "blocks": [

    {
      "alignment": "left",
      "segments": [
    {
          "background": "#2f2f2f",
          "foreground": "#26C6DA",

          "properties": {
            "alpine": "\uf300",
            "arch": "\uf303",
            "centos": "\uf304",
            "debian": "\uf306",
            "elementary": "\uf309",
            "fedora": "\uf30a",
            "gentoo": "\uf30d",
            "linux": "\ue712",
            "macos": "\ue711",
            "manjaro": "\uf312",
            "mint": "\uf30f",
            "opensuse": "\uf314",
            "raspbian": "\uf315",
            "ubuntu": "\uf31c",
            "windows": "\ue70f"
          },
          "style": "diamond",
          "leading_diamond": "\ue0c7",
          "template": " {{ if .WSL }}WSL at {{ end }}{{.Icon}}<#7a7a7a> \ue0b1</>",
          "type": "os"
        },
        {
          "background": "#2f2f2f",
          "foreground": "#fafafa",
          "properties": {
            "display_default": false
          },
          "style": "diamond",
          "template": " {{ if .SSHSession }}\uf817 {{ end }}{{ if .Root }}\uf0e7 {{ end }}<#77f5d6>{{ .UserName }}</><#7a7a7a>\uf1fa</><#2EEFBF>{{ .HostName }}</><#7a7a7a> \ue0b1</>",
          "type": "session"
        },

        {
          "background": "#2f2f2f",
          "foreground": "#fafafa",
          "properties": {
            "folder_icon": "<#B5B2C2>\ue5fe </>",
            "folder_separator_icon": "<#B5B2C2>\ue0bf </>",
            "home_icon": "\uf015",
            "style": "agnoster_short"
          },
          "style": "powerline",
          "powerline_symbol": "\uE0B0",

          "template": "<#f2f200> \ue5ff </>{{ .Path }} ",
          "type": "path"
        },
        {
          "background": "#2f2f2f",
          "foreground": "#ffeb3b",
          "foreground_templates": [
            "{{ if or (.Working.Changed) (.Staging.Changed) }}#ffeb3b{{ end }}",
            "{{ if gt .Ahead 0 }}#8A4FFF{{ end }}",
            "{{ if gt .Behind 0 }}#2EC4B6{{ end }}"
          ],
          "properties": {
            "fetch_stash_count": true,
            "fetch_status": true,
            "fetch_upstream_icon": true
          },
         "style": "powerline",
          "powerline_symbol": "\uE0B0",

          "template": "<#7a7a7a>\ue0b1 </>{{ .HEAD }} {{ .BranchStatus }}{{ if .Working.Changed }} \uf044 <#E84855>{{ .Working.String }}</>{{ end }}{{ if and (.Staging.Changed) (.Working.Changed) }} |{{ end }}{{ if .Staging.Changed }} \uf046 <#2FDA4E>{{ .Staging.String }}</>{{ end }}{{ if gt .StashCount 0}} \uf692 {{ .StashCount }}{{ end }}{{ if gt .WorktreeCount 0}} \uf1bb {{ .WorktreeCount }}{{ end }} ",
          "type": "git"
        },
        {
          "type": "project",
          "style": "powerline",
          "powerline_symbol": "\uE0B0",
          "foreground": "#193549",
          "background": "#ffeb3b",
          "template": " {{ if .Error }}{{ .Error }}{{ else }}{{ if .Version }}\uf487 {{.Version}}{{ end }} {{ if .Name }}{{ .Name }}{{ end }}{{ end }} "
        }

      ],
      "type": "prompt"
    },
    {
      "alignment": "right",
      "segments": [

        {
          "background": "#2f2f2f",
          "foreground": "#6CA35E",
          "style": "powerline",
          "powerline_symbol": "\uE0B2",
           "invert_powerline": true,
          "template": "\ue718 {{ if .PackageManagerIcon }}{{ .PackageManagerIcon }} {{ end }}{{ .Full }}<#7a7a7a> \ue0b3</>",
          "type": "node"
        },
        {
          "background": "#2f2f2f",
          "foreground": "#4063D8",
           "style": "powerline",
          "powerline_symbol": "\uE0B2",
           "invert_powerline": true,
          "template": "\ue73d {{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }}<#7a7a7a> \ue0b3</>",
          "type": "php"
        },
        {
          "background": "#2f2f2f",
          "foreground": "#96E072",
          "style": "powerline",       
          "powerline_symbol": "\uE0B2",
           "invert_powerline": true,
          "template": "\ue235 {{ if .Error }}{{ .Error }}{{ else }}{{ if .Venv }}{{ .Venv }} {{ end }}{{ .Full }}{{ end }}<#7a7a7a> \ue0b3</>",
          "type": "python"
        },
        {
          "background": "#2f2f2f",
          "foreground": "#3891A6",
           "style": "powerline",
          "powerline_symbol": "\uE0B2",
           "invert_powerline": true,
          "template": "\ue77f {{ if .Unsupported }}\uf071{{ else }}{{ .Full }}{{ end }}<#7a7a7a> \ue0b3</>",
          "type": "dotnet"
        },
        {
          "background": "#2f2f2f",
          "foreground": "#1BD760",
           "style": "powerline",
          "powerline_symbol": "\uE0B2",
          "invert_powerline": true,
          "template": "\uf9c6 {{ if ne .Status \"stopped\" }}{{ .Artist }} - {{ .Track }}{{ end }}<#7a7a7a> \ue0b3</>",
          "type": "spotify"
        },
        {
          "background": "#2f2f2f",
          "foreground": "#FF0000",
           "style": "powerline",
          "powerline_symbol": "\uE0B2",
           "invert_powerline": true,
          "template": "\uf16a {{ if ne .Status \"stopped\" }}{{ .Artist }} - {{ .Track }}{{ end }}<#7a7a7a> \ue0b3</>",
          "type": "ytm"
        },
        {
          "background": "#2f2f2f",
          "foreground": "#fafafa",
          "powerline_symbol": "\ue0b2",
           "invert_powerline": true,
          "properties": {
            "time_format": "15:04:05"
          },
          "style": "powerline",
          "template": " {{ .CurrentDate | date .Format }}<#007ACC> \uf64f </>",
          "type": "time"
        },
        {
          "background_templates": [
            "{{ if eq \"Full\" .State.String }}#4caf50{{ end }}",
            "{{ if eq \"Charging\" .State.String }}#40c4ff{{ end }}",
            "{{ if eq \"Discharging\" .State.String }}#ff5722{{ end }}"
          ],
          "foreground": "#fafafa",
          "invert_powerline": true,
          "powerline_symbol": "\ue0b2",
          "style": "diamond",
          "template": " {{ if not .Error }}{{ .Icon }}{{ .Percentage }}{{ end }}{{ .Error }}\uf295 \uf583 ",
          "trailing_diamond": "\ue0c6",
          "type": "battery"
        }
      ],
      "type": "prompt"
    },
    {
      "alignment": "left",
      "newline": true,
      "segments": [
        {
          "foreground": "#7a7a7a",
          "style": "plain",
          "template": "{{.Shell}}~#@\u276f",
          "type": "text"
        }
      ],
      "type": "prompt"
    },
    {
      "alignment": "right",
      "segments": [
        {
          "foreground": "#7a7a7a",
          "style": "plain",
          "template": " \u276e ",
          "type": "text"
        },
        {
          "foreground": "#FFCE5C",
          "properties": {
            "style": "roundrock",
            "threshold": 500
          },
          "style": "plain",
          "template": " {{ .FormattedMs }}<#fafafa> \uf252 </>",
          "type": "executiontime"
        },
        {
          "foreground": "#9FD356",
          "foreground_templates": [
            "{{ if gt .Code 0 }}#E84855{{ end }}"
          ],
          "properties": {
            "always_enabled": true,
            "display_exit_code": true
          },
          "style": "plain",
          "template": " \uf705 {{ if gt .Code 0 }}\uf00d {{ .Code }}{{ else }}\uf42e{{ end }} ",
          "type": "exit"
        }
      ],
      "type": "rprompt"
    }
  ],
  "console_title_template": "{{if .Root}}root :: {{end}}{{.Shell}} :: {{.Folder}}",
  "final_space": true,
  "version": 2
}

What OS are you seeing the problem on?

Windows

Which shell are you using?

powershell

Log output

pwsh~#@❯ oh-my-posh debug                                                                                                                                                                                                           ❮   

Version: 7.58.1

Segments:

ConsoleTitle(true)   -   0 ms - pwsh :: Project
os(true)             -   0 ms -   
session(true)        -   0 ms -  peterDESKTOP-MISBF7F 
path(true)           -   0 ms -      Project
git(false)           -  29 ms -
project(true)        -   1 ms -   1.0.0 Project
node(true)           -  64 ms -  17.8.0 
php(false)           -   0 ms -
python(false)        -   0 ms -
dotnet(false)        -   1 ms -
spotify(false)       -  50 ms -
ytm(false)           -  24 ms -
time(true)           -   0 ms -  08:39:33 
battery(true)        -  17 ms -  100  
text(true)           -   1 ms - pwsh~#@❯
text(true)           -   0 ms -  ❮
executiontime(false) -   0 ms -
exit(true)           -   0 ms -   

Run duration: 191.9048ms

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

Logs:

2022/04/05 08:39:33 Flags duration: 0s, args:
2022/04/05 08:39:33 Flags duration: 0s, args:
2022/04/05 08:39:33 debug: Getenv

2022/04/05 08:39:33 Getenv duration: 0s, args: OMP_CACHE_DISABLED
2022/04/05 08:39:33 Root duration: 0s, args:
2022/04/05 08:39:33 Shell duration: 0s, args:
2022/04/05 08:39:33 ErrorCode duration: 0s, args:
2022/04/05 08:39:33 IsWsl duration: 0s, args:
2022/04/05 08:39:33 debug: Pwd
C:\Users\peter\Projects\Project
2022/04/05 08:39:33 Pwd duration: 0s, args:
2022/04/05 08:39:33 debug: Home
C:\Users\peter
2022/04/05 08:39:33 PathSeparator duration: 0s, args:
2022/04/05 08:39:33 PathSeparator duration: 0s, args:
2022/04/05 08:39:33 PathSeparator duration: 0s, args:
2022/04/05 08:39:33 PathSeparator duration: 0s, args:
2022/04/05 08:39:33 PathSeparator duration: 0s, args:
2022/04/05 08:39:33 PathSeparator duration: 0s, args:
2022/04/05 08:39:33 PathSeparator duration: 0s, args:
2022/04/05 08:39:33 PathSeparator duration: 0s, args:
2022/04/05 08:39:33 PathSeparator duration: 0s, args:
2022/04/05 08:39:33 PathSeparator duration: 0s, args:
2022/04/05 08:39:33 PathSeparator duration: 0s, args:
2022/04/05 08:39:33 PathSeparator duration: 0s, args:
2022/04/05 08:39:33 User duration: 0s, args:
2022/04/05 08:39:33 Host duration: 0s, args:
2022/04/05 08:39:33 GOOS duration: 0s, args:
2022/04/05 08:39:33 TemplateCache duration: 0s, args:
2022/04/05 08:39:33 debug: Pwd
C:\Users\peter\Projects\Project
2022/04/05 08:39:33 Pwd duration: 0s, args:
2022/04/05 08:39:33 debug: Home
C:\Users\peter
2022/04/05 08:39:33 GOOS duration: 0s, args:
2022/04/05 08:39:33 TemplateCache duration: 0s, args:
2022/04/05 08:39:33 debug: Pwd
C:\Users\peter\Projects\Project
2022/04/05 08:39:33 Pwd duration: 0s, args:
2022/04/05 08:39:33 debug: Home
C:\Users\peter
2022/04/05 08:39:33 debug: Getenv

2022/04/05 08:39:33 Getenv duration: 0s, args: SSH_CONNECTION
2022/04/05 08:39:33 debug: Getenv

2022/04/05 08:39:33 Getenv duration: 0s, args: SSH_CLIENT
2022/04/05 08:39:33 TemplateCache duration: 0s, args:
2022/04/05 08:39:33 debug: Pwd
C:\Users\peter\Projects\Project
2022/04/05 08:39:33 Pwd duration: 0s, args:
2022/04/05 08:39:33 debug: Home
C:\Users\peter
2022/04/05 08:39:33 debug: Pwd
C:\Users\peter\Projects\Project
2022/04/05 08:39:33 Pwd duration: 0s, args:
2022/04/05 08:39:33 Flags duration: 0s, args:
2022/04/05 08:39:33 debug: Pwd
C:\Users\peter\Projects\Project
2022/04/05 08:39:33 Pwd duration: 0s, args:
2022/04/05 08:39:33 debug: Home
C:\Users\peter
2022/04/05 08:39:33 GOOS duration: 0s, args:
2022/04/05 08:39:33 GOOS duration: 0s, args:
2022/04/05 08:39:33 PathSeparator duration: 0s, args:
2022/04/05 08:39:33 PathSeparator duration: 0s, args:
2022/04/05 08:39:33 Flags duration: 0s, args:
2022/04/05 08:39:33 debug: Pwd
C:\Users\peter\Projects\Project
2022/04/05 08:39:33 Pwd duration: 0s, args:
2022/04/05 08:39:33 debug: Home
C:\Users\peter
2022/04/05 08:39:33 GOOS duration: 0s, args:
2022/04/05 08:39:33 GOOS duration: 0s, args:
2022/04/05 08:39:33 PathSeparator duration: 0s, args:
2022/04/05 08:39:33 PathSeparator duration: 0s, args:
2022/04/05 08:39:33 GOOS duration: 0s, args:
2022/04/05 08:39:33 IsWsl duration: 0s, args:
2022/04/05 08:39:33 StackCount duration: 0s, args:
2022/04/05 08:39:33 TemplateCache duration: 0s, args:
2022/04/05 08:39:33 debug: Pwd
C:\Users\peter\Projects\Project
2022/04/05 08:39:33 Pwd duration: 0s, args:
2022/04/05 08:39:33 debug: Home
C:\Users\peter
2022/04/05 08:39:33 GOOS duration: 0s, args:
2022/04/05 08:39:33 HasCommand duration: 28.4367ms, args: git.exe
2022/04/05 08:39:33 debug: Pwd
C:\Users\peter\Projects\Project
2022/04/05 08:39:33 Pwd duration: 0s, args:
2022/04/05 08:39:33 error: HasParentFilePath
CreateFile C:\.git: The system cannot find the file specified.
2022/04/05 08:39:33 HasParentFilePath duration: 984.7µs, args: .git
2022/04/05 08:39:33 debug: Pwd
C:\Users\peter\Projects\Project
2022/04/05 08:39:33 Pwd duration: 0s, args:
2022/04/05 08:39:33 PathSeparator duration: 0s, args:
2022/04/05 08:39:33 HasFiles duration: 0s, args: package.json
2022/04/05 08:39:33 FileContent duration: 0s, args: package.json
2022/04/05 08:39:33 debug: Pwd
C:\Users\peter\Projects\Project
2022/04/05 08:39:33 Pwd duration: 0s, args:
2022/04/05 08:39:33 debug: Home
C:\Users\peter
2022/04/05 08:39:33 debug: Pwd
C:\Users\peter\Projects\Project
2022/04/05 08:39:33 Pwd duration: 0s, args:
2022/04/05 08:39:33 PathSeparator duration: 0s, args:
2022/04/05 08:39:33 HasFiles duration: 0s, args: package.json
2022/04/05 08:39:33 TemplateCache duration: 0s, args:
2022/04/05 08:39:33 debug: Pwd
C:\Users\peter\Projects\Project
2022/04/05 08:39:33 Pwd duration: 0s, args:
2022/04/05 08:39:33 debug: Home
C:\Users\peter
2022/04/05 08:39:33 debug: Pwd
C:\Users\peter\Projects\Project
2022/04/05 08:39:33 Pwd duration: 0s, args:
2022/04/05 08:39:33 debug: Home
C:\Users\peter
2022/04/05 08:39:33 debug: Pwd
C:\Users\peter\Projects\Project
2022/04/05 08:39:33 Pwd duration: 0s, args:
2022/04/05 08:39:33 PathSeparator duration: 0s, args:
2022/04/05 08:39:33 HasFiles duration: 986.4µs, args: *.js
2022/04/05 08:39:33 HasCommand duration: 26.9989ms, args: node
2022/04/05 08:39:33 debug: RunCommand
v17.8.0
2022/04/05 08:39:33 RunCommand duration: 35.9229ms, args: node --version
2022/04/05 08:39:33 TemplateCache duration: 0s, args:
2022/04/05 08:39:33 error: FileContent
open .nvmrc: The system cannot find the file specified.
2022/04/05 08:39:33 FileContent duration: 560µs, args: .nvmrc
2022/04/05 08:39:33 TemplateCache duration: 0s, args:
2022/04/05 08:39:33 debug: Pwd
C:\Users\peter\Projects\Project
2022/04/05 08:39:33 Pwd duration: 0s, args:
2022/04/05 08:39:33 debug: Home
C:\Users\peter
2022/04/05 08:39:33 debug: Pwd
C:\Users\peter\Projects\Project
2022/04/05 08:39:33 Pwd duration: 0s, args:
2022/04/05 08:39:33 debug: Home
C:\Users\peter
2022/04/05 08:39:33 debug: Pwd
C:\Users\peter\Projects\Project
2022/04/05 08:39:33 Pwd duration: 0s, args:
2022/04/05 08:39:33 PathSeparator duration: 0s, args:
2022/04/05 08:39:33 HasFiles duration: 509.9µs, args: *.php
2022/04/05 08:39:33 debug: Pwd
C:\Users\peter\Projects\Project
2022/04/05 08:39:33 Pwd duration: 0s, args:
2022/04/05 08:39:33 PathSeparator duration: 0s, args:
2022/04/05 08:39:33 HasFiles duration: 0s, args: composer.json
2022/04/05 08:39:33 debug: Pwd
C:\Users\peter\Projects\Project
2022/04/05 08:39:33 Pwd duration: 0s, args:
2022/04/05 08:39:33 PathSeparator duration: 0s, args:
2022/04/05 08:39:33 HasFiles duration: 0s, args: composer.lock
2022/04/05 08:39:33 debug: Pwd
C:\Users\peter\Projects\Project
2022/04/05 08:39:33 Pwd duration: 0s, args:
2022/04/05 08:39:33 PathSeparator duration: 0s, args:
2022/04/05 08:39:33 HasFiles duration: 0s, args: .php-version
2022/04/05 08:39:33 debug: Pwd
C:\Users\peter\Projects\Project
2022/04/05 08:39:33 Pwd duration: 0s, args:
2022/04/05 08:39:33 PathSeparator duration: 0s, args:
2022/04/05 08:39:33 HasFiles duration: 0s, args: blade.php
2022/04/05 08:39:33 debug: Pwd
C:\Users\peter\Projects\Project
2022/04/05 08:39:33 Pwd duration: 0s, args:
2022/04/05 08:39:33 debug: Home
C:\Users\peter
2022/04/05 08:39:33 debug: Pwd
C:\Users\peter\Projects\Project
2022/04/05 08:39:33 Pwd duration: 0s, args:
2022/04/05 08:39:33 debug: Home
C:\Users\peter
2022/04/05 08:39:33 debug: Getenv

2022/04/05 08:39:33 Getenv duration: 0s, args: VIRTUAL_ENV
2022/04/05 08:39:33 debug: Getenv

2022/04/05 08:39:33 Getenv duration: 0s, args: CONDA_ENV_PATH
2022/04/05 08:39:33 debug: Getenv

2022/04/05 08:39:33 Getenv duration: 0s, args: CONDA_DEFAULT_ENV
2022/04/05 08:39:33 debug: Getenv

2022/04/05 08:39:33 Getenv duration: 0s, args: PYENV_VERSION
2022/04/05 08:39:33 debug: Pwd
C:\Users\peter\Projects\Project
2022/04/05 08:39:33 Pwd duration: 0s, args:
2022/04/05 08:39:33 debug: Home
C:\Users\peter
2022/04/05 08:39:33 debug: Pwd
C:\Users\peter\Projects\Project
2022/04/05 08:39:33 Pwd duration: 0s, args:
2022/04/05 08:39:33 debug: Home
C:\Users\peter
2022/04/05 08:39:33 debug: Pwd
C:\Users\peter\Projects\Project
2022/04/05 08:39:33 Pwd duration: 0s, args:
2022/04/05 08:39:33 PathSeparator duration: 0s, args:
2022/04/05 08:39:33 HasFiles duration: 0s, args: *.cs
2022/04/05 08:39:33 debug: Pwd
C:\Users\peter\Projects\Project
2022/04/05 08:39:33 Pwd duration: 0s, args:
2022/04/05 08:39:33 PathSeparator duration: 0s, args:
2022/04/05 08:39:33 HasFiles duration: 586.4µs, args: *.csx
2022/04/05 08:39:33 debug: Pwd
C:\Users\peter\Projects\Project
2022/04/05 08:39:33 Pwd duration: 0s, args:
2022/04/05 08:39:33 PathSeparator duration: 0s, args:
2022/04/05 08:39:33 HasFiles duration: 0s, args: *.vb
2022/04/05 08:39:33 debug: Pwd
C:\Users\peter\Projects\Project
2022/04/05 08:39:33 Pwd duration: 0s, args:
2022/04/05 08:39:33 PathSeparator duration: 0s, args:
2022/04/05 08:39:33 HasFiles duration: 0s, args: *.sln
2022/04/05 08:39:33 debug: Pwd
C:\Users\peter\Projects\Project
2022/04/05 08:39:33 Pwd duration: 0s, args:
2022/04/05 08:39:33 PathSeparator duration: 0s, args:
2022/04/05 08:39:33 HasFiles duration: 0s, args: *.csproj
2022/04/05 08:39:33 debug: Pwd
C:\Users\peter\Projects\Project
2022/04/05 08:39:33 Pwd duration: 0s, args:
2022/04/05 08:39:33 PathSeparator duration: 0s, args:
2022/04/05 08:39:33 HasFiles duration: 510.9µs, args: *.vbproj
2022/04/05 08:39:33 debug: Pwd
C:\Users\peter\Projects\Project
2022/04/05 08:39:33 Pwd duration: 0s, args:
2022/04/05 08:39:33 PathSeparator duration: 0s, args:
2022/04/05 08:39:33 HasFiles duration: 0s, args: *.fs
2022/04/05 08:39:33 debug: Pwd
C:\Users\peter\Projects\Project
2022/04/05 08:39:33 Pwd duration: 0s, args:
2022/04/05 08:39:33 PathSeparator duration: 0s, args:
2022/04/05 08:39:33 HasFiles duration: 0s, args: *.fsx
2022/04/05 08:39:33 debug: Pwd
C:\Users\peter\Projects\Project
2022/04/05 08:39:33 Pwd duration: 0s, args:
2022/04/05 08:39:33 PathSeparator duration: 0s, args:
2022/04/05 08:39:33 HasFiles duration: 0s, args: *.fsproj
2022/04/05 08:39:33 debug: Pwd
C:\Users\peter\Projects\Project
2022/04/05 08:39:33 Pwd duration: 0s, args:
2022/04/05 08:39:33 PathSeparator duration: 0s, args:
2022/04/05 08:39:33 HasFiles duration: 0s, args: global.json
2022/04/05 08:39:33 debug: Pwd
C:\Users\peter\Projects\Project
2022/04/05 08:39:33 Pwd duration: 0s, args:
2022/04/05 08:39:33 debug: Home
C:\Users\peter
2022/04/05 08:39:33 error: QueryWindowTitles
no matching window title found
2022/04/05 08:39:33 WindowTitle duration: 26.6014ms, args: ^(Spotify.*)|(.*\s-\s.*)$
2022/04/05 08:39:33 error: QueryWindowTitles
no matching window title found
2022/04/05 08:39:33 WindowTitle duration: 23.9993ms, args: ^(Spotify.*)
2022/04/05 08:39:33 debug: Pwd
C:\Users\peter\Projects\Project
2022/04/05 08:39:33 Pwd duration: 0s, args:
2022/04/05 08:39:33 debug: Home
C:\Users\peter
2022/04/05 08:39:33 error: HTTPRequest
Get "http://127.0.0.1:9863/query": context deadline exceeded
2022/04/05 08:39:33 HTTPRequest duration: 24.7663ms, args: http://127.0.0.1:9863/query
2022/04/05 08:39:33 debug: Pwd
C:\Users\peter\Projects\Project
2022/04/05 08:39:33 Pwd duration: 0s, args:
2022/04/05 08:39:33 debug: Home
C:\Users\peter
2022/04/05 08:39:33 TemplateCache duration: 0s, args:
2022/04/05 08:39:33 debug: Pwd
C:\Users\peter\Projects\Project
2022/04/05 08:39:33 Pwd duration: 0s, args:
2022/04/05 08:39:33 debug: Home
C:\Users\peter
2022/04/05 08:39:33 IsWsl duration: 0s, args:
2022/04/05 08:39:33 BatteryInfo duration: 17.0059ms, args:
2022/04/05 08:39:33 TemplateCache duration: 0s, args:
2022/04/05 08:39:33 TemplateCache duration: 0s, args:
2022/04/05 08:39:33 debug: Pwd
C:\Users\peter\Projects\Project
2022/04/05 08:39:33 Pwd duration: 0s, args:
2022/04/05 08:39:33 debug: Home
C:\Users\peter
2022/04/05 08:39:33 TemplateCache duration: 0s, args:
2022/04/05 08:39:33 debug: Pwd
C:\Users\peter\Projects\Project
2022/04/05 08:39:33 Pwd duration: 0s, args:
2022/04/05 08:39:33 debug: Home
C:\Users\peter
2022/04/05 08:39:33 TemplateCache duration: 0s, args:
2022/04/05 08:39:33 debug: Pwd
C:\Users\peter\Projects\Project
2022/04/05 08:39:33 Pwd duration: 0s, args:
2022/04/05 08:39:33 debug: Home
C:\Users\peter
2022/04/05 08:39:33 ExecutionTime duration: 0s, args:
2022/04/05 08:39:33 debug: Pwd
C:\Users\peter\Projects\Project
2022/04/05 08:39:33 Pwd duration: 0s, args:
2022/04/05 08:39:33 debug: Home
C:\Users\peter
2022/04/05 08:39:33 ErrorCode duration: 0s, args:
2022/04/05 08:39:33 TemplateCache duration: 0s, args:
2022/04/05 08:39:33 TemplateCache duration: 0s, args:
2022/04/05 08:39:33 debug: Getenv
C:\Users\peter\AppData\Local
2022/04/05 08:39:33 Getenv duration: 0s, args: LOCALAPPDATA
2022/04/05 08:39:33 CachePath duration: 0s, args:
JanDeDobbeleer commented 2 years ago

@neradp can you show me the actual error? The logs do not indicate this.

neradp commented 2 years ago

obrázok

JanDeDobbeleer commented 2 years ago

@neradp I do see this:

2022/04/05 08:39:33 HasFiles duration: 0s, args: package.json
2022/04/05 08:39:33 FileContent duration: 0s, args: package.json

Which could imply the package.json is broken. I'm guessing that one is going to be the issue as .Error is not empty. Can you get me the contents of that file?

neradp commented 2 years ago

File is ok. cmd, bash gives the expected result. Problem is only in pwsh or powershell.

{ "name": "Project", "version": "1.0.0", "description": "", "private": true, "scripts": { "test": "echo \"Error: no test specified\" && exit 1", "build": "npx webpack --env production", "serve-dev": "npx webpack serve --env development", "serve-prod": "npx webpack serve --env production" }, "author": "", "license": "MIT", "dependencies": { "geodesy": "^2.2.1", "react": "^17.0.2", "react-dom": "^17.0.2", "react-error-boundary": "^3.1.3", "react-live-clock": "^5.2.0", "semantic-ui-css": "^2.4.1", "semantic-ui-react": "^2.0.3" }, "devDependencies": { "@types/geodesy": "^2.2.2", "@types/react": "^17.0.11", "@types/react-dom": "^17.0.7", "@typescript-eslint/eslint-plugin": "^4.27.0", "@typescript-eslint/parser": "^4.27.0", "browserslist": "^4.16.6", "css-loader": "^5.2.6", "eslint": "^7.29.0", "eslint-plugin-react": "^7.24.0", "eslint-plugin-react-hooks": "^4.2.0", "eslint-webpack-plugin": "^2.5.4", "file-loader": "^6.2.0", "mini-css-extract-plugin": "^1.6.0", "pattern-replace-loader": "^1.0.5", "sass": "^1.34.1", "sass-loader": "^12.1.0", "style-loader": "^2.0.0", "stylelint": "^13.13.1", "stylelint-config-standard": "^22.0.0", "stylelint-webpack-plugin": "^2.2.1", "ts-loader": "^9.2.3", "typescript": "^4.3.2", "webpack": "^5.40.0", "webpack-cli": "^4.7.2", "webpack-dev-server": "^4.3.0", "webpack-userscript": "^2.5.8" } }

JanDeDobbeleer commented 2 years ago

@neradp hmm. There's no difference when it comes to oh-my-posh for getting file content in bash or cmd (unless that uses a different version). It's indeed correct, so I have no clue whatsoever what exactly is going on here without additional logging

neradp commented 2 years ago

How i can help ?

JanDeDobbeleer commented 2 years ago

@neradp the latest version will log the file contents as well. That we can make sure we're not under false assumptions.

neradp commented 2 years ago

I will do some recapitulation:

1, Segment Project not working in Powershell 🗡️ 2, Debugging with Write-PoshDebug function not working in Powershell (Powershell stops responding) . 3, Debugging with command oh-my-posh debug in Powershell show correct results: segment Project is generated fine, logged file content is ok.

JanDeDobbeleer commented 2 years ago

@neradp if that's true, the oh-my-posh executable and PowerShell aren't in sync. As that can't be true otherwise. How did you install in PowerShell/elsewhere?

neradp commented 2 years ago

1, install-amd64.exe 2, notepad $PROFILE

oh-my-posh init pwsh --config ~/oh-my-posh.json | Invoke-Expression

JanDeDobbeleer commented 2 years ago

@neradp it seems write-poshdebug had an issue, fixing that in #2036 but oh-my-posh debug does the same. It's only a simple wrapper nowadays). There's 2 things:

neradp commented 2 years ago

I did update to 7.59.1 , write-posdebug not working...

`pwsh~#@❯ oh-my-posh debug ❮  

Version: 7.59.1

Segments:

ConsoleTitle(true) - 0 ms - pwsh :: cardano os(true) - 0 ms -    session(true) - 0 ms - peterDESKTOP-MISBF7F  path(true) - 0 ms -      cardano git(false) - 29 ms - project(true) - 1 ms -   1.0.0 cardano node(true) - 78 ms -  17.8.0  php(false) - 0 ms - python(false) - 0 ms - dotnet(false) - 1 ms - spotify(false) - 42 ms - ytm(false) - 31 ms - time(true) - 0 ms -  20:25:07  battery(true) - 16 ms -  100   text(true) - 0 ms - pwsh~#@❯ text(true) - 0 ms - ❮ executiontime(false) - 0 ms - exit(true) - 0 ms -  

Run duration: 202.3506ms

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

Logs:

2022/04/05 20:25:07 Flags duration: 0s, args: 2022/04/05 20:25:07 Flags duration: 0s, args: 2022/04/05 20:25:07 debug: Getenv

2022/04/05 20:25:07 Getenv duration: 0s, args: OMP_CACHE_DISABLED 2022/04/05 20:25:07 Root duration: 0s, args: 2022/04/05 20:25:07 Shell duration: 0s, args: 2022/04/05 20:25:07 ErrorCode duration: 0s, args: 2022/04/05 20:25:07 IsWsl duration: 0s, args: 2022/04/05 20:25:07 debug: Pwd C:\Users\peter\Projects\cardano 2022/04/05 20:25:07 Pwd duration: 0s, args: 2022/04/05 20:25:07 debug: Home C:\Users\peter 2022/04/05 20:25:07 PathSeparator duration: 0s, args: 2022/04/05 20:25:07 PathSeparator duration: 0s, args: 2022/04/05 20:25:07 PathSeparator duration: 0s, args: 2022/04/05 20:25:07 PathSeparator duration: 0s, args: 2022/04/05 20:25:07 PathSeparator duration: 0s, args: 2022/04/05 20:25:07 PathSeparator duration: 0s, args: 2022/04/05 20:25:07 PathSeparator duration: 0s, args: 2022/04/05 20:25:07 PathSeparator duration: 0s, args: 2022/04/05 20:25:07 PathSeparator duration: 0s, args: 2022/04/05 20:25:07 debug: User peter 2022/04/05 20:25:07 User duration: 0s, args: 2022/04/05 20:25:07 debug: Host DESKTOP-MISBF7F 2022/04/05 20:25:07 Host duration: 0s, args: 2022/04/05 20:25:07 GOOS duration: 0s, args: 2022/04/05 20:25:07 TemplateCache duration: 0s, args: 2022/04/05 20:25:07 debug: Pwd C:\Users\peter\Projects\cardano 2022/04/05 20:25:07 Pwd duration: 0s, args: 2022/04/05 20:25:07 debug: Home C:\Users\peter 2022/04/05 20:25:07 GOOS duration: 0s, args: 2022/04/05 20:25:07 TemplateCache duration: 0s, args: 2022/04/05 20:25:07 debug: Pwd C:\Users\peter\Projects\cardano 2022/04/05 20:25:07 Pwd duration: 0s, args: 2022/04/05 20:25:07 debug: Home C:\Users\peter 2022/04/05 20:25:07 debug: Getenv

2022/04/05 20:25:07 Getenv duration: 0s, args: SSH_CONNECTION 2022/04/05 20:25:07 debug: Getenv

2022/04/05 20:25:07 Getenv duration: 0s, args: SSH_CLIENT 2022/04/05 20:25:07 TemplateCache duration: 0s, args: 2022/04/05 20:25:07 debug: Pwd C:\Users\peter\Projects\cardano 2022/04/05 20:25:07 Pwd duration: 0s, args: 2022/04/05 20:25:07 debug: Home C:\Users\peter 2022/04/05 20:25:07 debug: Pwd C:\Users\peter\Projects\cardano 2022/04/05 20:25:07 Pwd duration: 0s, args: 2022/04/05 20:25:07 Flags duration: 0s, args: 2022/04/05 20:25:07 debug: Pwd C:\Users\peter\Projects\cardano 2022/04/05 20:25:07 Pwd duration: 0s, args: 2022/04/05 20:25:07 debug: Home C:\Users\peter 2022/04/05 20:25:07 GOOS duration: 0s, args: 2022/04/05 20:25:07 GOOS duration: 0s, args: 2022/04/05 20:25:07 PathSeparator duration: 0s, args: 2022/04/05 20:25:07 PathSeparator duration: 0s, args: 2022/04/05 20:25:07 Flags duration: 0s, args: 2022/04/05 20:25:07 debug: Pwd C:\Users\peter\Projects\cardano 2022/04/05 20:25:07 Pwd duration: 0s, args: 2022/04/05 20:25:07 debug: Home C:\Users\peter 2022/04/05 20:25:07 GOOS duration: 0s, args: 2022/04/05 20:25:07 GOOS duration: 0s, args: 2022/04/05 20:25:07 PathSeparator duration: 0s, args: 2022/04/05 20:25:07 PathSeparator duration: 0s, args: 2022/04/05 20:25:07 GOOS duration: 0s, args: 2022/04/05 20:25:07 IsWsl duration: 0s, args: 2022/04/05 20:25:07 StackCount duration: 0s, args: 2022/04/05 20:25:07 TemplateCache duration: 0s, args: 2022/04/05 20:25:07 debug: Pwd C:\Users\peter\Projects\cardano 2022/04/05 20:25:07 Pwd duration: 0s, args: 2022/04/05 20:25:07 debug: Home C:\Users\peter 2022/04/05 20:25:07 GOOS duration: 0s, args: 2022/04/05 20:25:07 HasCommand duration: 29.749ms, args: git.exe 2022/04/05 20:25:07 debug: Pwd C:\Users\peter\Projects\cardano 2022/04/05 20:25:07 Pwd duration: 0s, args: 2022/04/05 20:25:07 error: HasParentFilePath CreateFile C:.git: The system cannot find the file specified. 2022/04/05 20:25:07 HasParentFilePath duration: 0s, args: .git 2022/04/05 20:25:07 debug: Pwd C:\Users\peter\Projects\cardano 2022/04/05 20:25:07 Pwd duration: 0s, args: 2022/04/05 20:25:07 PathSeparator duration: 0s, args: 2022/04/05 20:25:07 debug: HasFiles true 2022/04/05 20:25:07 HasFiles duration: 0s, args: package.json 2022/04/05 20:25:07 debug: FileContent { "name": "cardano", "version": "1.0.0", "description": "Cardano Random Wallet Checker", "main": "index.js", "directories": { "doc": "doc" }, "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "author": "Peter Nerád", "license": "ISC", "dependencies": { "axios": "^0.26.1", "bip39": "^3.0.4" } }

2022/04/05 20:25:07 FileContent duration: 1.0485ms, args: package.json 2022/04/05 20:25:07 debug: Pwd C:\Users\peter\Projects\cardano 2022/04/05 20:25:07 Pwd duration: 0s, args: 2022/04/05 20:25:07 debug: Home C:\Users\peter 2022/04/05 20:25:07 debug: Pwd C:\Users\peter\Projects\cardano 2022/04/05 20:25:07 Pwd duration: 0s, args: 2022/04/05 20:25:07 PathSeparator duration: 0s, args: 2022/04/05 20:25:07 debug: HasFiles true 2022/04/05 20:25:07 HasFiles duration: 0s, args: package.json 2022/04/05 20:25:07 TemplateCache duration: 0s, args: 2022/04/05 20:25:07 debug: Pwd C:\Users\peter\Projects\cardano 2022/04/05 20:25:07 Pwd duration: 0s, args: 2022/04/05 20:25:07 debug: Home C:\Users\peter 2022/04/05 20:25:07 debug: Pwd C:\Users\peter\Projects\cardano 2022/04/05 20:25:07 Pwd duration: 0s, args: 2022/04/05 20:25:07 debug: Home C:\Users\peter 2022/04/05 20:25:07 debug: Pwd C:\Users\peter\Projects\cardano 2022/04/05 20:25:07 Pwd duration: 0s, args: 2022/04/05 20:25:07 PathSeparator duration: 0s, args: 2022/04/05 20:25:07 debug: HasFiles true 2022/04/05 20:25:07 HasFiles duration: 0s, args: .js 2022/04/05 20:25:07 HasCommand duration: 32.839ms, args: node 2022/04/05 20:25:07 debug: RunCommand v17.8.0 2022/04/05 20:25:07 RunCommand duration: 44.6989ms, args: node --version 2022/04/05 20:25:07 TemplateCache duration: 0s, args: 2022/04/05 20:25:07 error: FileContent open .nvmrc: The system cannot find the file specified. 2022/04/05 20:25:07 FileContent duration: 0s, args: .nvmrc 2022/04/05 20:25:07 TemplateCache duration: 0s, args: 2022/04/05 20:25:07 debug: Pwd C:\Users\peter\Projects\cardano 2022/04/05 20:25:07 Pwd duration: 0s, args: 2022/04/05 20:25:07 debug: Home C:\Users\peter 2022/04/05 20:25:07 debug: Pwd C:\Users\peter\Projects\cardano 2022/04/05 20:25:07 Pwd duration: 0s, args: 2022/04/05 20:25:07 debug: Home C:\Users\peter 2022/04/05 20:25:07 debug: Pwd C:\Users\peter\Projects\cardano 2022/04/05 20:25:07 Pwd duration: 0s, args: 2022/04/05 20:25:07 PathSeparator duration: 0s, args: 2022/04/05 20:25:07 debug: HasFiles false 2022/04/05 20:25:07 HasFiles duration: 0s, args: .php 2022/04/05 20:25:07 debug: Pwd C:\Users\peter\Projects\cardano 2022/04/05 20:25:07 Pwd duration: 0s, args: 2022/04/05 20:25:07 PathSeparator duration: 0s, args: 2022/04/05 20:25:07 debug: HasFiles false 2022/04/05 20:25:07 HasFiles duration: 0s, args: composer.json 2022/04/05 20:25:07 debug: Pwd C:\Users\peter\Projects\cardano 2022/04/05 20:25:07 Pwd duration: 0s, args: 2022/04/05 20:25:07 PathSeparator duration: 0s, args: 2022/04/05 20:25:07 debug: HasFiles false 2022/04/05 20:25:07 HasFiles duration: 513.5µs, args: composer.lock 2022/04/05 20:25:07 debug: Pwd C:\Users\peter\Projects\cardano 2022/04/05 20:25:07 Pwd duration: 0s, args: 2022/04/05 20:25:07 PathSeparator duration: 0s, args: 2022/04/05 20:25:07 debug: HasFiles false 2022/04/05 20:25:07 HasFiles duration: 0s, args: .php-version 2022/04/05 20:25:07 debug: Pwd C:\Users\peter\Projects\cardano 2022/04/05 20:25:07 Pwd duration: 0s, args: 2022/04/05 20:25:07 PathSeparator duration: 0s, args: 2022/04/05 20:25:07 debug: HasFiles false 2022/04/05 20:25:07 HasFiles duration: 0s, args: blade.php 2022/04/05 20:25:07 debug: Pwd C:\Users\peter\Projects\cardano 2022/04/05 20:25:07 Pwd duration: 0s, args: 2022/04/05 20:25:07 debug: Home C:\Users\peter 2022/04/05 20:25:07 debug: Pwd C:\Users\peter\Projects\cardano 2022/04/05 20:25:07 Pwd duration: 0s, args: 2022/04/05 20:25:07 debug: Home C:\Users\peter 2022/04/05 20:25:07 debug: Getenv

2022/04/05 20:25:07 Getenv duration: 0s, args: VIRTUAL_ENV 2022/04/05 20:25:07 debug: Getenv

2022/04/05 20:25:07 Getenv duration: 0s, args: CONDA_ENV_PATH 2022/04/05 20:25:07 debug: Getenv

2022/04/05 20:25:07 Getenv duration: 0s, args: CONDA_DEFAULT_ENV 2022/04/05 20:25:07 debug: Getenv

2022/04/05 20:25:07 Getenv duration: 0s, args: PYENV_VERSION 2022/04/05 20:25:07 debug: Pwd C:\Users\peter\Projects\cardano 2022/04/05 20:25:07 Pwd duration: 0s, args: 2022/04/05 20:25:07 debug: Home C:\Users\peter 2022/04/05 20:25:07 debug: Pwd C:\Users\peter\Projects\cardano 2022/04/05 20:25:07 Pwd duration: 0s, args: 2022/04/05 20:25:07 debug: Home C:\Users\peter 2022/04/05 20:25:07 debug: Pwd C:\Users\peter\Projects\cardano 2022/04/05 20:25:07 Pwd duration: 0s, args: 2022/04/05 20:25:07 PathSeparator duration: 0s, args: 2022/04/05 20:25:07 debug: HasFiles false 2022/04/05 20:25:07 HasFiles duration: 0s, args: .cs 2022/04/05 20:25:07 debug: Pwd C:\Users\peter\Projects\cardano 2022/04/05 20:25:07 Pwd duration: 0s, args: 2022/04/05 20:25:07 PathSeparator duration: 0s, args: 2022/04/05 20:25:07 debug: HasFiles false 2022/04/05 20:25:07 HasFiles duration: 0s, args: .csx 2022/04/05 20:25:07 debug: Pwd C:\Users\peter\Projects\cardano 2022/04/05 20:25:07 Pwd duration: 0s, args: 2022/04/05 20:25:07 PathSeparator duration: 0s, args: 2022/04/05 20:25:07 debug: HasFiles false 2022/04/05 20:25:07 HasFiles duration: 0s, args: .vb 2022/04/05 20:25:07 debug: Pwd C:\Users\peter\Projects\cardano 2022/04/05 20:25:07 Pwd duration: 0s, args: 2022/04/05 20:25:07 PathSeparator duration: 0s, args: 2022/04/05 20:25:07 debug: HasFiles false 2022/04/05 20:25:07 HasFiles duration: 523µs, args: .sln 2022/04/05 20:25:07 debug: Pwd C:\Users\peter\Projects\cardano 2022/04/05 20:25:07 Pwd duration: 0s, args: 2022/04/05 20:25:07 PathSeparator duration: 0s, args: 2022/04/05 20:25:07 debug: HasFiles false 2022/04/05 20:25:07 HasFiles duration: 0s, args: .csproj 2022/04/05 20:25:07 debug: Pwd C:\Users\peter\Projects\cardano 2022/04/05 20:25:07 Pwd duration: 0s, args: 2022/04/05 20:25:07 PathSeparator duration: 0s, args: 2022/04/05 20:25:07 debug: HasFiles false 2022/04/05 20:25:07 HasFiles duration: 0s, args: .vbproj 2022/04/05 20:25:07 debug: Pwd C:\Users\peter\Projects\cardano 2022/04/05 20:25:07 Pwd duration: 0s, args: 2022/04/05 20:25:07 PathSeparator duration: 0s, args: 2022/04/05 20:25:07 debug: HasFiles false 2022/04/05 20:25:07 HasFiles duration: 0s, args: .fs 2022/04/05 20:25:07 debug: Pwd C:\Users\peter\Projects\cardano 2022/04/05 20:25:07 Pwd duration: 0s, args: 2022/04/05 20:25:07 PathSeparator duration: 0s, args: 2022/04/05 20:25:07 debug: HasFiles false 2022/04/05 20:25:07 HasFiles duration: 527.6µs, args: .fsx 2022/04/05 20:25:07 debug: Pwd C:\Users\peter\Projects\cardano 2022/04/05 20:25:07 Pwd duration: 0s, args: 2022/04/05 20:25:07 PathSeparator duration: 0s, args: 2022/04/05 20:25:07 debug: HasFiles false 2022/04/05 20:25:07 HasFiles duration: 0s, args: *.fsproj 2022/04/05 20:25:07 debug: Pwd C:\Users\peter\Projects\cardano 2022/04/05 20:25:07 Pwd duration: 0s, args: 2022/04/05 20:25:07 PathSeparator duration: 0s, args: 2022/04/05 20:25:07 debug: HasFiles false 2022/04/05 20:25:07 HasFiles duration: 0s, args: global.json 2022/04/05 20:25:07 debug: Pwd C:\Users\peter\Projects\cardano 2022/04/05 20:25:07 Pwd duration: 0s, args: 2022/04/05 20:25:07 debug: Home C:\Users\peter 2022/04/05 20:25:07 error: QueryWindowTitles no matching window title found

2022/04/05 20:25:07 WindowTitle duration: 23.1858ms, args: ^(Spotify.)|(.\s-\s.*)$ 2022/04/05 20:25:07 error: QueryWindowTitles no matching window title found

2022/04/05 20:25:07 WindowTitle duration: 18.8884ms, args: ^(Spotify.*) 2022/04/05 20:25:07 debug: Pwd C:\Users\peter\Projects\cardano 2022/04/05 20:25:07 Pwd duration: 0s, args: 2022/04/05 20:25:07 debug: Home C:\Users\peter 2022/04/05 20:25:07 error: HTTPRequest Get "http://127.0.0.1:9863/query": context deadline exceeded 2022/04/05 20:25:07 HTTPRequest duration: 31.2015ms, args: http://127.0.0.1:9863/query 2022/04/05 20:25:07 debug: Pwd C:\Users\peter\Projects\cardano 2022/04/05 20:25:07 Pwd duration: 0s, args: 2022/04/05 20:25:07 debug: Home C:\Users\peter 2022/04/05 20:25:07 TemplateCache duration: 0s, args: 2022/04/05 20:25:07 debug: Pwd C:\Users\peter\Projects\cardano 2022/04/05 20:25:07 Pwd duration: 0s, args: 2022/04/05 20:25:07 debug: Home C:\Users\peter 2022/04/05 20:25:07 IsWsl duration: 0s, args: 2022/04/05 20:25:07 BatteryInfo duration: 14.6179ms, args: 2022/04/05 20:25:07 TemplateCache duration: 0s, args: 2022/04/05 20:25:07 TemplateCache duration: 0s, args: 2022/04/05 20:25:07 debug: Pwd C:\Users\peter\Projects\cardano 2022/04/05 20:25:07 Pwd duration: 0s, args: 2022/04/05 20:25:07 debug: Home C:\Users\peter 2022/04/05 20:25:07 TemplateCache duration: 0s, args: 2022/04/05 20:25:07 debug: Pwd C:\Users\peter\Projects\cardano 2022/04/05 20:25:07 Pwd duration: 0s, args: 2022/04/05 20:25:07 debug: Home C:\Users\peter 2022/04/05 20:25:07 TemplateCache duration: 0s, args: 2022/04/05 20:25:07 debug: Pwd C:\Users\peter\Projects\cardano 2022/04/05 20:25:07 Pwd duration: 0s, args: 2022/04/05 20:25:07 debug: Home C:\Users\peter 2022/04/05 20:25:07 ExecutionTime duration: 0s, args: 2022/04/05 20:25:07 debug: Pwd C:\Users\peter\Projects\cardano 2022/04/05 20:25:07 Pwd duration: 0s, args: 2022/04/05 20:25:07 debug: Home C:\Users\peter 2022/04/05 20:25:07 ErrorCode duration: 0s, args: 2022/04/05 20:25:07 TemplateCache duration: 0s, args: 2022/04/05 20:25:07 TemplateCache duration: 0s, args: 2022/04/05 20:25:07 debug: Getenv C:\Users\peter\AppData\Local 2022/04/05 20:25:07 Getenv duration: 0s, args: LOCALAPPDATA 2022/04/05 20:25:07 CachePath duration: 0s, args:`

lnu commented 2 years ago

Found out the issue with pwsh(on macos in my case). The project segment does not take into account the PWD variable correctly.
Still have to find why, but reading a file with a relative path does not work in that case. With pwsh, it tries to read the file from the home, but in other shells it reads the file from the current path.

lnu commented 2 years ago

@neradp can you confirm it works for you as well?

neradp commented 2 years ago

I can confirm that: Project segment is working now, function write-poshdebug is not.

JanDeDobbeleer commented 2 years ago

@neradp I'm going to remove that cmdlet. No idea why it hangs, and no real use-case anymore.

lnu commented 2 years ago

strange, even write-poshdebug works on my side with the fix.

batu1579 commented 2 years ago

@JanDeDobbeleer I'm having the same problem, but it works fine when I use the following command to preview

oh-my-posh print primary --config ~/.M365Princess_batu.json --shell uni

I'm not sure if this will help, and here are my configerations


        {
          "background": "#86BBD8",
          "foreground": "#ffffff",
          "powerline_symbol": "\ue0b0",
          "style": "powerline",
          "template": " {{ if .Error }}{{ .Error }}{{ else }}{{ if .Version }}\uf487 {{.Version}}{{ end }}{{ end }} ",
          "type": "project"
        }
batu1579 commented 2 years ago

@JanDeDobbeleer I just opened the terminal as the administrator and solved it unexpectedly. Is it possible because of the permission problem?

lnu commented 2 years ago

@JanDeDobbeleer I just opened the terminal as the administrator and solved it unexpectedly. Is it possible because of the permission problem?

did you reload your shell after update? I don't see a link between being admin and the bug being resolved

JanDeDobbeleer commented 2 years ago

@batu1579 no. More probable that you updated and a shell reload was required.

batu1579 commented 2 years ago

@lnu Its pretty weird, I used a plugin called Gsudo to temporarily increase permissions. I don't think it's relevant, but it does work...

image

lnu commented 2 years ago

@lnu Its pretty weird, I used a plugin called Gsudo to temporarily increase permissions. I don't think it's relevant, but it does work...

image

The issue was related to the path not being used correctly. Are you on the latest version of omp? Did you reload your "simple" user session? Because calling sudo will start a new shell and fix the issue as @JanDeDobbeleer said.

batu1579 commented 2 years ago

Yeah, you're right. I manually opened a terminal as an administrator, and again the problem occurred because the sudo plugin opened a new shell. I just updated omp and found the problem fixed. It's my fault. I'm sorry for the trouble, orz

github-actions[bot] commented 8 months ago

This issue has been automatically locked since there has not been any recent activity (i.e. last half year) after it was closed. It helps our maintainers focus on the active issues. If you have found a problem that seems similar, please open a discussion first, complete the body with all the details necessary to reproduce, and mention this issue as reference.