JanDeDobbeleer / oh-my-posh

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

Oh My Posh not starting for cmd #4816

Closed aqtoo closed 7 months ago

aqtoo commented 7 months ago

Code of Conduct

What happened?

When following the documentation for getting this working with clink, after opening cmd it seemingly just does nothing, trying to run oh-my-posh init cmd it just spews out code and does nothing, almost like its just printing something. image

This is after a fresh install of oh-my-posh and clink, following purely the documentation instructions on a regular windows terminal install.

Theme

I've tried without a theme to no avail, but the theme I'm attempting to use is

load(io.popen('oh-my-posh init cmd --config C:\Users\Lew\AppData\Local\Programs\oh-my-posh\themes\1_shell.omp.json'):read("*a"))()

What OS are you seeing the problem on?

Windows

Which shell are you using?

cmd

Log output

Version: 19.20.0

Shell: cmd

Prompt:

 Lew   ~   

Segments:

ConsoleTitle(true)                        -   1 ms
Session(true)                             -   0 ms
Path(true)                                -   1 ms
Git(false)                                -  31 ms
Root(false)                               -   0 ms
Status(true)                              -   0 ms
Node(false)                               -   0 ms
Go(false)                                 -   0 ms
Python(false)                             -   0 ms
Shell(false)                              -   0 ms
Time(false)                               -   0 ms

Run duration: 41.5004ms

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

Config path: no --config set, using default built-in configuration

Logs:

[DEBUG] 16:50:44.370 shell.go:Getenv:325 → NO DATA
[TRACE] 16:50:44.370 shell.go:Getenv(TERM_PROGRAM) - 1ms
[DEBUG] 16:50:44.370 shell.go:Getenv:325 → C:\Users\Lew\AppData\Local
[TRACE] 16:50:44.370 shell.go:Getenv(LOCALAPPDATA) - 0s
[TRACE] 16:50:44.371 shell_windows.go:CachePath() - 500µs
[DEBUG] 16:50:44.372 shell.go:Getenv:325 → NO DATA
[TRACE] 16:50:44.372 shell.go:Getenv(POSH_THEME) - 0s
[DEBUG] 16:50:44.373 shell.go:resolveConfigPath:245 → No config set, fallback to default config
[TRACE] 16:50:44.373 shell.go:resolveConfigPath() - 502.2µs
[TRACE] 16:50:44.373 shell.go:Init() - 3.5024ms
[TRACE] 16:50:44.373 shell.go:Flags() - 0s
[DEBUG] 16:50:44.373 config.go:loadConfig:126 → no config file specified, using default
[TRACE] 16:50:44.373 config.go:loadConfig() - 0s
[TRACE] 16:50:44.373 shell.go:Flags() - 0s
[DEBUG] 16:50:44.373 shell.go:Getenv:325 → NO DATA
[TRACE] 16:50:44.373 shell.go:Getenv(OMP_CACHE_DISABLED) - 0s
[TRACE] 16:50:44.373 shell_windows.go:WindowsRegistryKeyValue(HKEY_CURRENT_USER\Software\Microsoft\Windows\DWM\ColorizationColor) - 0s
[TRACE] 16:50:44.373 shell.go:GOOS() - 0s
[TRACE] 16:50:44.373 shell.go:GOOS() - 0s
[TRACE] 16:50:44.373 shell.go:GOOS() - 0s
[TRACE] 16:50:44.373 shell.go:GOOS() - 0s
[TRACE] 16:50:44.373 shell.go:GOOS() - 0s
[TRACE] 16:50:44.373 shell.go:GOOS() - 0s
[TRACE] 16:50:44.373 shell.go:GOOS() - 0s
[TRACE] 16:50:44.373 shell.go:GOOS() - 0s
[TRACE] 16:50:44.373 shell.go:GOOS() - 0s
[TRACE] 16:50:44.373 shell.go:GOOS() - 0s
[TRACE] 16:50:44.373 shell.go:GOOS() - 0s
[TRACE] 16:50:44.373 shell.go:GOOS() - 0s
[TRACE] 16:50:44.373 shell.go:GOOS() - 0s
[TRACE] 16:50:44.373 shell.go:GOOS() - 0s
[TRACE] 16:50:44.373 shell.go:GOOS() - 0s
[TRACE] 16:50:44.373 shell.go:GOOS() - 0s
[TRACE] 16:50:44.373 shell.go:GOOS() - 0s
[TRACE] 16:50:44.373 shell.go:GOOS() - 0s
[TRACE] 16:50:44.373 shell.go:GOOS() - 0s
[DEBUG] 16:50:44.373 shell_windows.go:WindowsRegistryKeyValue:217 → ColorizationColor(DWORD): 0xC4000000
[DEBUG] 16:50:44.373 shell.go:Shell:593 → no shell name provided in flags, trying to detect it
[DEBUG] 16:50:44.377 shell.go:Shell:601 → process name: cmd.exe
[TRACE] 16:50:44.377 shell.go:Shell() - 4.4977ms
[DEBUG] 16:50:44.377 shell.go:Getenv:325 → NO DATA
[TRACE] 16:50:44.377 shell.go:Getenv(POSH_SHELL_VERSION) - 0s
[DEBUG] 16:50:44.377 debug.go:PrintDebug:22 → Segment: Title
[DEBUG] 16:50:44.377 text.go:Render:70 → Rendering template: {{ .Shell }} in {{ .Folder }}
[TRACE] 16:50:44.377 shell_windows.go:Root() - 0s
[TRACE] 16:50:44.378 shell.go:Shell() - 0s
[TRACE] 16:50:44.378 shell.go:StatusCodes() - 0s
[TRACE] 16:50:44.378 shell_windows.go:IsWsl() - 0s
[DEBUG] 16:50:44.378 shell.go:TemplateCache:774 → environment: [=::=::\ =C:=C:\Users\Lew =clink.bin=C:\Program Files (x86)\clink =clink.id=6732 =clink.profile=C:\Users\Lew\AppData\Local\clink =clink.scripts= =ExitCode=00000000 ALLUSERSPROFILE=C:\ProgramData APPDATA=C:\Users\Lew\AppData\Roaming ChocolateyLastPathUpdate=133532981931483452 CLINK_DIR=C:\Program Files (x86)\clink clink_dummy_capture_env=  COLUMNS=104 CommonProgramFiles=C:\Program Files\Common Files CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files CommonProgramW6432=C:\Program Files\Common Files COMPUTERNAME=LEW-PC ComSpec=C:\Windows\system32\cmd.exe DOTNET_CLI_TELEMETRY_OPTOUT=1 DriverData=C:\Windows\System32\Drivers\DriverData FPS_BROWSER_APP_PROFILE_STRING=Internet Explorer FPS_BROWSER_USER_PROFILE_STRING=Default HOMEDRIVE=C: HOMEPATH=\Users\Lew LINES=93 LOCALAPPDATA=C:\Users\Lew\AppData\Local LOGONSERVER=\\LEW-PC NUMBER_OF_PROCESSORS=16 OS=Windows_NT Path=C:\Program Files (x86)\Eclipse Adoptium\jdk-8.0.402.6-hotspot\bin;C:\Program Files\Eclipse Adoptium\jdk-8.0.402.6-hotspot\bin;C:\Program Files\Eclipse Adoptium\jdk-17.0.10.7-hotspot\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\dotnet\;C:\Program Files\Microsoft SQL Server\150\Tools\Binn\;C:\Program Files\nodejs\;C:\Program Files\NVIDIA Corporation\NVIDIA App\NvDLISR;C:\ProgramData\chocolatey\bin;C:\Program Files\Git\cmd;C:\Program Files\PuTTY\;C:\Program Files\WindowsPowerShell\Scripts;C:\Users\Lew\AppData\Local\Programs\Python\Launcher\;C:\Users\Lew\AppData\Local\Programs\Python\Python311\Scripts\;C:\Users\Lew\AppData\Local\Programs\Python\Python311\;C:\Users\Lew\AppData\Local\Microsoft\WindowsApps;C:\PATH Stuff\platform-tools;C:\Users\Lew\AppData\Local\Programs\Microsoft VS Code\bin;C:\PATH Stuff\youtube-dl;C:\Users\Lew\AppData\Local\spicetify;C:\Users\Lew\AppData\Roaming\npm;C:\Users\Lew\AppData\Local\Microsoft\WinGet\Packages\Martchus.syncthingtray_Microsoft.Winget.Source_8wekyb3d8bbwe;;C:\Users\Lew\AppData\Local\Programs\oh-my-posh\bin PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC POSH_INSTALLER=winget POSH_THEMES_PATH=C:\Users\Lew\AppData\Local\Programs\oh-my-posh\themes POWERSHELL_TELEMETRY_OPTOUT=1 PROCESSOR_ARCHITECTURE=AMD64 PROCESSOR_IDENTIFIER=AMD64 Family 23 Model 8 Stepping 2, AuthenticAMD PROCESSOR_LEVEL=23 PROCESSOR_REVISION=0802 ProgramData=C:\ProgramData ProgramFiles=C:\Program Files ProgramFiles(x86)=C:\Program Files (x86) ProgramW6432=C:\Program Files PROMPT=$P$G PSModulePath=C:\Program Files (x86)\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules PUBLIC=C:\Users\Public SESSIONNAME=Console SystemDrive=C: SystemRoot=C:\Windows TEMP=C:\Users\Lew\AppData\Local\Temp TMP=C:\Users\Lew\AppData\Local\Temp USERDOMAIN=LEW-PC USERDOMAIN_ROAMINGPROFILE=LEW-PC USERNAME=Lew USERPROFILE=C:\Users\Lew VBOX_HWVIRTEX_IGNORE_SVM_IN_USE=1 windir=C:\Windows]
[TRACE] 16:50:44.378 shell.go:GOOS() - 0s
[DEBUG] 16:50:44.378 shell.go:Pwd:355 → C:\Users\Lew
[TRACE] 16:50:44.378 shell.go:Pwd() - 0s
[DEBUG] 16:50:44.378 shell_windows.go:58 → C:\Users\Lew
[TRACE] 16:50:44.378 shell.go:GOOS() - 0s
[TRACE] 16:50:44.378 shell.go:GOOS() - 0s
[TRACE] 16:50:44.378 shell.go:GOOS() - 0s
[TRACE] 16:50:44.378 shell.go:GOOS() - 0s
[TRACE] 16:50:44.378 shell.go:GOOS() - 0s
[TRACE] 16:50:44.378 shell.go:GOOS() - 0s
[DEBUG] 16:50:44.378 shell.go:User:493 → Lew
[TRACE] 16:50:44.378 shell.go:User() - 0s
[DEBUG] 16:50:44.378 shell.go:Host:505 → Lew-PC
[TRACE] 16:50:44.378 shell.go:Host() - 0s
[TRACE] 16:50:44.378 shell.go:GOOS() - 0s
[DEBUG] 16:50:44.378 shell.go:Getenv:325 → NO DATA
[TRACE] 16:50:44.378 shell.go:Getenv(SHLVL) - 0s
[TRACE] 16:50:44.378 shell.go:TemplateCache() - 1.0003ms
[DEBUG] 16:50:44.378 shell.go:Getenv:325 → NO DATA
[TRACE] 16:50:44.378 shell.go:Getenv(POSH_CURSOR_LINE) - 0s
[DEBUG] 16:50:44.378 shell.go:Getenv:325 → NO DATA
[TRACE] 16:50:44.378 shell.go:Getenv(POSH_CURSOR_COLUMN) - 0s
[TRACE] 16:50:44.378 shell.go:Flags() - 0s
[TRACE] 16:50:44.379 shell.go:Flags() - 0s
[TRACE] 16:50:44.379 shell.go:Shell() - 0s
[TRACE] 16:50:44.379 shell.go:Shell() - 0s
[TRACE] 16:50:44.379 shell.go:Flags() - 0s
[TRACE] 16:50:44.379 shell.go:Flags() - 0s
[TRACE] 16:50:44.379 shell.go:Flags() - 0s
[TRACE] 16:50:44.379 shell.go:Pwd() - 0s
[DEBUG] 16:50:44.379 shell_windows.go:58 → C:\Users\Lew
[TRACE] 16:50:44.379 shell.go:GOOS() - 0s
[TRACE] 16:50:44.379 shell.go:Flags() - 0s
[TRACE] 16:50:44.379 shell.go:Flags() - 0s
[DEBUG] 16:50:44.379 segment.go:SetEnabled:529 → Segment: Path
[TRACE] 16:50:44.379 shell.go:Pwd() - 0s
[TRACE] 16:50:44.379 shell.go:Pwd() - 0s
[TRACE] 16:50:44.379 shell.go:Shell() - 0s
[TRACE] 16:50:44.379 shell.go:Shell() - 0s
[DEBUG] 16:50:44.379 properties.go:GetString:28 → {{ .Code }}
[DEBUG] 16:50:44.379 shell_windows.go:58 → C:\Users\Lew
[TRACE] 16:50:44.379 shell.go:GOOS() - 0s
[TRACE] 16:50:44.379 shell.go:Pwd() - 0s
[DEBUG] 16:50:44.379 segment.go:SetEnabled:529 → Segment: Root
[DEBUG] 16:50:44.379 shell_windows.go:58 → C:\Users\Lew
[TRACE] 16:50:44.379 shell.go:Pwd() - 0s
[TRACE] 16:50:44.379 shell.go:GOOS() - 0s
[TRACE] 16:50:44.379 shell.go:Pwd() - 0s
[DEBUG] 16:50:44.379 shell_windows.go:58 → C:\Users\Lew
[TRACE] 16:50:44.379 shell.go:GOOS() - 0s
[DEBUG] 16:50:44.379 segment.go:SetEnabled:529 → Segment: Git
[TRACE] 16:50:44.379 shell_windows.go:Root() - 0s
[DEBUG] 16:50:44.379 shell_windows.go:58 → C:\Users\Lew
[TRACE] 16:50:44.379 shell.go:GOOS() - 0s
[TRACE] 16:50:44.379 shell.go:GOOS() - 0s
[DEBUG] 16:50:44.379 segment.go:SetEnabled:529 → Segment: Status
[DEBUG] 16:50:44.379 shell.go:Getenv:325 → C:\Users\Lew\AppData\Local
[TRACE] 16:50:44.379 shell.go:Getenv(LOCALAPPDATA) - 0s
[DEBUG] 16:50:44.379 segment.go:SetEnabled:529 → Segment: Session
[DEBUG] 16:50:44.379 shell.go:Getenv:325 → NO DATA
[TRACE] 16:50:44.379 shell.go:Getenv(SSH_CONNECTION) - 0s
[TRACE] 16:50:44.379 shell.go:StatusCodes() - 0s
[DEBUG] 16:50:44.379 text.go:Render:70 → Rendering template: {{ .Code }}
[DEBUG] 16:50:44.379 shell.go:Getenv:325 → NO DATA
[TRACE] 16:50:44.379 shell.go:Getenv(SSH_CLIENT) - 0s
[TRACE] 16:50:44.379 shell.go:TemplateCache() - 0s
[DEBUG] 16:50:44.379 properties.go:GetBool:22 → mapped_locations_enabled: true
[DEBUG] 16:50:44.379 properties.go:GetString:28 → 
[DEBUG] 16:50:44.379 properties.go:GetString:28 → 
[DEBUG] 16:50:44.379 shell_windows.go:58 → C:\Users\Lew
[TRACE] 16:50:44.379 shell.go:GOOS() - 0s
[TRACE] 16:50:44.379 shell.go:GOOS() - 0s
[DEBUG] 16:50:44.379 properties.go:GetString:28 → ~
[DEBUG] 16:50:44.379 properties.go:GetKeyValueMap:46 → mapped_locations: map[]
[TRACE] 16:50:44.379 shell.go:PathSeparator() - 0s
[TRACE] 16:50:44.379 shell.go:GOOS() - 0s
[TRACE] 16:50:44.379 shell.go:GOOS() - 0s
[TRACE] 16:50:44.379 shell.go:GOOS() - 0s
[TRACE] 16:50:44.379 shell.go:GOOS() - 0s
[TRACE] 16:50:44.379 shell.go:GOOS() - 0s
[TRACE] 16:50:44.379 shell.go:GOOS() - 0s
[TRACE] 16:50:44.379 shell.go:GOOS() - 0s
[TRACE] 16:50:44.379 shell.go:PathSeparator() - 0s
[TRACE] 16:50:44.379 shell.go:PathSeparator() - 0s
[TRACE] 16:50:44.379 shell.go:GOOS() - 0s
[TRACE] 16:50:44.379 shell.go:GOOS() - 0s
[TRACE] 16:50:44.379 shell.go:GOOS() - 0s
[TRACE] 16:50:44.379 shell.go:PathSeparator() - 0s
[TRACE] 16:50:44.379 shell.go:GOOS() - 0s
[TRACE] 16:50:44.379 shell.go:GOOS() - 0s
[TRACE] 16:50:44.379 shell.go:GOOS() - 0s
[TRACE] 16:50:44.379 shell.go:PathSeparator() - 0s
[TRACE] 16:50:44.379 shell.go:GOOS() - 0s
[TRACE] 16:50:44.379 shell.go:GOOS() - 0s
[TRACE] 16:50:44.379 shell.go:GOOS() - 0s
[TRACE] 16:50:44.379 shell.go:PathSeparator() - 0s
[DEBUG] 16:50:44.379 properties.go:GetString:28 → NO DATA
[DEBUG] 16:50:44.379 shell_windows.go:58 → C:\Users\Lew
[TRACE] 16:50:44.379 shell.go:PathSeparator() - 0s
[TRACE] 16:50:44.379 shell.go:Pwd() - 0s
[TRACE] 16:50:44.379 shell_windows.go:IsWsl() - 0s
[TRACE] 16:50:44.379 shell.go:TemplateCache() - 0s
[TRACE] 16:50:44.379 shell.go:StackCount() - 0s
[DEBUG] 16:50:44.379 properties.go:GetBool:22 → always_enabled: true
[TRACE] 16:50:44.379 shell.go:TemplateCache() - 0s
[DEBUG] 16:50:44.380 win32_windows.go:isWriteable:299 → not current user or in group
[DEBUG] 16:50:44.380 win32_windows.go:isWriteable:303 → current user is member of S-1-5-32-544
[DEBUG] 16:50:44.380 win32_windows.go:isWriteable:311 ↓
    WRITE_DAC
    WRITE_OWNER
    SYNCHRONIZE
    DELETE
    READ_CONTROL
[DEBUG] 16:50:44.380 win32_windows.go:isWriteable:313 → user has write access
[TRACE] 16:50:44.380 shell_windows.go:DirIsWritable() - 994.8µs
[TRACE] 16:50:44.380 shell.go:TemplateCache() - 0s
[DEBUG] 16:50:44.409 shell.go:CommandPath:545 → C:\Program Files\Git\cmd\git.exe
[TRACE] 16:50:44.409 shell.go:CommandPath(git.exe) - 30.5ms
[TRACE] 16:50:44.409 shell.go:HasCommand(git.exe) - 30.5ms
[TRACE] 16:50:44.409 shell.go:Pwd() - 0s
[ERROR] 16:50:44.410 shell.go:HasParentFilePath:689 → CreateFile .git: The system cannot find the file specified.
[TRACE] 16:50:44.410 shell.go:HasParentFilePath(.git) - 999.5µs
[DEBUG] 16:50:44.410 properties.go:GetBool:22 → fetch_bare_info: false
[DEBUG] 16:50:44.410 text.go:Render:70 → Rendering template:  {{ if gt .Code 0 }}{{ else }}{{ end }}
[DEBUG] 16:50:44.410 text.go:Render:70 → Rendering template:   {{ path .Path .Location }}
[DEBUG] 16:50:44.410 text.go:Render:70 → Rendering template:  {{ if .SSHSession }} {{ end }}{{ .UserName }}
[TRACE] 16:50:44.410 shell.go:TemplateCache() - 0s
[TRACE] 16:50:44.410 shell.go:TemplateCache() - 0s
[TRACE] 16:50:44.410 shell.go:Shell() - 0s
[TRACE] 16:50:44.410 shell.go:Shell() - 0s
[TRACE] 16:50:44.410 shell.go:TemplateCache() - 0s
[TRACE] 16:50:44.410 shell.go:Shell() - 0s
[DEBUG] 16:50:44.410 text.go:Render:70 → Rendering template: diamond
[DEBUG] 16:50:44.411 text.go:Render:70 → Rendering template: powerline
[DEBUG] 16:50:44.411 text.go:Render:70 → Rendering template: powerline
[DEBUG] 16:50:44.411 text.go:Render:70 → Rendering template: powerline
[DEBUG] 16:50:44.411 text.go:Render:70 → Rendering template: {{ if gt .Code 0 }}p:red{{ end }}
[TRACE] 16:50:44.411 shell.go:TemplateCache() - 0s
[DEBUG] 16:50:44.411 text.go:Render:70 → Rendering template: diamond
[TRACE] 16:50:44.411 shell.go:Shell() - 0s
[TRACE] 16:50:44.411 shell.go:Shell() - 0s
[TRACE] 16:50:44.411 shell.go:Shell() - 0s
[TRACE] 16:50:44.411 shell.go:Flags() - 0s
[TRACE] 16:50:44.411 shell.go:Shell() - 0s
[TRACE] 16:50:44.411 shell.go:Shell() - 0s
[DEBUG] 16:50:44.411 shell.go:Getenv:325 → C:\Users\Lew\AppData\Local
[TRACE] 16:50:44.411 shell.go:Getenv(LOCALAPPDATA) - 0s
[TRACE] 16:50:44.411 shell_windows.go:CachePath() - 499.8µs
[TRACE] 16:50:44.411 shell.go:Flags() - 0s
JanDeDobbeleer commented 7 months ago

@ac-tu this isn't a bug but a configuration issue. Did you add the correct init line to your clink scripts folder?