JanDeDobbeleer / oh-my-posh

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

Doesn't work on Xonsh on Windows #3739

Closed RuiNtD closed 1 year ago

RuiNtD commented 1 year ago

Code of Conduct

What happened?

Xonsh's init script doesn't work due to a lack of cat on Windows.

xonsh: For full traceback set: $XONSH_SHOW_TRACEBACK = True
xonsh: subprocess mode: command not found: cat
Did you mean one of the following?
    cd:    Alias
    CD:    Command (CD)
    cls:   Alias
    call:  Alias
    CLS:   Command (CLS)

Theme

%POSH_THEMES_PATH%\hul10.omp.json

What OS are you seeing the problem on?

Windows

Which shell are you using?

xonsh

Log output

Version: 14.30.0

Shell: python

Segments:

ConsoleTitle(true)                         -   0 ms - python in <Windows>
text(true)                                 -   0 ms - ┌
os(true)                                   -   0 ms -  ⠀
shell(true)                                -   0 ms -   python⠀
session(true)                              -   0 ms -   Ethan-PCethan⠀
git(false)                                 -  14 ms -
executiontime(true)                        -   0 ms - 0ms
time(true)                                 -   0 ms -  · 21/04/23 12:41
path(true)                                 -   1 ms - └[ C: » Windows ]
exit(true)                                 -   0 ms - ❯

Run duration: 35.1742ms

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

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

Logs:

[DEBUG] 12:41:44.915 shell.go:Getenv:398 → NO DATA
[TRACE] 12:41:44.915 shell.go:Getenv(TERM_PROGRAM) - 0s
[DEBUG] 12:41:44.915 shell.go:Getenv:398 → C:\Users\ethan\AppData\Local
[TRACE] 12:41:44.915 shell.go:Getenv(LOCALAPPDATA) - 0s
[TRACE] 12:41:44.915 shell_windows.go:CachePath() - 0s
[DEBUG] 12:41:44.917 shell.go:Getenv:398 → C:\Users\ethan\AppData\Local\Programs\oh-my-posh\themes\hul10.omp.json
[TRACE] 12:41:44.917 shell.go:Getenv(POSH_THEME) - 0s
[DEBUG] 12:41:44.929 shell.go:Shell:645 → process name: python.exe
[TRACE] 12:41:44.929 shell.go:Shell() - 11.9707ms
[TRACE] 12:41:44.929 shell.go:resolveConfigPath() - 11.9707ms
[TRACE] 12:41:44.929 shell.go:Init() - 13.8122ms
[TRACE] 12:41:44.929 shell.go:Flags() - 0s
[TRACE] 12:41:44.931 config.go:loadConfig() - 1.9999ms
[TRACE] 12:41:44.931 shell.go:Flags() - 0s
[DEBUG] 12:41:44.931 shell.go:Getenv:398 → NO DATA
[TRACE] 12:41:44.931 shell.go:Getenv(OMP_CACHE_DISABLED) - 0s
[TRACE] 12:41:44.931 shell_windows.go:WindowsRegistryKeyValue(HKEY_CURRENT_USER\Software\Microsoft\Windows\DWM\ColorizationColor) - 0s
[TRACE] 12:41:44.931 shell.go:GOOS() - 0s
[TRACE] 12:41:44.931 shell.go:GOOS() - 0s
[TRACE] 12:41:44.931 shell.go:GOOS() - 0s
[TRACE] 12:41:44.931 shell.go:GOOS() - 0s
[TRACE] 12:41:44.931 shell.go:GOOS() - 0s
[TRACE] 12:41:44.931 shell.go:GOOS() - 0s
[TRACE] 12:41:44.931 shell.go:GOOS() - 0s
[TRACE] 12:41:44.931 shell.go:GOOS() - 0s
[TRACE] 12:41:44.931 shell.go:GOOS() - 0s
[TRACE] 12:41:44.931 shell.go:GOOS() - 0s
[TRACE] 12:41:44.931 shell.go:GOOS() - 0s
[TRACE] 12:41:44.931 shell.go:GOOS() - 0s
[TRACE] 12:41:44.931 shell.go:GOOS() - 0s
[TRACE] 12:41:44.931 shell.go:GOOS() - 0s
[TRACE] 12:41:44.931 shell.go:GOOS() - 0s
[TRACE] 12:41:44.931 shell.go:GOOS() - 0s
[TRACE] 12:41:44.931 shell.go:GOOS() - 0s
[TRACE] 12:41:44.931 shell.go:GOOS() - 0s
[TRACE] 12:41:44.931 shell.go:GOOS() - 0s
[DEBUG] 12:41:44.931 shell_windows.go:WindowsRegistryKeyValue:206 → ColorizationColor(DWORD): 0xC40C2F69
[TRACE] 12:41:44.931 shell.go:Shell() - 0s
[DEBUG] 12:41:44.931 shell.go:Getenv:398 → NO DATA
[TRACE] 12:41:44.931 shell.go:Getenv(POSH_SHELL_VERSION) - 0s
[DEBUG] 12:41:44.931 engine.go:PrintDebug:266 → Segment: Title
[TRACE] 12:41:44.932 shell_windows.go:Root() - 0s
[TRACE] 12:41:44.932 shell.go:Shell() - 0s
[TRACE] 12:41:44.932 shell.go:ErrorCode() - 0s
[TRACE] 12:41:44.932 shell_windows.go:IsWsl() - 0s
[TRACE] 12:41:44.932 shell.go:GOOS() - 0s
[DEBUG] 12:41:44.932 shell.go:Pwd:428 → C:\Windows
[TRACE] 12:41:44.932 shell.go:Pwd() - 0s
[DEBUG] 12:41:44.932 shell_windows.go:56 → C:\Users\ethan
[TRACE] 12:41:44.932 shell.go:GOOS() - 0s
[TRACE] 12:41:44.932 shell.go:GOOS() - 0s
[TRACE] 12:41:44.932 shell.go:GOOS() - 0s
[TRACE] 12:41:44.932 shell.go:GOOS() - 0s
[TRACE] 12:41:44.932 shell.go:GOOS() - 0s
[TRACE] 12:41:44.932 shell.go:GOOS() - 0s
[TRACE] 12:41:44.932 shell.go:GOOS() - 0s
[TRACE] 12:41:44.932 shell.go:GOOS() - 0s
[TRACE] 12:41:44.932 shell.go:GOOS() - 0s
[TRACE] 12:41:44.932 shell.go:GOOS() - 0s
[DEBUG] 12:41:44.932 shell.go:User:549 → ethan
[TRACE] 12:41:44.932 shell.go:User() - 0s
[DEBUG] 12:41:44.932 shell.go:Host:561 → Ethan-PC
[TRACE] 12:41:44.932 shell.go:Host() - 0s
[TRACE] 12:41:44.932 shell.go:GOOS() - 0s
[DEBUG] 12:41:44.932 shell.go:Getenv:398 → 1
[TRACE] 12:41:44.932 shell.go:Getenv(SHLVL) - 0s
[TRACE] 12:41:44.932 shell.go:TemplateCache() - 501.8µs
[TRACE] 12:41:44.932 shell.go:Flags() - 0s
[DEBUG] 12:41:44.932 block.go:Debug:230 → Segment: text
[TRACE] 12:41:44.932 shell.go:Pwd() - 0s
[DEBUG] 12:41:44.932 shell_windows.go:56 → C:\Users\ethan
[TRACE] 12:41:44.932 shell.go:GOOS() - 0s
[TRACE] 12:41:44.932 shell.go:TemplateCache() - 0s
[TRACE] 12:41:44.932 shell.go:Shell() - 0s
[DEBUG] 12:41:44.933 block.go:Debug:230 → Segment: os
[TRACE] 12:41:44.933 shell.go:Pwd() - 0s
[DEBUG] 12:41:44.933 shell_windows.go:56 → C:\Users\ethan
[TRACE] 12:41:44.933 shell.go:GOOS() - 0s
[TRACE] 12:41:44.933 shell.go:GOOS() - 0s
[DEBUG] 12:41:44.933 properties.go:GetString:28 → 
[TRACE] 12:41:44.933 shell.go:TemplateCache() - 0s
[TRACE] 12:41:44.933 shell.go:TemplateCache() - 0s
[TRACE] 12:41:44.933 shell.go:Shell() - 0s
[DEBUG] 12:41:44.933 block.go:Debug:230 → Segment: shell
[TRACE] 12:41:44.933 shell.go:Pwd() - 0s
[DEBUG] 12:41:44.933 shell_windows.go:56 → C:\Users\ethan
[TRACE] 12:41:44.933 shell.go:GOOS() - 0s
[DEBUG] 12:41:44.933 properties.go:GetKeyValueMap:46 → mapped_shell_names: map[]
[TRACE] 12:41:44.933 shell.go:Shell() - 0s
[TRACE] 12:41:44.933 shell.go:Flags() - 0s
[TRACE] 12:41:44.933 shell.go:TemplateCache() - 0s
[TRACE] 12:41:44.933 shell.go:TemplateCache() - 0s
[TRACE] 12:41:44.933 shell.go:Shell() - 0s
[DEBUG] 12:41:44.933 block.go:Debug:230 → Segment: session
[TRACE] 12:41:44.933 shell.go:Pwd() - 0s
[DEBUG] 12:41:44.933 shell_windows.go:56 → C:\Users\ethan
[TRACE] 12:41:44.933 shell.go:GOOS() - 0s
[DEBUG] 12:41:44.933 shell.go:Getenv:398 → NO DATA
[TRACE] 12:41:44.933 shell.go:Getenv(SSH_CONNECTION) - 0s
[DEBUG] 12:41:44.933 shell.go:Getenv:398 → NO DATA
[TRACE] 12:41:44.933 shell.go:Getenv(SSH_CLIENT) - 0s
[TRACE] 12:41:44.933 shell.go:TemplateCache() - 0s
[TRACE] 12:41:44.934 shell.go:TemplateCache() - 0s
[TRACE] 12:41:44.934 shell.go:Shell() - 0s
[DEBUG] 12:41:44.934 block.go:Debug:230 → Segment: git
[TRACE] 12:41:44.934 shell.go:Pwd() - 0s
[DEBUG] 12:41:44.934 shell_windows.go:56 → C:\Users\ethan
[TRACE] 12:41:44.934 shell.go:GOOS() - 0s
[TRACE] 12:41:44.934 shell.go:GOOS() - 0s
[DEBUG] 12:41:44.948 shell.go:CommandPath:600 → C:\Users\ethan\scoop\shims\git.exe
[TRACE] 12:41:44.948 shell.go:CommandPath(git.exe) - 14.3071ms
[TRACE] 12:41:44.948 shell.go:HasCommand(git.exe) - 14.3071ms
[TRACE] 12:41:44.948 shell.go:Pwd() - 0s
[ERROR] 12:41:44.948 shell.go:HasParentFilePath:733 → CreateFile .git: The system cannot find the file specified.
[TRACE] 12:41:44.948 shell.go:HasParentFilePath(.git) - 0s
[DEBUG] 12:41:44.948 properties.go:GetBool:22 → fetch_bare_info: false
[TRACE] 12:41:44.948 shell.go:Flags() - 0s
[DEBUG] 12:41:44.948 block.go:Debug:230 → Segment: executiontime
[TRACE] 12:41:44.948 shell.go:Pwd() - 0s
[DEBUG] 12:41:44.948 shell_windows.go:56 → C:\Users\ethan
[TRACE] 12:41:44.948 shell.go:GOOS() - 0s
[DEBUG] 12:41:44.948 properties.go:GetBool:22 → always_enabled: false
[TRACE] 12:41:44.948 shell.go:ExecutionTime() - 0s
[DEBUG] 12:41:44.948 properties.go:GetFloat64:34 → threshold: 0.000000
[DEBUG] 12:41:44.948 properties.go:GetString:28 → austin
[TRACE] 12:41:44.948 shell.go:TemplateCache() - 0s
[TRACE] 12:41:44.948 shell.go:TemplateCache() - 0s
[TRACE] 12:41:44.948 shell.go:Shell() - 0s
[DEBUG] 12:41:44.948 block.go:Debug:230 → Segment: time
[TRACE] 12:41:44.948 shell.go:Pwd() - 0s
[DEBUG] 12:41:44.948 shell_windows.go:56 → C:\Users\ethan
[TRACE] 12:41:44.948 shell.go:GOOS() - 0s
[DEBUG] 12:41:44.948 properties.go:GetString:28 → 02/01/06 15:04
[TRACE] 12:41:44.948 shell.go:TemplateCache() - 0s
[TRACE] 12:41:44.948 shell.go:TemplateCache() - 0s
[TRACE] 12:41:44.948 shell.go:Shell() - 0s
[TRACE] 12:41:44.948 shell.go:Flags() - 0s
[DEBUG] 12:41:44.948 block.go:Debug:230 → Segment: path
[TRACE] 12:41:44.948 shell.go:Pwd() - 0s
[DEBUG] 12:41:44.948 shell_windows.go:56 → C:\Users\ethan
[TRACE] 12:41:44.948 shell.go:GOOS() - 0s
[TRACE] 12:41:44.948 shell.go:Pwd() - 0s
[TRACE] 12:41:44.948 shell.go:Shell() - 0s
[TRACE] 12:41:44.948 shell.go:Shell() - 0s
[DEBUG] 12:41:44.948 properties.go:GetBool:22 → mapped_locations_enabled: true
[DEBUG] 12:41:44.948 properties.go:GetString:28 → 
[DEBUG] 12:41:44.948 properties.go:GetString:28 → 
[DEBUG] 12:41:44.948 shell_windows.go:56 → C:\Users\ethan
[TRACE] 12:41:44.948 shell.go:GOOS() - 0s
[TRACE] 12:41:44.948 shell.go:GOOS() - 0s
[DEBUG] 12:41:44.948 properties.go:GetString:28 → 
[DEBUG] 12:41:44.948 properties.go:GetKeyValueMap:46 → mapped_locations: map[]
[TRACE] 12:41:44.948 shell.go:PathSeparator() - 0s
[TRACE] 12:41:44.948 shell.go:GOOS() - 0s
[TRACE] 12:41:44.948 shell.go:GOOS() - 0s
[TRACE] 12:41:44.948 shell.go:GOOS() - 0s
[TRACE] 12:41:44.948 shell.go:GOOS() - 0s
[TRACE] 12:41:44.948 shell.go:GOOS() - 0s
[TRACE] 12:41:44.948 shell.go:GOOS() - 0s
[TRACE] 12:41:44.948 shell.go:GOOS() - 0s
[TRACE] 12:41:44.948 shell.go:PathSeparator() - 0s
[TRACE] 12:41:44.948 shell.go:PathSeparator() - 0s
[TRACE] 12:41:44.948 shell.go:GOOS() - 0s
[TRACE] 12:41:44.948 shell.go:GOOS() - 0s
[TRACE] 12:41:44.949 shell.go:GOOS() - 0s
[TRACE] 12:41:44.949 shell.go:PathSeparator() - 0s
[TRACE] 12:41:44.949 shell.go:GOOS() - 0s
[TRACE] 12:41:44.949 shell.go:GOOS() - 0s
[TRACE] 12:41:44.949 shell.go:GOOS() - 0s
[TRACE] 12:41:44.949 shell.go:PathSeparator() - 0s
[TRACE] 12:41:44.949 shell.go:GOOS() - 0s
[TRACE] 12:41:44.949 shell.go:GOOS() - 0s
[TRACE] 12:41:44.949 shell.go:GOOS() - 0s
[TRACE] 12:41:44.949 shell.go:PathSeparator() - 0s
[DEBUG] 12:41:44.949 properties.go:GetString:28 → agnoster
[DEBUG] 12:41:44.949 properties.go:GetString:28 → 
[DEBUG] 12:41:44.949 properties.go:GetString:28 → <#93d0ff> » </>
[TRACE] 12:41:44.949 shell.go:PathSeparator() - 0s
[TRACE] 12:41:44.949 shell.go:PathSeparator() - 0s
[TRACE] 12:41:44.949 shell.go:Pwd() - 0s
[TRACE] 12:41:44.949 shell_windows.go:IsWsl() - 0s
[TRACE] 12:41:44.949 shell.go:StackCount() - 0s
[DEBUG] 12:41:44.949 win32_windows.go:isWriteable:299 → not current user or in group
[DEBUG] 12:41:44.949 win32_windows.go:isWriteable:299 → not current user or in group
[DEBUG] 12:41:44.949 win32_windows.go:isWriteable:299 → not current user or in group
[DEBUG] 12:41:44.949 win32_windows.go:isWriteable:299 → not current user or in group
[DEBUG] 12:41:44.949 win32_windows.go:isWriteable:303 → current user is member of S-1-5-32-544
[DEBUG] 12:41:44.949 win32_windows.go:isWriteable:311 ↓
    SYNCHRONIZE
    DELETE
    READ_CONTROL
[DEBUG] 12:41:44.949 win32_windows.go:isWriteable:303 → current user is member of S-1-5-32-544
[DEBUG] 12:41:44.949 win32_windows.go:isWriteable:311 → GENERIC_ALL
[DEBUG] 12:41:44.949 win32_windows.go:isWriteable:303 → current user is member of S-1-5-32-545
[DEBUG] 12:41:44.949 win32_windows.go:isWriteable:311 ↓
    SYNCHRONIZE
    READ_CONTROL
[DEBUG] 12:41:44.949 win32_windows.go:isWriteable:303 → current user is member of S-1-5-32-545
[DEBUG] 12:41:44.949 win32_windows.go:isWriteable:311 ↓
    GENERIC_READ
    GENERIC_EXECUTE
[DEBUG] 12:41:44.949 win32_windows.go:isWriteable:299 → not current user or in group
[DEBUG] 12:41:44.949 win32_windows.go:isWriteable:299 → not current user or in group
[DEBUG] 12:41:44.949 win32_windows.go:isWriteable:299 → not current user or in group
[DEBUG] 12:41:44.949 win32_windows.go:isWriteable:299 → not current user or in group
[DEBUG] 12:41:44.949 win32_windows.go:isWriteable:299 → not current user or in group
[DEBUG] 12:41:44.949 win32_windows.go:isWriteable:317 → no write access
[TRACE] 12:41:44.949 shell_windows.go:DirIsWritable() - 470.7µs
[TRACE] 12:41:44.949 shell.go:TemplateCache() - 0s
[TRACE] 12:41:44.950 shell.go:TemplateCache() - 0s
[TRACE] 12:41:44.950 shell.go:Shell() - 0s
[TRACE] 12:41:44.950 shell.go:Flags() - 0s
[DEBUG] 12:41:44.950 block.go:Debug:230 → Segment: exit
[TRACE] 12:41:44.950 shell.go:Pwd() - 0s
[DEBUG] 12:41:44.950 shell_windows.go:56 → C:\Users\ethan
[TRACE] 12:41:44.950 shell.go:GOOS() - 0s
[TRACE] 12:41:44.950 shell.go:ErrorCode() - 0s
[DEBUG] 12:41:44.950 properties.go:GetBool:22 → always_enabled: true
[TRACE] 12:41:44.950 shell.go:TemplateCache() - 0s
[TRACE] 12:41:44.950 shell.go:Shell() - 0s
[TRACE] 12:41:44.950 shell.go:TemplateCache() - 0s
[DEBUG] 12:41:44.950 shell.go:Getenv:398 → C:\Users\ethan\AppData\Local
[TRACE] 12:41:44.950 shell.go:Getenv(LOCALAPPDATA) - 0s
[TRACE] 12:41:44.950 shell_windows.go:CachePath() - 0s
[TRACE] 12:41:44.950 shell.go:Flags() - 0s
RuiNtD commented 1 year ago

It's also worth noting that oh-my-posh get shell returns python instead of xonsh

JanDeDobbeleer commented 1 year ago

It's also worth noting that oh-my-posh get shell returns python instead of xonsh

@RuiNtD we can't solve that. The parent process is python as that's where xonsh runs. We hardcode it in the init script so there's no functional issue. I'm kind of hoping that users who run xonsh know they're running xonsh.

RuiNtD commented 1 year ago

Hello. This issue actually isn't resolved. OMP on Xonsh is now showing the exact same issue as #3740. Only difference is that the outputted malformed code from the init command isn't causing Xonsh to error, just resulting in an OMP config error.

I also posted about this in the #help channel on the Discord, if it's easier to communicate there.

image

github-actions[bot] commented 9 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.