JanDeDobbeleer / oh-my-posh

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

When using nushell with --no-history I get error on oh-my-posh.nu #4887

Closed luislopes-outsystems closed 4 weeks ago

luislopes-outsystems commented 1 month ago

Code of Conduct

What happened?

When trying to use a nushell with history deactivated with nu --no-history I get the following:

 25 │     # this obviously isn't bulletproof, but it's a start
 26 │     let clear = (history | is-empty) or ((history | last 1 | get 0.command) == "clear")
    ·                                                     ──┬─┬
    ·                                                       │ ╰── input type: null
    ·                                                       ╰── only list, binary or range input data is supported

history is null and this statement fails.

Theme

the error does not depend on the theme

What OS are you seeing the problem on?

Windows

Which shell are you using?

nu

Log output

Version: 19.24.2

Shell: nu (0.92.2)

Prompt:

 nicom@nico-pc  ~\.local\share\chezmoi  main≡ 0ms  

Segments:

ConsoleTitle(false)                        -   0 ms
Root(false)                                -   0 ms
Session(true)                              -   1 ms
Path(true)                                 -   1 ms
Git(true)                                  -  19 ms
Status(false)                              -   1 ms
Executiontime(true)                        -   1 ms

Run duration: 25.9289ms

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

Config path: C:\Users\nicom\.myagnoster.omp.json

Logs:

[DEBUG] 00:22:07.827 shell.go:Getenv:325 → NO DATA
[TRACE] 00:22:07.827 shell.go:Getenv(TERM_PROGRAM) - 509.9µs
[DEBUG] 00:22:07.827 shell.go:Getenv:325 → C:\Users\nicom\AppData\Local
[TRACE] 00:22:07.827 shell.go:Getenv(LOCALAPPDATA) - 0s
[TRACE] 00:22:07.827 shell_windows.go:CachePath() - 0s
[DEBUG] 00:22:07.827 shell.go:Getenv:325 → C:\Users\nicom\.myagnoster.omp.json
[TRACE] 00:22:07.827 shell.go:Getenv(POSH_THEME) - 0s
[DEBUG] 00:22:07.827 shell.go:Shell:593 → no shell name provided in flags, trying to detect it
[DEBUG] 00:22:07.831 shell.go:Shell:601 → process name: nu.exe
[TRACE] 00:22:07.831 shell.go:Shell() - 4.2993ms
[TRACE] 00:22:07.831 shell.go:resolveConfigPath() - 4.2993ms
[TRACE] 00:22:07.831 shell.go:Init() - 4.8092ms
[TRACE] 00:22:07.831 shell.go:Flags() - 0s
[TRACE] 00:22:07.831 config.go:loadConfig() - 0s
[TRACE] 00:22:07.831 shell.go:Flags() - 0s
[TRACE] 00:22:07.831 shell.go:Shell() - 0s
[DEBUG] 00:22:07.831 shell.go:Getenv:325 → NO DATA
[TRACE] 00:22:07.831 shell.go:Getenv(OMP_CACHE_DISABLED) - 0s
[TRACE] 00:22:07.832 shell_windows.go:WindowsRegistryKeyValue(HKEY_CURRENT_USER\Software\Microsoft\Windows\DWM\ColorizationColor) - 0s
[TRACE] 00:22:07.832 shell.go:GOOS() - 0s
[TRACE] 00:22:07.832 shell.go:GOOS() - 0s
[TRACE] 00:22:07.832 shell.go:GOOS() - 0s
[TRACE] 00:22:07.832 shell.go:GOOS() - 0s
[TRACE] 00:22:07.832 shell.go:GOOS() - 0s
[TRACE] 00:22:07.832 shell.go:GOOS() - 0s
[TRACE] 00:22:07.832 shell.go:GOOS() - 0s
[TRACE] 00:22:07.832 shell.go:GOOS() - 0s
[TRACE] 00:22:07.832 shell.go:GOOS() - 0s
[TRACE] 00:22:07.832 shell.go:GOOS() - 0s
[TRACE] 00:22:07.832 shell.go:GOOS() - 0s
[TRACE] 00:22:07.832 shell.go:GOOS() - 0s
[TRACE] 00:22:07.832 shell.go:GOOS() - 0s
[TRACE] 00:22:07.832 shell.go:GOOS() - 0s
[TRACE] 00:22:07.832 shell.go:GOOS() - 0s
[TRACE] 00:22:07.832 shell.go:GOOS() - 0s
[TRACE] 00:22:07.832 shell.go:GOOS() - 0s
[TRACE] 00:22:07.832 shell.go:GOOS() - 0s
[TRACE] 00:22:07.832 shell.go:GOOS() - 0s
[DEBUG] 00:22:07.832 shell_windows.go:WindowsRegistryKeyValue:217 → ColorizationColor(DWORD): 0xC4506773
[TRACE] 00:22:07.832 shell.go:Shell() - 0s
[DEBUG] 00:22:07.832 shell.go:Getenv:325 → 0.92.2
[TRACE] 00:22:07.832 shell.go:Getenv(POSH_SHELL_VERSION) - 0s
[DEBUG] 00:22:07.832 debug.go:PrintDebug:22 → Segment: Title
[DEBUG] 00:22:07.832 text.go:Render:70 → Rendering template:
[DEBUG] 00:22:07.832 shell.go:Getenv:325 → NO DATA
[TRACE] 00:22:07.832 shell.go:Getenv(POSH_CURSOR_LINE) - 0s
[DEBUG] 00:22:07.832 shell.go:Getenv:325 → NO DATA
[TRACE] 00:22:07.832 shell.go:Getenv(POSH_CURSOR_COLUMN) - 0s
[TRACE] 00:22:07.832 shell.go:Flags() - 0s
[TRACE] 00:22:07.832 shell.go:Flags() - 0s
[TRACE] 00:22:07.832 shell.go:Shell() - 0s
[TRACE] 00:22:07.832 shell.go:Shell() - 0s
[TRACE] 00:22:07.832 shell.go:Flags() - 0s
[TRACE] 00:22:07.832 shell.go:Flags() - 0s
[TRACE] 00:22:07.832 shell.go:GOOS() - 0s
[TRACE] 00:22:07.832 shell.go:Flags() - 0s
[TRACE] 00:22:07.832 shell.go:Flags() - 0s
[DEBUG] 00:22:07.832 properties.go:GetString:28 → {{ .Code }}
[DEBUG] 00:22:07.832 shell.go:Pwd:355 → C:\Users\nicom\.local\share\chezmoi
[TRACE] 00:22:07.832 shell.go:Flags() - 0s
[TRACE] 00:22:07.832 shell.go:Pwd() - 0s
[DEBUG] 00:22:07.832 shell_windows.go:58 → C:\Users\nicom
[TRACE] 00:22:07.832 shell.go:GOOS() - 0s
[TRACE] 00:22:07.832 shell.go:Pwd() - 0s
[DEBUG] 00:22:07.832 segment.go:SetEnabled:532 → Segment: Executiontime
[DEBUG] 00:22:07.832 shell_windows.go:58 → C:\Users\nicom
[DEBUG] 00:22:07.832 properties.go:GetBool:22 → always_enabled: true
[TRACE] 00:22:07.832 shell.go:GOOS() - 0s
[TRACE] 00:22:07.832 shell.go:ExecutionTime() - 0s
[DEBUG] 00:22:07.832 segment.go:SetEnabled:532 → Segment: Path
[DEBUG] 00:22:07.832 properties.go:GetFloat64:34 → threshold: 500.000000
[TRACE] 00:22:07.832 shell.go:Flags() - 0s
[DEBUG] 00:22:07.832 properties.go:GetString:28 → austin
[TRACE] 00:22:07.832 shell.go:Pwd() - 0s
[TRACE] 00:22:07.832 shell.go:Shell() - 0s
[TRACE] 00:22:07.832 shell.go:Shell() - 0s
[TRACE] 00:22:07.832 shell.go:Pwd() - 0s
[DEBUG] 00:22:07.832 shell_windows.go:58 → C:\Users\nicom
[TRACE] 00:22:07.832 shell.go:GOOS() - 0s
[TRACE] 00:22:07.832 shell_windows.go:Root() - 0s
[TRACE] 00:22:07.832 shell.go:Shell() - 0s
[TRACE] 00:22:07.832 shell.go:StatusCodes() - 0s
[TRACE] 00:22:07.832 shell_windows.go:IsWsl() - 0s
[TRACE] 00:22:07.832 shell.go:Pwd() - 0s
[DEBUG] 00:22:07.832 shell_windows.go:58 → C:\Users\nicom
[TRACE] 00:22:07.832 shell.go:GOOS() - 0s
[DEBUG] 00:22:07.832 segment.go:SetEnabled:532 → Segment: Session
[DEBUG] 00:22:07.832 shell.go:Getenv:325 → NO DATA
[TRACE] 00:22:07.832 shell.go:Getenv(SSH_CONNECTION) - 0s
[DEBUG] 00:22:07.832 shell.go:Getenv:325 → NO DATA
[TRACE] 00:22:07.832 shell.go:Pwd() - 0s
[DEBUG] 00:22:07.832 properties.go:GetBool:22 → mapped_locations_enabled: true
[TRACE] 00:22:07.832 shell_windows.go:Root() - 0s
[TRACE] 00:22:07.832 shell.go:Pwd() - 0s
[DEBUG] 00:22:07.832 properties.go:GetString:28 → 
[DEBUG] 00:22:07.832 shell_windows.go:58 → C:\Users\nicom
[TRACE] 00:22:07.832 shell.go:GOOS() - 0s
[DEBUG] 00:22:07.832 properties.go:GetString:28 → 
[DEBUG] 00:22:07.832 segment.go:SetEnabled:532 → Segment: Status
[TRACE] 00:22:07.832 shell.go:StatusCodes() - 0s
[DEBUG] 00:22:07.832 shell_windows.go:58 → C:\Users\nicom
[TRACE] 00:22:07.832 shell.go:GOOS() - 0s
[TRACE] 00:22:07.832 shell.go:GOOS() - 0s
[DEBUG] 00:22:07.832 properties.go:GetString:28 → ~
[DEBUG] 00:22:07.832 properties.go:GetKeyValueMap:46 → mapped_locations: map[C:\Program Files\OutSystems\Development Environment 11:⊚ DevEnv11 C:\Program Files\OutSystems\Platform Server:⊚ PSRoot C:\git\DBTEAM:⊚  C:\git\Platform:⊚ Platform]
[DEBUG] 00:22:07.832 text.go:Render:70 → Rendering template: C:\Program Files\OutSystems\Platform Server
[TRACE] 00:22:07.832 shell.go:GOOS() - 0s
[TRACE] 00:22:07.832 shell.go:GOOS() - 0s
[DEBUG] 00:22:07.832 text.go:Render:70 → Rendering template: C:\Program Files\OutSystems\Development Environment 11
[TRACE] 00:22:07.832 shell.go:GOOS() - 0s
[TRACE] 00:22:07.832 shell.go:GOOS() - 0s
[TRACE] 00:22:07.832 shell.go:Getenv(SSH_CLIENT) - 0s
[DEBUG] 00:22:07.832 text.go:Render:70 → Rendering template: C:\git\Platform
[TRACE] 00:22:07.832 shell.go:GOOS() - 0s
[TRACE] 00:22:07.832 shell.go:GOOS() - 0s
[DEBUG] 00:22:07.832 text.go:Render:70 → Rendering template: C:\git\DBTEAM
[TRACE] 00:22:07.832 shell.go:GOOS() - 0s
[TRACE] 00:22:07.832 shell.go:GOOS() - 0s
[TRACE] 00:22:07.832 shell.go:PathSeparator() - 0s
[TRACE] 00:22:07.832 shell.go:GOOS() - 0s
[TRACE] 00:22:07.832 shell.go:GOOS() - 0s
[DEBUG] 00:22:07.832 segment.go:SetEnabled:532 → Segment: Git
[TRACE] 00:22:07.832 shell.go:GOOS() - 0s
[DEBUG] 00:22:07.832 shell.go:Getenv:325 → C:\Users\nicom\AppData\Local
[TRACE] 00:22:07.832 shell.go:Getenv(LOCALAPPDATA) - 0s
[TRACE] 00:22:07.832 shell.go:GOOS() - 0s
[TRACE] 00:22:07.832 shell.go:GOOS() - 0s
[TRACE] 00:22:07.833 shell.go:GOOS() - 0s
[TRACE] 00:22:07.833 shell.go:GOOS() - 0s
[TRACE] 00:22:07.833 shell.go:GOOS() - 0s
[TRACE] 00:22:07.833 shell.go:PathSeparator() - 0s
[TRACE] 00:22:07.833 shell.go:PathSeparator() - 0s
[TRACE] 00:22:07.833 shell.go:GOOS() - 0s
[TRACE] 00:22:07.833 shell.go:GOOS() - 0s
[DEBUG] 00:22:07.833 shell.go:TemplateCache:774 → environment: [ALLUSERSPROFILE=C:\ProgramData APPDATA=C:\Users\nicom\AppData\Roaming ChocolateyInstall=C:\ProgramData\chocolatey ChocolateyLastPathUpdate="133214613610439666" CMD_DURATION_MS=222 CommonProgramFiles=C:\Program Files\Common Files CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files CommonProgramW6432=C:\Program Files\Common Files COMPUTERNAME=NICO-PC ComSpec=C:\Windows\system32\cmd.exe DIRS_POSITION=0 DriverData=C:\Windows\System32\Drivers\DriverData HOMEDRIVE=C: HOMEPATH=\Users\nicom HOME_DIR=\Users\nicom IGCCSVC_DB=AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAAoVW6sMnLU0SkGjR02GJyKgQAAAACAAAAAAAQZgAAAAEAACAAAAABK057KReWuWzVNU2HilGt8IyvIpb52s8z9vyj2ajLxQAAAAAOgAAAAAIAACAAAADenqXYi/1G1vI0wX29zRgAXC6F3xqwErGJPYTRvLjgHWAAAACEoKpNlM0/FkebKXFxnjgfjiajTaVfDZHQwYrqzUJXN/YQn09Hdyxrx5q3Ib2Y1eIeydoifJk5hV+a/ZtsYms4Dqbu2XlkCCiK6+S8PyGz1nd+6l/bvZOJ8xoi6PFnC0RAAAAAUwBcfWVZplXxmBR0+t1anezW4NxtMKdZ60IQifX+XhNsOTh1y7CFwrvKSHeXzdBrzj0SIv6LQvMwkHQIenlZaQ== LAST_EXIT_CODE=1 LOCALAPPDATA=C:\Users\nicom\AppData\Local LOGONSERVER=\\NICO-PC NUMBER_OF_PROCESSORS=20 NU_LOG_DATE_FORMAT=%Y-%m-%dT%H:%M:%S%.3f NU_LOG_FORMAT=%ANSI_START%%DATE%|%LEVEL%|%MSG%%ANSI_STOP% NU_VERSION=0.92.2 OneDrive=C:\Users\nicom\OneDrive OneDriveConsumer=C:\Users\nicom\OneDrive OS=Windows_NT Path=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\ProgramData\chocolatey\bin;c:\tools\scripts;C:\Program Files\Git\cmd;C:\Program Files\PowerShell\7\;C:\Program Files\nu\bin\;C:\Users\nicom\AppData\Local\Microsoft\WindowsApps;C:\Users\nicom\AppData\Local\Programs\oh-my-posh\bin;C:\Users\nicom\AppData\Local\Programs\Microsoft VS Code\bin;C:\tools\ffmpeg\bin;C:\Users\nicom\AppData\Local\GitHubDesktop\bin;C:\Users\nicom\AppData\Local\Microsoft\WinGet\Packages\ajeetdsouza.zoxide_Microsoft.Winget.Source_8wekyb3d8bbwe;C:\Program Files\Neovim\bin;C:\Users\nicom\AppData\Local\Microsoft\WinGet\Packages\twpayne.chezmoi_Microsoft.Winget.Source_8wekyb3d8bbwe;C:\Users\nicom\AppData\Local\Microsoft\WinGet\Packages\BurntSushi.ripgrep.MSVC_Microsoft.Winget.Source_8wekyb3d8bbwe\ripgrep-14.1.0-x86_64-pc-windows-msvc;C:\Users\nicom\.local\share\chezmoi\ PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC POSH_INSTALLER=winget POSH_PID=aa5b3398-1b2f-46d0-89e2-4c09391df3b4 POSH_SHELL_VERSION=0.92.2 POSH_THEME=C:\Users\nicom\.myagnoster.omp.json POSH_THEMES_PATH=C:\Users\nicom\AppData\Local\Programs\oh-my-posh\themes POWERLINE_COMMAND=oh-my-posh POWERSHELL_DISTRIBUTION_CHANNEL=MSI:Windows 10 Pro PROCESSOR_ARCHITECTURE=AMD64 PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 183 Stepping 1, GenuineIntel PROCESSOR_LEVEL=6 PROCESSOR_REVISION=b701 ProgramData=C:\ProgramData ProgramFiles=C:\Program Files ProgramFiles(x86)=C:\Program Files (x86) ProgramW6432=C:\Program Files PROMPT_INDICATOR= PROMPT_MULTILINE_INDICATOR=>  PSModulePath=C:\Program Files\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules PUBLIC=C:\Users\Public PWD=C:\Users\nicom\.local\share\chezmoi SESSIONNAME=Console SystemDrive=C: SystemRoot=C:\Windows TEMP=C:\Users\nicom\AppData\Local\Temp TMP=C:\Users\nicom\AppData\Local\Temp USERDOMAIN=NICO-PC USERDOMAIN_ROAMINGPROFILE=NICO-PC USERNAME=nicom USERPROFILE=C:\Users\nicom windir=C:\Windows WSLENV=WT_SESSION:WT_PROFILE_ID: WT_PROFILE_ID={aab79973-318f-43b6-a9bc-b4096493753f} WT_SESSION=384d15f0-7d30-49d5-80d1-ded3deb216a1 ZES_ENABLE_SYSMAN=1]
[TRACE] 00:22:07.833 shell.go:GOOS() - 0s
[TRACE] 00:22:07.833 shell.go:PathSeparator() - 0s
[TRACE] 00:22:07.833 shell.go:GOOS() - 0s
[TRACE] 00:22:07.833 shell.go:GOOS() - 0s
[TRACE] 00:22:07.833 shell.go:GOOS() - 0s
[TRACE] 00:22:07.833 shell.go:PathSeparator() - 0s
[TRACE] 00:22:07.833 shell.go:GOOS() - 0s
[TRACE] 00:22:07.833 shell.go:Pwd() - 0s
[TRACE] 00:22:07.833 shell.go:GOOS() - 0s
[TRACE] 00:22:07.833 shell.go:GOOS() - 0s
[DEBUG] 00:22:07.833 shell_windows.go:58 → C:\Users\nicom
[TRACE] 00:22:07.833 shell.go:GOOS() - 0s
[TRACE] 00:22:07.833 shell.go:GOOS() - 0s
[TRACE] 00:22:07.833 shell.go:PathSeparator() - 0s
[TRACE] 00:22:07.833 shell.go:GOOS() - 0s
[TRACE] 00:22:07.833 shell.go:GOOS() - 0s
[TRACE] 00:22:07.833 shell.go:PathSeparator() - 0s
[TRACE] 00:22:07.833 shell.go:GOOS() - 0s
[TRACE] 00:22:07.833 shell.go:GOOS() - 0s
[TRACE] 00:22:07.833 shell.go:GOOS() - 0s
[TRACE] 00:22:07.833 shell.go:GOOS() - 0s
[TRACE] 00:22:07.833 shell.go:PathSeparator() - 0s
[TRACE] 00:22:07.833 shell.go:GOOS() - 0s
[TRACE] 00:22:07.833 shell.go:GOOS() - 0s
[TRACE] 00:22:07.833 shell.go:GOOS() - 0s
[DEBUG] 00:22:07.833 properties.go:GetString:28 → NO DATA
[DEBUG] 00:22:07.833 shell.go:User:493 → nicom
[DEBUG] 00:22:07.833 shell_windows.go:58 → C:\Users\nicom
[TRACE] 00:22:07.833 shell.go:User() - 0s
[TRACE] 00:22:07.833 shell.go:PathSeparator() - 0s
[TRACE] 00:22:07.833 shell.go:PathSeparator() - 0s
[TRACE] 00:22:07.833 shell.go:PathSeparator() - 0s
[TRACE] 00:22:07.833 shell.go:PathSeparator() - 0s
[DEBUG] 00:22:07.833 properties.go:GetString:28 → agnoster_full
[TRACE] 00:22:07.833 shell.go:PathSeparator() - 0s
[DEBUG] 00:22:07.833 properties.go:GetStringArray:52 → cycle: []
[DEBUG] 00:22:07.833 properties.go:GetString:28 → NO DATA
[TRACE] 00:22:07.833 shell.go:PathSeparator() - 0s
[DEBUG] 00:22:07.833 properties.go:GetString:28 → \
[DEBUG] 00:22:07.833 properties.go:GetBool:22 → cycle_folder_separator: false
[DEBUG] 00:22:07.833 properties.go:GetString:28 → %s
[DEBUG] 00:22:07.833 properties.go:GetString:28 → %s
[DEBUG] 00:22:07.833 properties.go:GetString:28 → %s
[DEBUG] 00:22:07.833 properties.go:GetString:28 → %s
[TRACE] 00:22:07.833 shell.go:PathSeparator() - 0s
[DEBUG] 00:22:07.833 shell.go:Host:505 → nico-pc
[TRACE] 00:22:07.833 shell.go:Pwd() - 0s
[TRACE] 00:22:07.833 shell.go:Host() - 0s
[TRACE] 00:22:07.833 shell.go:GOOS() - 0s
[TRACE] 00:22:07.833 shell_windows.go:IsWsl() - 0s
[TRACE] 00:22:07.833 shell.go:StackCount() - 0s
[DEBUG] 00:22:07.833 shell.go:Getenv:325 → NO DATA
[TRACE] 00:22:07.833 shell.go:Getenv(SHLVL) - 0s
[TRACE] 00:22:07.833 shell.go:TemplateCache() - 1.0535ms
[TRACE] 00:22:07.833 shell.go:TemplateCache() - 509.6µs
[TRACE] 00:22:07.833 shell.go:TemplateCache() - 0s
[DEBUG] 00:22:07.833 properties.go:GetBool:22 → always_enabled: false
[DEBUG] 00:22:07.833 win32_windows.go:isWriteable:299 → not current user or in group
[DEBUG] 00:22:07.833 win32_windows.go:isWriteable:303 → current user is member of S-1-5-32-544
[DEBUG] 00:22:07.833 win32_windows.go:isWriteable:311 ↓
    WRITE_DAC
    WRITE_OWNER
    SYNCHRONIZE
    DELETE
    READ_CONTROL
[DEBUG] 00:22:07.833 win32_windows.go:isWriteable:313 → user has write access
[TRACE] 00:22:07.833 shell_windows.go:DirIsWritable() - 511.3µs
[TRACE] 00:22:07.833 shell.go:TemplateCache() - 0s
[DEBUG] 00:22:07.834 shell.go:CommandPath:545 → C:\Program Files\Git\cmd\git.exe
[TRACE] 00:22:07.834 shell.go:CommandPath(git.exe) - 1.5342ms
[TRACE] 00:22:07.834 shell.go:HasCommand(git.exe) - 1.5342ms
[TRACE] 00:22:07.834 shell.go:Pwd() - 0s
[TRACE] 00:22:07.834 shell.go:HasParentFilePath(.git) - 0s
[DEBUG] 00:22:07.834 properties.go:GetStringArray:52 → exclude_folders: [~]
[DEBUG] 00:22:07.834 shell_windows.go:58 → C:\Users\nicom
[TRACE] 00:22:07.834 shell.go:GOOS() - 0s
[DEBUG] 00:22:07.834 shell_windows.go:58 → C:\Users\nicom
[TRACE] 00:22:07.834 shell.go:GOOS() - 0s
[TRACE] 00:22:07.834 shell.go:GOOS() - 0s
[TRACE] 00:22:07.834 shell.go:GOOS() - 0s
[DEBUG] 00:22:07.834 properties.go:GetBool:22 → fetch_user: false
[TRACE] 00:22:07.834 shell.go:GOOS() - 0s
[TRACE] 00:22:07.834 shell.go:GOOS() - 0s
[TRACE] 00:22:07.834 shell.go:GOOS() - 0s
[TRACE] 00:22:07.834 shell.go:GOOS() - 0s
[TRACE] 00:22:07.834 shell.go:GOOS() - 0s
[TRACE] 00:22:07.834 shell.go:GOOS() - 0s
[TRACE] 00:22:07.834 shell.go:GOOS() - 0s
[TRACE] 00:22:07.834 shell.go:GOOS() - 0s
[DEBUG] 00:22:07.834 shell.go:Getenv:325 → NO DATA
[TRACE] 00:22:07.834 shell.go:Getenv(POSH_GIT_STATUS) - 0s
[DEBUG] 00:22:07.834 properties.go:GetBool:22 → fetch_status: true
[DEBUG] 00:22:07.834 properties.go:GetStringArray:52 → ignore_status: []
[DEBUG] 00:22:07.834 shell_windows.go:58 → C:\Users\nicom
[TRACE] 00:22:07.834 shell.go:GOOS() - 0s
[DEBUG] 00:22:07.834 properties.go:GetKeyValueMap:46 → status_formats: map[]
[DEBUG] 00:22:07.834 properties.go:GetKeyValueMap:46 → untracked_modes: map[/Users/LFL/Projects/oh-my-posh/:no]
[DEBUG] 00:22:07.834 properties.go:GetKeyValueMap:46 → ignore_submodules: map[]
[DEBUG] 00:22:07.850 shell.go:RunCommand:523 ↓
    # branch.oid 965f16835e1f276c5b44983468bc5ff00e15348b
    # branch.head main
    # branch.upstream origin/main
    # branch.ab +0 -0
[TRACE] 00:22:07.850 shell.go:RunCommand(git.exe -C C:/Users/nicom/.local/share/chezmoi --no-optional-locks -c core.quotepath=false -c color.status=false status -unormal --branch --porcelain=2) - 16.4781ms
[DEBUG] 00:22:07.850 properties.go:GetString:28 → 
[DEBUG] 00:22:07.850 properties.go:GetInt:40 → branch_max_length: 0
[DEBUG] 00:22:07.850 shell.go:HasFolder:437 → false
[TRACE] 00:22:07.850 shell.go:HasFolder(C:\Users\nicom\.local\share\chezmoi\.git/rebase-merge) - 0s
[DEBUG] 00:22:07.850 shell.go:HasFolder:437 → false
[TRACE] 00:22:07.850 shell.go:HasFolder(C:\Users\nicom\.local\share\chezmoi\.git/rebase-apply) - 0s
[DEBUG] 00:22:07.850 properties.go:GetString:28 → 
[DEBUG] 00:22:07.851 shell.go:HasFilesInDir:408 → false
[TRACE] 00:22:07.851 shell.go:HasFilesInDir(MERGE_MSG) - 503.1µs
[DEBUG] 00:22:07.851 shell.go:HasFilesInDir:408 → false
[TRACE] 00:22:07.851 shell.go:HasFilesInDir(CHERRY_PICK_HEAD) - 0s
[DEBUG] 00:22:07.851 shell.go:HasFilesInDir:408 → false
[TRACE] 00:22:07.851 shell.go:HasFilesInDir(REVERT_HEAD) - 0s
[DEBUG] 00:22:07.851 shell.go:HasFilesInDir:408 → false
[TRACE] 00:22:07.851 shell.go:HasFilesInDir(sequencer/todo) - 0s
[DEBUG] 00:22:07.851 properties.go:GetString:28 → ≡
[DEBUG] 00:22:07.851 properties.go:GetBool:22 → fetch_upstream_icon: true
[DEBUG] 00:22:07.851 properties.go:GetKeyValueMap:46 → upstream_icons: map[]
[DEBUG] 00:22:07.851 properties.go:GetString:28 → 
[TRACE] 00:22:07.851 shell.go:TemplateCache() - 0s
[DEBUG] 00:22:07.851 text.go:Render:70 → Rendering template:  {{ .FormattedMs }} <#95ffa4,#89B4FA> </>
[DEBUG] 00:22:07.851 text.go:Render:70 → Rendering template:  {{ .UserName }}@{{ .HostName }}
[DEBUG] 00:22:07.851 text.go:Render:70 → Rendering template: {{ .UpstreamIcon }}{{ .HEAD }}{{ .BranchStatus }}{{ 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 }}
[DEBUG] 00:22:07.851 text.go:Render:70 → Rendering template:  {{ .Path }}
[TRACE] 00:22:07.851 shell.go:TemplateCache() - 0s
[TRACE] 00:22:07.851 shell.go:Shell() - 0s
[TRACE] 00:22:07.851 shell.go:TemplateCache() - 0s
[TRACE] 00:22:07.851 shell.go:Shell() - 0s
[TRACE] 00:22:07.851 shell.go:TemplateCache() - 0s
[TRACE] 00:22:07.851 shell.go:Shell() - 0s
[TRACE] 00:22:07.851 shell.go:TemplateCache() - 0s
[ERROR] 00:22:07.852 shell.go:FileContent:463 → open C:\Users\nicom\.local\share\chezmoi\.git/logs/refs/stash: The system cannot find the file specified.
[TRACE] 00:22:07.852 shell.go:FileContent(C:\Users\nicom\.local\share\chezmoi\.git/logs/refs/stash) - 506.1µs
[TRACE] 00:22:07.852 shell.go:Shell() - 0s
[DEBUG] 00:22:07.852 text.go:Render:70 → Rendering template: plain
[DEBUG] 00:22:07.852 text.go:Render:70 → Rendering template: plain
[DEBUG] 00:22:07.852 text.go:Render:70 → Rendering template: powerline
[DEBUG] 00:22:07.852 text.go:Render:70 → Rendering template: {{ if or (.Working.Changed) (.Staging.Changed) }}#ffe9aa{{ end }}
[TRACE] 00:22:07.852 shell.go:TemplateCache() - 0s
[DEBUG] 00:22:07.852 text.go:Render:70 → Rendering template: {{ if and (gt .Ahead 0) (gt .Behind 0) }}#FFCC80{{ end }}
[TRACE] 00:22:07.852 shell.go:TemplateCache() - 0s
[DEBUG] 00:22:07.852 text.go:Render:70 → Rendering template: {{ if gt .Ahead 0 }}#B388FF{{ end }}
[TRACE] 00:22:07.852 shell.go:TemplateCache() - 0s
[DEBUG] 00:22:07.852 text.go:Render:70 → Rendering template: {{ if gt .Behind 0 }}#F5C2E7{{ end }}
[TRACE] 00:22:07.852 shell.go:TemplateCache() - 0s
[DEBUG] 00:22:07.852 text.go:Render:70 → Rendering template: powerline
[DEBUG] 00:22:07.852 text.go:Render:70 → Rendering template: powerline
[DEBUG] 00:22:07.852 text.go:Render:70 → Rendering template: powerline
[TRACE] 00:22:07.852 shell.go:Shell() - 0s
[TRACE] 00:22:07.852 shell.go:Shell() - 0s
[TRACE] 00:22:07.852 shell.go:Shell() - 0s
[TRACE] 00:22:07.852 shell.go:Pwd() - 0s
[TRACE] 00:22:07.852 shell.go:Shell() - 0s
[DEBUG] 00:22:07.852 text.go:Render:70 → Rendering template: osc99
[DEBUG] 00:22:07.852 shell.go:User:493 → nicom
[TRACE] 00:22:07.852 shell.go:User() - 0s
[DEBUG] 00:22:07.852 shell.go:Host:505 → nico-pc
[TRACE] 00:22:07.852 shell.go:Host() - 0s
[TRACE] 00:22:07.852 shell.go:Shell() - 0s
[DEBUG] 00:22:07.852 shell.go:Getenv:325 → C:\Users\nicom\AppData\Local
[TRACE] 00:22:07.852 shell.go:Getenv(LOCALAPPDATA) - 0s
[TRACE] 00:22:07.852 shell_windows.go:CachePath() - 0s
[TRACE] 00:22:07.852 shell.go:Flags() - 0s
ivan-the-terrible commented 4 weeks ago

Unfortunately, this is not really related to oh-my-posh... First and foremost, I've never used Nushell, but this looks really cool! So thanks for that discovery.

So I've been able to duplicate this problem within a fresh Ubuntu installation (via Docker) and have Nushell produce the same output without oh-my-posh installed:

image

Your question seems a little oxymoronic. nu --no-history will not retain history. Piping history to last 1 will produce an error... because there is no history. Thus, history returns null and last expects a list, binary or range input.

@JanDeDobbeleer, in my opinion, this can be closed.

JanDeDobbeleer commented 4 weeks ago

@ivan-the-terrible we can always check if history is available. If not, default to something sensible and not crash the initialization.

ivan-the-terrible commented 4 weeks ago

That makes sense. I didn't realize oh-my-posh officially supported nushell. What would be the course of action? To raise an issue or attempt to put out a PR there?

JanDeDobbeleer commented 4 weeks ago

@ivan-the-terrible I don't mind solving this one. Nushell is my daily driver anyways 😃

ivan-the-terrible commented 4 weeks ago

Sounds good, I'm very curious to see the result!

fdncred commented 4 weeks ago

Hey @JanDeDobbeleer, you maight try checking $nu.history-enabled. I'm hopeful that will work and solve this probem if put in your nushell script.

ivan-the-terrible commented 4 weeks ago

Man I am so stupid. I didn't realize this was actually affecting code here in the codebase 🤦🏼 I thought it was just an issue with the way the history command worked in Nu. My bad, @JanDeDobbeleer nice fix!

JanDeDobbeleer commented 4 weeks ago

@ivan-the-terrible hope you learned something!