JanDeDobbeleer / oh-my-posh

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

Pressing enter with no commands takes 1.5 seconds to come back #4087

Closed meza closed 1 year ago

meza commented 1 year ago

Code of Conduct

What happened?

Pressing enter with no commands takes 1.5 seconds to come back

Theme

{
  "$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
  "version": 2,
  "final_space": true,
  "console_title_template": "{{.PWD}}",
  "blocks": [
    {
      "type": "prompt",
      "alignment": "left",
      "segments": [
        {
          "type": "time",
          "style": "plain",
          "template": "<#06989a>[<#cc0000>{{ .CurrentDate | date .Format }}<#06989a>]",
          "properties": {
            "time_format": "15:04:05"
          }
        },
        {
          "type": "path",
          "style": "plain",
          "foreground": "#06989a",
          "template": "[{{ .Path }}] ",
          "properties": {
            "style": "full"
          }
        },
        {
          "type": "executiontime",
          "style": "plain",
          "foreground": "#06989a",
          "template": "(<#fefefe></> {{ .FormattedMs }}) ",
          "properties": {
            "threshold": 500,
            "style": "austin",
            "always_enabled": true
          }
        },
        {
          "type": "git",
          "style": "plain",
          "foreground": "#C2C206",
          "template": "{{ if .Working.Untracked }}<#CB4B16>{{ else }}{{ if .Working.Changed }}<#CB4B16>{{ else }}{{ if .Staging }}<#729fcf>{{ else }}{{ if .Ahead }}<#8ae234>{{ end }}{{ end }}{{ end }}{{ end }}{{ .UpstreamIcon }}{{ .HEAD }} {{ if .Working.Changed }}  {{ .Working.String }}{{ end }}{{ if and (.Working.Changed) (.Staging.Changed) }} |{{ end }}{{ if .Staging.Changed }}  {{ .Staging.String }}{{ end }}{{ if gt .StashCount 0 }}  {{ .StashCount }}{{ end }}",
          "properties": {
            "fetch_status": true,
            "fetch_stash_count": false,
            "fetch_upstream_icon": true
          }
        },
        {
          "type": "root",
          "style": "plain",
          "foreground": "#B5B50D",
          "template": " \uf0e7 "
        }
      ]
    },
    {
      "type": "prompt",
      "alignment": "left",
      "segments": [
        {
          "type": "text",
          "style": "plain",
          "foreground": "#007ACC",
          "template": "\ue602 "
        }
      ],
      "newline": false
    }
  ]
}

What OS are you seeing the problem on?

Windows

Which shell are you using?

powershell

Log output

Version: 17.12.1

Shell: pwsh (7.3.6)

Segments:

ConsoleTitle(true)                         -   2 ms - ~
time(true)                                 -   0 ms - [20:01:23]
path(true)                                 -   0 ms - [~] 
executiontime(true)                        -   0 ms - (¯«ó 0ms) 
git(false)                                 -  13 ms - 
root(false)                                -   0 ms - 
text(true)                                 -   0 ms - ¯ÿé 

Run duration: 579.0175ms

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

Config path: C:\Users\meza\.mytheme.omp.json

Logs:

[DEBUG] 20:01:23.361 shell.go:Getenv:397  NO DATA
[TRACE] 20:01:23.361 shell.go:Getenv(TERM_PROGRAM) - 0s
[DEBUG] 20:01:23.361 shell.go:Getenv:397  C:\Users\meza\AppData\Local
[TRACE] 20:01:23.361 shell.go:Getenv(LOCALAPPDATA) - 0s
[TRACE] 20:01:23.361 shell_windows.go:CachePath() - 0s
[DEBUG] 20:01:23.361 shell.go:Getenv:397  C:\Users\meza\.mytheme.omp.json
[TRACE] 20:01:23.361 shell.go:Getenv(POSH_THEME) - 0s
[DEBUG] 20:01:23.921 shell.go:Shell:644  process name: pwsh.exe
[TRACE] 20:01:23.921 shell.go:Shell() - 559.2777ms
[TRACE] 20:01:23.921 shell.go:resolveConfigPath() - 559.2777ms
[TRACE] 20:01:23.921 shell.go:Init() - 559.7775ms
[TRACE] 20:01:23.921 shell.go:Flags() - 0s
[TRACE] 20:01:23.921 config.go:loadConfig() - 502.5┬Ás
[TRACE] 20:01:23.921 shell.go:Flags() - 0s
[DEBUG] 20:01:23.921 shell.go:Getenv:397  NO DATA
[TRACE] 20:01:23.921 shell.go:Getenv(OMP_CACHE_DISABLED) - 0s
[TRACE] 20:01:23.921 shell_windows.go:WindowsRegistryKeyValue(HKEY_CURRENT_USER\Software\Microsoft\Windows\DWM\ColorizationColor) - 0s
[TRACE] 20:01:23.921 shell.go:GOOS() - 0s
[TRACE] 20:01:23.921 shell.go:GOOS() - 0s
[TRACE] 20:01:23.921 shell.go:GOOS() - 0s
[TRACE] 20:01:23.921 shell.go:GOOS() - 0s
[TRACE] 20:01:23.921 shell.go:GOOS() - 0s
[TRACE] 20:01:23.921 shell.go:GOOS() - 0s
[TRACE] 20:01:23.921 shell.go:GOOS() - 0s
[TRACE] 20:01:23.921 shell.go:GOOS() - 0s
[TRACE] 20:01:23.921 shell.go:GOOS() - 0s
[TRACE] 20:01:23.921 shell.go:GOOS() - 0s
[TRACE] 20:01:23.921 shell.go:GOOS() - 0s
[TRACE] 20:01:23.921 shell.go:GOOS() - 0s
[TRACE] 20:01:23.921 shell.go:GOOS() - 0s
[TRACE] 20:01:23.921 shell.go:GOOS() - 0s
[TRACE] 20:01:23.921 shell.go:GOOS() - 0s
[TRACE] 20:01:23.921 shell.go:GOOS() - 0s
[TRACE] 20:01:23.921 shell.go:GOOS() - 0s
[TRACE] 20:01:23.921 shell.go:GOOS() - 0s
[TRACE] 20:01:23.921 shell.go:GOOS() - 0s
[DEBUG] 20:01:23.921 shell_windows.go:WindowsRegistryKeyValue:206  ColorizationColor(DWORD): 0xC40078D4
[TRACE] 20:01:23.922 shell.go:Shell() - 0s
[DEBUG] 20:01:23.922 shell.go:Getenv:397  7.3.6
[TRACE] 20:01:23.922 shell.go:Getenv(POSH_SHELL_VERSION) - 0s
[DEBUG] 20:01:23.922 debug.go:PrintDebug:23  Segment: Title
[TRACE] 20:01:23.922 shell_windows.go:Root() - 0s
[TRACE] 20:01:23.922 shell.go:Shell() - 0s
[TRACE] 20:01:23.922 shell.go:ErrorCode() - 0s
[TRACE] 20:01:23.922 shell_windows.go:IsWsl() - 0s
[DEBUG] 20:01:23.923 shell.go:TemplateCache:814  environment: [ALLUSERSPROFILE=C:\ProgramData APPDATA=C:\Users\meza\AppData\Roaming ChocolateyInstall=C:\ProgramData\chocolatey ChocolateyLastPathUpdate=132881040388810709 CommonProgramFiles=C:\Program Files\Common Files CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files CommonProgramW6432=C:\Program Files\Common Files COMPUTERNAME=MEZA-PC ComSpec=C:\WINDOWS\system32\cmd.exe CONDA_PROMPT_MODIFIER=False DriverData=C:\Windows\System32\Drivers\DriverData FPS_BROWSER_APP_PROFILE_STRING=Internet Explorer FPS_BROWSER_USER_PROFILE_STRING=Default GOPATH=C:\Users\meza\go HOMEDRIVE=C: HOMEPATH=\Users\meza INTEL_DEV_REDIST=C:\Program Files (x86)\Common Files\Intel\Shared Libraries\ IntelliJ IDEA=C:\Program Files\JetBrains\IntelliJ IDEA 2020.2\bin; JAVA_HOME=C:\Program Files\Java\jdk-17.0.1 LOCALAPPDATA=C:\Users\meza\AppData\Local LOGONSERVER=\\MEZA-PC MIC_LD_LIBRARY_PATH=C:\Program Files (x86)\Common Files\Intel\Shared Libraries\compiler\lib\mic N_PREFIX=F:\Dev\node-installations NUMBER_OF_PROCESSORS=24 NVAFX_SDK_DIR=C:\Program Files\NVIDIA Corporation\NVIDIA Audio Effects SDK NVAR_MODEL_DIR=C:\Program Files\NVIDIA Corporation\NVIDIA AR SDK\models NVM_HOME=C:\Users\meza\AppData\Roaming\nvm NVM_SYMLINK=C:\Program Files\nodejs NVVFX_MODEL_DIR=C:\Program Files\NVIDIA Corporation\NVIDIA Video Effects\models OneDrive=C:\Users\meza\OneDrive OneDriveConsumer=C:\Users\meza\OneDrive OS=Windows_NT Path=C:\Program Files\PowerShell\7;C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.17.11461.0_x64__8wekyb3d8bbwe;c:\program files\windowsapps\microsoft.windowsterminal_1.15.2713.0_x64__8wekyb3d8bbwe;c:\python310\scripts\;c:\python310\;c:\program files (x86)\common files\intel\shared libraries\redist\intel64\compiler;c:\windows\system32;c:\windows;c:\windows\system32\wbem;c:\windows\system32\windowspowershell\v1.0\;c:\windows\system32\openssh\;c:\program files\nvidia corporation\nvidia nvdlisr;c:\program files\process lasso\;e:\program files\ffmpeg\bin;c:\program files\dotnet\;c:\program files\putty\;c:\programdata\chocolatey\bin;C:\Program Files\Git\bin\git.exe;c:\program files\git\cmd;c:\program files\go\bin;c:\program files\microsoft sql server\150\tools\binn\;c:\program files\microsoft sql server\client sdk\odbc\170\tools\binn\;c:\users\meza\appdata\local\microsoft\windowsapps;c:\program files\jetbrains\intellij idea 2020.2\bin;c:\program files (x86)\fahclient;c:\users\meza\.dotnet\tools;c:\users\meza\appdata\roaming\npm;c:\users\meza\go\bin;c:\program files\java\jdk-17.0.1\bin;e:\dev\vendor\intellij\toolbox\scripts;c:\program files (x86)\common files\acronis\snapapi\;c:\program files (x86)\common files\acronis\virtualfile\;c:\program files (x86)\common files\acronis\virtualfile64\;c:\program files (x86)\common files\acronis\fileprotector\;c:\program files (x86)\common files\acronis\fileprotector64\;c:\users\meza\appdata\roaming\nvm;c:\program files\nodejs;c:\program files\docker\docker\resources\bin;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Lumia Stream\commands;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Docker\Docker\resources\bin;C:\Program Files\PowerShell\7\;C:\Program Files\Amazon\AWSSAMCLI\bin\;C:\Users\meza\.dotnet\tools;C:\Users\meza\AppData\Roaming\nvm;C:\Program Files\nodejs;C:\Users\meza\AppData\Local\Microsoft\WindowsApps;C:\Users\meza\AppData\Local\Programs\oh-my-posh\bin PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.PY;.PYW;.CPL POSH_AZURE_ENABLED=False POSH_CURSOR_COLUMN=1 POSH_CURSOR_LINE=4 POSH_GIT_ENABLED=False POSH_INSTALLER=winget POSH_PID=1798848 POSH_SHELL_VERSION=7.3.6 POSH_THEME=C:\Users\meza\.mytheme.omp.json POSH_THEMES_PATH=C:\Users\meza\AppData\Local\Programs\oh-my-posh\themes POWERLINE_COMMAND=oh-my-posh POWERSHELL_DISTRIBUTION_CHANNEL=MSI:Windows 10 Pro PROCESSOR_ARCHITECTURE=AMD64 PROCESSOR_IDENTIFIER=AMD64 Family 23 Model 113 Stepping 0, AuthenticAMD PROCESSOR_LEVEL=23 PROCESSOR_REVISION=7100 PROG27B48B2C054=1 ProgramData=C:\ProgramData ProgramFiles=C:\Program Files ProgramFiles(x86)=C:\Program Files (x86) ProgramW6432=C:\Program Files PSModulePath=C:\Users\meza\OneDrive\Dokumentumok\PowerShell\Modules;C:\Program Files\PowerShell\Modules;c:\program files\powershell\7\Modules;C:\Program Files\WindowsPowerShell\Modules;C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules;C:\Program Files\Intel\Wired Networking\ PUBLIC=C:\Users\Public SystemDrive=C: SystemRoot=C:\WINDOWS TEMP=C:\Users\meza\AppData\Local\Temp TMP=C:\Users\meza\AppData\Local\Temp USERDOMAIN=MEZA-PC USERDOMAIN_ROAMINGPROFILE=MEZA-PC USERNAME=meza USERPROFILE=C:\Users\meza windir=C:\WINDOWS WSLENV=WT_SESSION::WT_PROFILE_ID WT_PROFILE_ID={574e775e-4f2a-5b96-ac1e-a2962a402336} WT_SESSION=75f67092-5c1d-4cc3-87cc-218d31f089f4]
[TRACE] 20:01:23.924 shell.go:GOOS() - 0s
[DEBUG] 20:01:23.924 shell.go:Pwd:427  C:\Users\meza
[TRACE] 20:01:23.924 shell.go:Pwd() - 0s
[DEBUG] 20:01:23.924 shell_windows.go:56  C:\Users\meza
[TRACE] 20:01:23.924 shell.go:GOOS() - 0s
[TRACE] 20:01:23.924 shell.go:GOOS() - 0s
[TRACE] 20:01:23.924 shell.go:GOOS() - 0s
[TRACE] 20:01:23.924 shell.go:GOOS() - 0s
[TRACE] 20:01:23.924 shell.go:GOOS() - 0s
[TRACE] 20:01:23.924 shell.go:GOOS() - 0s
[TRACE] 20:01:23.924 shell.go:GOOS() - 0s
[DEBUG] 20:01:23.924 shell.go:User:548  meza
[TRACE] 20:01:23.924 shell.go:User() - 0s
[DEBUG] 20:01:23.924 shell.go:Host:560  Meza-PC
[TRACE] 20:01:23.924 shell.go:Host() - 0s
[TRACE] 20:01:23.924 shell.go:GOOS() - 0s
[DEBUG] 20:01:23.924 shell.go:Getenv:397  NO DATA
[TRACE] 20:01:23.924 shell.go:Getenv(SHLVL) - 0s
[TRACE] 20:01:23.924 shell.go:TemplateCache() - 2.5008ms
[TRACE] 20:01:23.924 shell.go:Flags() - 0s
[DEBUG] 20:01:23.924 block.go:Debug:280  Segment: time
[TRACE] 20:01:23.924 shell.go:Pwd() - 0s
[DEBUG] 20:01:23.924 shell_windows.go:56  C:\Users\meza
[TRACE] 20:01:23.924 shell.go:GOOS() - 0s
[DEBUG] 20:01:23.924 properties.go:GetString:28  15:04:05
[TRACE] 20:01:23.924 shell.go:TemplateCache() - 0s
[TRACE] 20:01:23.924 shell.go:TemplateCache() - 0s
[TRACE] 20:01:23.924 shell.go:Shell() - 0s
[DEBUG] 20:01:23.925 block.go:Debug:280  Segment: path
[TRACE] 20:01:23.925 shell.go:Pwd() - 0s
[DEBUG] 20:01:23.925 shell_windows.go:56  C:\Users\meza
[TRACE] 20:01:23.925 shell.go:GOOS() - 0s
[TRACE] 20:01:23.925 shell.go:Pwd() - 0s
[TRACE] 20:01:23.925 shell.go:Shell() - 0s
[TRACE] 20:01:23.925 shell.go:Flags() - 0s
[DEBUG] 20:01:23.925 properties.go:GetBool:22  mapped_locations_enabled: true
[DEBUG] 20:01:23.925 properties.go:GetString:28 ÔåÆ ´Çô
[DEBUG] 20:01:23.925 properties.go:GetString:28 ÔåÆ ´Çô
[DEBUG] 20:01:23.925 shell_windows.go:56  C:\Users\meza
[TRACE] 20:01:23.925 shell.go:GOOS() - 0s
[TRACE] 20:01:23.925 shell.go:GOOS() - 0s
[DEBUG] 20:01:23.925 properties.go:GetString:28  ~
[DEBUG] 20:01:23.925 properties.go:GetKeyValueMap:46  mapped_locations: map[]
[TRACE] 20:01:23.925 shell.go:PathSeparator() - 0s
[TRACE] 20:01:23.925 shell.go:GOOS() - 0s
[TRACE] 20:01:23.925 shell.go:GOOS() - 0s
[TRACE] 20:01:23.925 shell.go:GOOS() - 0s
[TRACE] 20:01:23.925 shell.go:GOOS() - 0s
[TRACE] 20:01:23.925 shell.go:GOOS() - 0s
[TRACE] 20:01:23.925 shell.go:GOOS() - 0s
[TRACE] 20:01:23.925 shell.go:GOOS() - 0s
[TRACE] 20:01:23.925 shell.go:PathSeparator() - 0s
[TRACE] 20:01:23.925 shell.go:PathSeparator() - 0s
[TRACE] 20:01:23.925 shell.go:GOOS() - 0s
[TRACE] 20:01:23.925 shell.go:GOOS() - 0s
[TRACE] 20:01:23.925 shell.go:GOOS() - 0s
[TRACE] 20:01:23.925 shell.go:PathSeparator() - 0s
[TRACE] 20:01:23.925 shell.go:GOOS() - 0s
[TRACE] 20:01:23.925 shell.go:GOOS() - 0s
[TRACE] 20:01:23.925 shell.go:GOOS() - 0s
[TRACE] 20:01:23.925 shell.go:PathSeparator() - 0s
[TRACE] 20:01:23.925 shell.go:GOOS() - 0s
[TRACE] 20:01:23.925 shell.go:GOOS() - 0s
[TRACE] 20:01:23.925 shell.go:GOOS() - 0s
[TRACE] 20:01:23.925 shell.go:PathSeparator() - 0s
[TRACE] 20:01:23.925 shell.go:Pwd() - 0s
[TRACE] 20:01:23.925 shell_windows.go:IsWsl() - 0s
[TRACE] 20:01:23.925 shell.go:StackCount() - 0s
[DEBUG] 20:01:23.926 win32_windows.go:isWriteable:299  not current user or in group
[DEBUG] 20:01:23.926 win32_windows.go:isWriteable:303  current user is member of S-1-5-32-544
[DEBUG] 20:01:23.926 win32_windows.go:isWriteable:311 Ôåô
    WRITE_DAC
    WRITE_OWNER
    SYNCHRONIZE
    DELETE
    READ_CONTROL
[DEBUG] 20:01:23.926 win32_windows.go:isWriteable:313  user has write access
[TRACE] 20:01:23.926 shell_windows.go:DirIsWritable() - 998.7┬Ás
[TRACE] 20:01:23.926 shell.go:TemplateCache() - 0s
[TRACE] 20:01:23.926 shell.go:TemplateCache() - 0s
[TRACE] 20:01:23.926 shell.go:Shell() - 0s
[DEBUG] 20:01:23.926 block.go:Debug:280  Segment: executiontime
[TRACE] 20:01:23.926 shell.go:Pwd() - 0s
[DEBUG] 20:01:23.926 shell_windows.go:56  C:\Users\meza
[TRACE] 20:01:23.926 shell.go:GOOS() - 0s
[DEBUG] 20:01:23.926 properties.go:GetBool:22  always_enabled: true
[TRACE] 20:01:23.926 shell.go:ExecutionTime() - 0s
[DEBUG] 20:01:23.926 properties.go:GetFloat64:34  threshold: 500.000000
[DEBUG] 20:01:23.926 properties.go:GetString:28  austin
[TRACE] 20:01:23.926 shell.go:TemplateCache() - 0s
[TRACE] 20:01:23.926 shell.go:TemplateCache() - 0s
[TRACE] 20:01:23.926 shell.go:Shell() - 0s
[DEBUG] 20:01:23.926 block.go:Debug:280  Segment: git
[TRACE] 20:01:23.926 shell.go:Pwd() - 0s
[DEBUG] 20:01:23.926 shell_windows.go:56  C:\Users\meza
[TRACE] 20:01:23.926 shell.go:GOOS() - 0s
[TRACE] 20:01:23.926 shell.go:GOOS() - 0s
[DEBUG] 20:01:23.939 shell.go:CommandPath:599  c:\program files\git\cmd\git.exe
[TRACE] 20:01:23.939 shell.go:CommandPath(git.exe) - 13.2359ms
[TRACE] 20:01:23.939 shell.go:HasCommand(git.exe) - 13.2359ms
[TRACE] 20:01:23.939 shell.go:Pwd() - 0s
[ERROR] 20:01:23.940 shell.go:HasParentFilePath:732  CreateFile .git: The system cannot find the file specified.
[TRACE] 20:01:23.940 shell.go:HasParentFilePath(.git) - 503.1┬Ás
[DEBUG] 20:01:23.940 properties.go:GetBool:22  fetch_bare_info: false
[DEBUG] 20:01:23.940 block.go:Debug:280  Segment: root
[TRACE] 20:01:23.940 shell.go:Pwd() - 0s
[DEBUG] 20:01:23.940 shell_windows.go:56  C:\Users\meza
[TRACE] 20:01:23.940 shell.go:GOOS() - 0s
[TRACE] 20:01:23.940 shell_windows.go:Root() - 0s
[TRACE] 20:01:23.940 shell.go:Flags() - 0s
[DEBUG] 20:01:23.940 block.go:Debug:280  Segment: text
[TRACE] 20:01:23.940 shell.go:Pwd() - 0s
[DEBUG] 20:01:23.940 shell_windows.go:56  C:\Users\meza
[TRACE] 20:01:23.940 shell.go:GOOS() - 0s
[TRACE] 20:01:23.940 shell.go:TemplateCache() - 0s
[TRACE] 20:01:23.940 shell.go:Shell() - 0s
[DEBUG] 20:01:23.940 shell.go:Getenv:397  C:\Users\meza\AppData\Local
[TRACE] 20:01:23.940 shell.go:Getenv(LOCALAPPDATA) - 0s
[TRACE] 20:01:23.940 shell_windows.go:CachePath() - 498.3┬Ás
[TRACE] 20:01:23.940 shell.go:Flags() - 0s
meza commented 1 year ago

The git segment's template is not working as intended but that's just my (mis)understanding of things :)

I've tried things without it, it made no difference

JanDeDobbeleer commented 1 year ago

@meza hmm. It shouldn't have to do that fallback to determine the shell using the process. Can you try the init command without the | Invoke-Expression part and tell me what it returns?

meza commented 1 year ago
image
JanDeDobbeleer commented 1 year ago

@meza nothing wrong there. Ah wait, I'm an idiot. We're looking at this the wrong way. Obviously it doesn't know the shell, debug doesn't know it. The actual output oh-my-posh uses when running is oh-my-posh debug --shell pwsh --plain.

You'd think I'd know these details by now, but err, no.

meza commented 1 year ago

Haha, this looks better


Version: 17.12.1

Shell: pwsh (7.3.6)

Segments:

ConsoleTitle(true)                         -   1 ms - ~
time(true)                                 -   0 ms - [20:23:54]
path(true)                                 -   1 ms - [~] 
executiontime(true)                        -   0 ms - (¯«ó 0ms) 
git(false)                                 -  14 ms - 
root(false)                                -   0 ms - 
text(true)                                 -   0 ms - ¯ÿé 

Run duration: 20.5881ms

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

Config path: C:\Users\meza\.mytheme.omp.json

Logs:

[DEBUG] 20:23:54.816 shell.go:Getenv:397  NO DATA
[TRACE] 20:23:54.816 shell.go:Getenv(TERM_PROGRAM) - 0s
[DEBUG] 20:23:54.816 shell.go:Getenv:397  C:\Users\meza\AppData\Local
[TRACE] 20:23:54.816 shell.go:Getenv(LOCALAPPDATA) - 0s
[TRACE] 20:23:54.817 shell_windows.go:CachePath() - 499.3┬Ás
[DEBUG] 20:23:54.817 shell.go:Getenv:397  C:\Users\meza\.mytheme.omp.json
[TRACE] 20:23:54.817 shell.go:Getenv(POSH_THEME) - 0s
[TRACE] 20:23:54.817 shell.go:Shell() - 0s
[TRACE] 20:23:54.817 shell.go:resolveConfigPath() - 0s
[TRACE] 20:23:54.817 shell.go:Init() - 999.5┬Ás
[TRACE] 20:23:54.817 shell.go:Flags() - 0s
[TRACE] 20:23:54.818 config.go:loadConfig() - 501.3┬Ás
[TRACE] 20:23:54.818 shell.go:Flags() - 0s
[DEBUG] 20:23:54.818 shell.go:Getenv:397  NO DATA
[TRACE] 20:23:54.818 shell.go:Getenv(OMP_CACHE_DISABLED) - 0s
[TRACE] 20:23:54.818 shell_windows.go:WindowsRegistryKeyValue(HKEY_CURRENT_USER\Software\Microsoft\Windows\DWM\ColorizationColor) - 0s
[TRACE] 20:23:54.818 shell.go:GOOS() - 0s
[TRACE] 20:23:54.818 shell.go:GOOS() - 0s
[TRACE] 20:23:54.818 shell.go:GOOS() - 0s
[TRACE] 20:23:54.818 shell.go:GOOS() - 0s
[TRACE] 20:23:54.818 shell.go:GOOS() - 0s
[TRACE] 20:23:54.818 shell.go:GOOS() - 0s
[TRACE] 20:23:54.818 shell.go:GOOS() - 0s
[TRACE] 20:23:54.818 shell.go:GOOS() - 0s
[TRACE] 20:23:54.818 shell.go:GOOS() - 0s
[TRACE] 20:23:54.818 shell.go:GOOS() - 0s
[TRACE] 20:23:54.818 shell.go:GOOS() - 0s
[TRACE] 20:23:54.818 shell.go:GOOS() - 0s
[TRACE] 20:23:54.818 shell.go:GOOS() - 0s
[TRACE] 20:23:54.818 shell.go:GOOS() - 0s
[TRACE] 20:23:54.818 shell.go:GOOS() - 0s
[TRACE] 20:23:54.818 shell.go:GOOS() - 0s
[TRACE] 20:23:54.818 shell.go:GOOS() - 0s
[TRACE] 20:23:54.818 shell.go:GOOS() - 0s
[TRACE] 20:23:54.818 shell.go:GOOS() - 0s
[DEBUG] 20:23:54.818 shell_windows.go:WindowsRegistryKeyValue:206  ColorizationColor(DWORD): 0xC40078D4
[TRACE] 20:23:54.818 shell.go:Shell() - 0s
[DEBUG] 20:23:54.818 shell.go:Getenv:397  7.3.6
[TRACE] 20:23:54.818 shell.go:Getenv(POSH_SHELL_VERSION) - 0s
[DEBUG] 20:23:54.818 debug.go:PrintDebug:23  Segment: Title
[TRACE] 20:23:54.818 shell_windows.go:Root() - 0s
[TRACE] 20:23:54.818 shell.go:Shell() - 0s
[TRACE] 20:23:54.818 shell.go:ErrorCode() - 0s
[TRACE] 20:23:54.818 shell_windows.go:IsWsl() - 0s
[DEBUG] 20:23:54.818 shell.go:TemplateCache:814  environment: [ALLUSERSPROFILE=C:\ProgramData APPDATA=C:\Users\meza\AppData\Roaming ChocolateyInstall=C:\ProgramData\chocolatey ChocolateyLastPathUpdate=132881040388810709 CommonProgramFiles=C:\Program Files\Common Files CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files CommonProgramW6432=C:\Program Files\Common Files COMPUTERNAME=MEZA-PC ComSpec=C:\WINDOWS\system32\cmd.exe CONDA_PROMPT_MODIFIER=False DriverData=C:\Windows\System32\Drivers\DriverData FPS_BROWSER_APP_PROFILE_STRING=Internet Explorer FPS_BROWSER_USER_PROFILE_STRING=Default GOPATH=C:\Users\meza\go HOMEDRIVE=C: HOMEPATH=\Users\meza INTEL_DEV_REDIST=C:\Program Files (x86)\Common Files\Intel\Shared Libraries\ IntelliJ IDEA=C:\Program Files\JetBrains\IntelliJ IDEA 2020.2\bin; JAVA_HOME=C:\Program Files\Java\jdk-17.0.1 LOCALAPPDATA=C:\Users\meza\AppData\Local LOGONSERVER=\\MEZA-PC MIC_LD_LIBRARY_PATH=C:\Program Files (x86)\Common Files\Intel\Shared Libraries\compiler\lib\mic N_PREFIX=F:\Dev\node-installations NUMBER_OF_PROCESSORS=24 NVAFX_SDK_DIR=C:\Program Files\NVIDIA Corporation\NVIDIA Audio Effects SDK NVAR_MODEL_DIR=C:\Program Files\NVIDIA Corporation\NVIDIA AR SDK\models NVM_HOME=C:\Users\meza\AppData\Roaming\nvm NVM_SYMLINK=C:\Program Files\nodejs NVVFX_MODEL_DIR=C:\Program Files\NVIDIA Corporation\NVIDIA Video Effects\models OneDrive=C:\Users\meza\OneDrive OneDriveConsumer=C:\Users\meza\OneDrive OS=Windows_NT Path=C:\Program Files\PowerShell\7;C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.17.11461.0_x64__8wekyb3d8bbwe;c:\program files\windowsapps\microsoft.windowsterminal_1.15.2713.0_x64__8wekyb3d8bbwe;c:\python310\scripts\;c:\python310\;c:\program files (x86)\common files\intel\shared libraries\redist\intel64\compiler;c:\windows\system32;c:\windows;c:\windows\system32\wbem;c:\windows\system32\windowspowershell\v1.0\;c:\windows\system32\openssh\;c:\program files\nvidia corporation\nvidia nvdlisr;c:\program files\process lasso\;e:\program files\ffmpeg\bin;c:\program files\dotnet\;c:\program files\putty\;c:\programdata\chocolatey\bin;C:\Program Files\Git\bin\git.exe;c:\program files\git\cmd;c:\program files\go\bin;c:\program files\microsoft sql server\150\tools\binn\;c:\program files\microsoft sql server\client sdk\odbc\170\tools\binn\;c:\users\meza\appdata\local\microsoft\windowsapps;c:\program files\jetbrains\intellij idea 2020.2\bin;c:\program files (x86)\fahclient;c:\users\meza\.dotnet\tools;c:\users\meza\appdata\roaming\npm;c:\users\meza\go\bin;c:\program files\java\jdk-17.0.1\bin;e:\dev\vendor\intellij\toolbox\scripts;c:\program files (x86)\common files\acronis\snapapi\;c:\program files (x86)\common files\acronis\virtualfile\;c:\program files (x86)\common files\acronis\virtualfile64\;c:\program files (x86)\common files\acronis\fileprotector\;c:\program files (x86)\common files\acronis\fileprotector64\;c:\users\meza\appdata\roaming\nvm;c:\program files\nodejs;c:\program files\docker\docker\resources\bin;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Lumia Stream\commands;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Docker\Docker\resources\bin;C:\Program Files\PowerShell\7\;C:\Program Files\Amazon\AWSSAMCLI\bin\;C:\Users\meza\.dotnet\tools;C:\Users\meza\AppData\Roaming\nvm;C:\Program Files\nodejs;C:\Users\meza\AppData\Local\Microsoft\WindowsApps;C:\Users\meza\AppData\Local\Programs\oh-my-posh\bin PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.PY;.PYW;.CPL POSH_AZURE_ENABLED=False POSH_CURSOR_COLUMN=1 POSH_CURSOR_LINE=33 POSH_GIT_ENABLED=False POSH_INSTALLER=winget POSH_PID=1798192 POSH_SHELL_VERSION=7.3.6 POSH_THEME=C:\Users\meza\.mytheme.omp.json POSH_THEMES_PATH=C:\Users\meza\AppData\Local\Programs\oh-my-posh\themes POWERLINE_COMMAND=oh-my-posh POWERSHELL_DISTRIBUTION_CHANNEL=MSI:Windows 10 Pro PROCESSOR_ARCHITECTURE=AMD64 PROCESSOR_IDENTIFIER=AMD64 Family 23 Model 113 Stepping 0, AuthenticAMD PROCESSOR_LEVEL=23 PROCESSOR_REVISION=7100 PROG27B48B2C054=1 ProgramData=C:\ProgramData ProgramFiles=C:\Program Files ProgramFiles(x86)=C:\Program Files (x86) ProgramW6432=C:\Program Files PSModulePath=C:\Users\meza\OneDrive\Dokumentumok\PowerShell\Modules;C:\Program Files\PowerShell\Modules;c:\program files\powershell\7\Modules;C:\Program Files\WindowsPowerShell\Modules;C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules;C:\Program Files\Intel\Wired Networking\ PUBLIC=C:\Users\Public SystemDrive=C: SystemRoot=C:\WINDOWS TEMP=C:\Users\meza\AppData\Local\Temp TMP=C:\Users\meza\AppData\Local\Temp USERDOMAIN=MEZA-PC USERDOMAIN_ROAMINGPROFILE=MEZA-PC USERNAME=meza USERPROFILE=C:\Users\meza windir=C:\WINDOWS WSLENV=WT_SESSION::WT_PROFILE_ID WT_PROFILE_ID={574e775e-4f2a-5b96-ac1e-a2962a402336} WT_SESSION=37a8b5c3-d55a-438e-b34a-51c5b5c0d7c0]
[TRACE] 20:23:54.818 shell.go:GOOS() - 0s
[DEBUG] 20:23:54.819 shell.go:Pwd:427  C:\Users\meza
[TRACE] 20:23:54.819 shell.go:Pwd() - 1.0016ms
[DEBUG] 20:23:54.820 shell_windows.go:56  C:\Users\meza
[TRACE] 20:23:54.820 shell.go:GOOS() - 0s
[TRACE] 20:23:54.820 shell.go:GOOS() - 0s
[TRACE] 20:23:54.820 shell.go:GOOS() - 0s
[TRACE] 20:23:54.820 shell.go:GOOS() - 0s
[TRACE] 20:23:54.820 shell.go:GOOS() - 0s
[TRACE] 20:23:54.820 shell.go:GOOS() - 0s
[TRACE] 20:23:54.820 shell.go:GOOS() - 0s
[DEBUG] 20:23:54.820 shell.go:User:548  meza
[TRACE] 20:23:54.820 shell.go:User() - 0s
[DEBUG] 20:23:54.820 shell.go:Host:560  Meza-PC
[TRACE] 20:23:54.820 shell.go:Host() - 0s
[TRACE] 20:23:54.820 shell.go:GOOS() - 0s
[DEBUG] 20:23:54.820 shell.go:Getenv:397  NO DATA
[TRACE] 20:23:54.820 shell.go:Getenv(SHLVL) - 0s
[TRACE] 20:23:54.820 shell.go:TemplateCache() - 1.502ms
[TRACE] 20:23:54.820 shell.go:Flags() - 0s
[DEBUG] 20:23:54.820 block.go:Debug:280  Segment: time
[TRACE] 20:23:54.820 shell.go:Pwd() - 0s
[DEBUG] 20:23:54.820 shell_windows.go:56  C:\Users\meza
[TRACE] 20:23:54.820 shell.go:GOOS() - 0s
[DEBUG] 20:23:54.820 properties.go:GetString:28  15:04:05
[TRACE] 20:23:54.820 shell.go:TemplateCache() - 0s
[TRACE] 20:23:54.821 shell.go:TemplateCache() - 0s
[TRACE] 20:23:54.821 shell.go:Shell() - 0s
[DEBUG] 20:23:54.821 block.go:Debug:280  Segment: path
[TRACE] 20:23:54.821 shell.go:Pwd() - 0s
[DEBUG] 20:23:54.821 shell_windows.go:56  C:\Users\meza
[TRACE] 20:23:54.821 shell.go:GOOS() - 0s
[TRACE] 20:23:54.821 shell.go:Pwd() - 0s
[TRACE] 20:23:54.821 shell.go:Shell() - 0s
[TRACE] 20:23:54.821 shell.go:Flags() - 0s
[DEBUG] 20:23:54.821 properties.go:GetBool:22  mapped_locations_enabled: true
[DEBUG] 20:23:54.821 properties.go:GetString:28 ÔåÆ ´Çô
[DEBUG] 20:23:54.821 properties.go:GetString:28 ÔåÆ ´Çô
[DEBUG] 20:23:54.821 shell_windows.go:56  C:\Users\meza
[TRACE] 20:23:54.821 shell.go:GOOS() - 0s
[TRACE] 20:23:54.821 shell.go:GOOS() - 0s
[DEBUG] 20:23:54.821 properties.go:GetString:28  ~
[DEBUG] 20:23:54.821 properties.go:GetKeyValueMap:46  mapped_locations: map[]
[TRACE] 20:23:54.821 shell.go:PathSeparator() - 0s
[TRACE] 20:23:54.821 shell.go:GOOS() - 0s
[TRACE] 20:23:54.821 shell.go:GOOS() - 0s
[TRACE] 20:23:54.821 shell.go:GOOS() - 0s
[TRACE] 20:23:54.821 shell.go:GOOS() - 0s
[TRACE] 20:23:54.821 shell.go:GOOS() - 0s
[TRACE] 20:23:54.821 shell.go:GOOS() - 0s
[TRACE] 20:23:54.821 shell.go:GOOS() - 0s
[TRACE] 20:23:54.821 shell.go:PathSeparator() - 0s
[TRACE] 20:23:54.821 shell.go:PathSeparator() - 0s
[TRACE] 20:23:54.821 shell.go:GOOS() - 0s
[TRACE] 20:23:54.821 shell.go:GOOS() - 0s
[TRACE] 20:23:54.821 shell.go:GOOS() - 0s
[TRACE] 20:23:54.821 shell.go:PathSeparator() - 0s
[TRACE] 20:23:54.821 shell.go:GOOS() - 0s
[TRACE] 20:23:54.821 shell.go:GOOS() - 0s
[TRACE] 20:23:54.821 shell.go:GOOS() - 0s
[TRACE] 20:23:54.821 shell.go:PathSeparator() - 0s
[TRACE] 20:23:54.821 shell.go:GOOS() - 0s
[TRACE] 20:23:54.821 shell.go:GOOS() - 0s
[TRACE] 20:23:54.821 shell.go:GOOS() - 0s
[TRACE] 20:23:54.821 shell.go:PathSeparator() - 0s
[TRACE] 20:23:54.821 shell.go:Pwd() - 0s
[TRACE] 20:23:54.821 shell_windows.go:IsWsl() - 0s
[TRACE] 20:23:54.821 shell.go:StackCount() - 0s
[DEBUG] 20:23:54.822 win32_windows.go:isWriteable:299  not current user or in group
[DEBUG] 20:23:54.822 win32_windows.go:isWriteable:303  current user is member of S-1-5-32-544
[DEBUG] 20:23:54.822 win32_windows.go:isWriteable:311 Ôåô
    WRITE_DAC
    WRITE_OWNER
    SYNCHRONIZE
    DELETE
    READ_CONTROL
[DEBUG] 20:23:54.822 win32_windows.go:isWriteable:313  user has write access
[TRACE] 20:23:54.822 shell_windows.go:DirIsWritable() - 1.0005ms
[TRACE] 20:23:54.822 shell.go:TemplateCache() - 0s
[TRACE] 20:23:54.822 shell.go:TemplateCache() - 0s
[TRACE] 20:23:54.822 shell.go:Shell() - 0s
[DEBUG] 20:23:54.822 block.go:Debug:280  Segment: executiontime
[TRACE] 20:23:54.822 shell.go:Pwd() - 0s
[DEBUG] 20:23:54.822 shell_windows.go:56  C:\Users\meza
[TRACE] 20:23:54.822 shell.go:GOOS() - 0s
[DEBUG] 20:23:54.822 properties.go:GetBool:22  always_enabled: true
[TRACE] 20:23:54.822 shell.go:ExecutionTime() - 0s
[DEBUG] 20:23:54.822 properties.go:GetFloat64:34  threshold: 500.000000
[DEBUG] 20:23:54.822 properties.go:GetString:28  austin
[TRACE] 20:23:54.822 shell.go:TemplateCache() - 0s
[TRACE] 20:23:54.822 shell.go:TemplateCache() - 0s
[TRACE] 20:23:54.822 shell.go:Shell() - 0s
[DEBUG] 20:23:54.822 block.go:Debug:280  Segment: git
[TRACE] 20:23:54.822 shell.go:Pwd() - 0s
[DEBUG] 20:23:54.822 shell_windows.go:56  C:\Users\meza
[TRACE] 20:23:54.822 shell.go:GOOS() - 0s
[TRACE] 20:23:54.822 shell.go:GOOS() - 0s
[DEBUG] 20:23:54.836 shell.go:CommandPath:599  c:\program files\git\cmd\git.exe
[TRACE] 20:23:54.836 shell.go:CommandPath(git.exe) - 13.586ms
[TRACE] 20:23:54.836 shell.go:HasCommand(git.exe) - 13.586ms
[TRACE] 20:23:54.836 shell.go:Pwd() - 0s
[ERROR] 20:23:54.836 shell.go:HasParentFilePath:732  CreateFile .git: The system cannot find the file specified.
[TRACE] 20:23:54.836 shell.go:HasParentFilePath(.git) - 500.6┬Ás
[DEBUG] 20:23:54.836 properties.go:GetBool:22  fetch_bare_info: false
[DEBUG] 20:23:54.836 block.go:Debug:280  Segment: root
[TRACE] 20:23:54.836 shell.go:Pwd() - 0s
[DEBUG] 20:23:54.836 shell_windows.go:56  C:\Users\meza
[TRACE] 20:23:54.836 shell.go:GOOS() - 0s
[TRACE] 20:23:54.837 shell_windows.go:Root() - 499.6┬Ás
[TRACE] 20:23:54.837 shell.go:Flags() - 0s
[DEBUG] 20:23:54.837 block.go:Debug:280  Segment: text
[TRACE] 20:23:54.837 shell.go:Pwd() - 0s
[DEBUG] 20:23:54.837 shell_windows.go:56  C:\Users\meza
[TRACE] 20:23:54.837 shell.go:GOOS() - 0s
[TRACE] 20:23:54.837 shell.go:TemplateCache() - 0s
[TRACE] 20:23:54.837 shell.go:Shell() - 0s
[DEBUG] 20:23:54.837 shell.go:Getenv:397  C:\Users\meza\AppData\Local
[TRACE] 20:23:54.837 shell.go:Getenv(LOCALAPPDATA) - 0s
[TRACE] 20:23:54.837 shell_windows.go:CachePath() - 0s
[TRACE] 20:23:54.837 shell.go:Flags() - 0s

But then I don't have any explanation for the 1+s cli return time

meza commented 1 year ago

I tried a brand new shell without OMP and the shell return is instant. I tried removing everything but the initialization, it still lags :(

meza commented 1 year ago

Here's a recording of the issue

GIF Mon 24 07 2023 20-30-08

JanDeDobbeleer commented 1 year ago

@meza in this case, it's most likely the device blocking oh-my-posh' execution. Defender or any other virus scanner are known to do this, even when we code sign the executable with a valid certificate. Add an exclusion for oh-my-posh and it should be gone.

meza commented 1 year ago

I have added it to the ESET exclusion list right at the start. Could there be something else?

JanDeDobbeleer commented 1 year ago

@meza I have no idea, I never had this issue on my machine. Try disabling all virus scanners and Defender to see if that solves the issue first, if so, then find out how to add an exclusion specifically for oh-my-posh.

meza commented 1 year ago

@JanDeDobbeleer thanks for looking into this. I disabled everything, added it to every exclusion list ever (ESET has a few) but nothing worked.

Then I restarted my computer and boom! Seems like adding the exclusion itself isn't always enough. Sorry for the wild goose chase, it's very difficult to debug AV related issues :(

JanDeDobbeleer commented 1 year ago

@meza all fine. I've been here before 😅

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.