Closed meza closed 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
@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 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.
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
I tried a brand new shell without OMP and the shell return is instant. I tried removing everything but the initialization, it still lags :(
Here's a recording of the issue
@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.
I have added it to the ESET exclusion list right at the start. Could there be something else?
@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.
@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 :(
@meza all fine. I've been here before 😅
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.
Code of Conduct
What happened?
Pressing enter with no commands takes 1.5 seconds to come back
Theme
What OS are you seeing the problem on?
Windows
Which shell are you using?
powershell
Log output