JanDeDobbeleer / oh-my-posh

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

.Code value isnt always correct from the latest executed command #5761

Closed mirzahilmi closed 1 month ago

mirzahilmi commented 1 month ago

Code of Conduct

What happened?

Im trying to customize my transient prompt color to be red when the last command exit status code is not 0, otherwise green. But here the behavior isnt what i expected:

image

Theme

{
    "$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
    "blocks": [
        {
            "alignment": "left",
            "segments": [
                {
                    "foreground": "cyan",
                    "properties": {
                        "style": "agnoster_short",
                        "home_icon": "~"
                    },
                    "style": "plain",
                    "template": ":{{ .Path }} ",
                    "type": "path"
                },
                {
                    "foreground": "#ff94df",
                    "properties": {
                        "branch_icon": " <#ff94df><b>\ue0a0 </b></>",
                        "fetch_stash_count": true
                    },
                    "style": "plain",
                    "template": "<#ffffff>on</> {{ .HEAD }}{{ if gt .StashCount 0 }} \ueb4b {{ .StashCount }}{{ end }} ",
                    "type": "git"
                },
                {
                    "style": "plain",
                    "foreground": "lightGreen",
                    "template": "$ ",
                    "type": "text"
                }
            ],
            "type": "prompt"
        }
    ],
    "transient_prompt": {
        "background": "transparent",
        "foreground_templates": [
            "{{ if gt .Code 0 }}red{{ end }}",
            "{{ if eq .Code 0 }}lightGreen{{ end }}"
        ],
        "template": "{{ now | date \"15:04:05\" }} $ "
    },
    "version": 2
}

What OS are you seeing the problem on?

Linux

Which shell are you using?

zsh

Log output

Version: 19.29.0

Shell: zsh (5.9)

Prompt:

:~/../nixfiles on   master $

Segments:

ConsoleTitle(false)                       -   0 ms
Path(true)                                -   0 ms
Git(true)                                 -   0 ms
Text(true)                                -   0 ms

Run duration: 6.321095ms

Cache path: /home/mirza/.cache/oh-my-posh

Config path: /home/mirza/.config/oh-my-posh/config.json

Logs:

[DEBUG] 15:35:11.892 shell.go:Getenv:325 → tmux
[TRACE] 15:35:11.892 shell.go:Getenv(TERM_PROGRAM) - 67.798µs
[DEBUG] 15:35:11.892 shell.go:Getenv:325 → NO DATA
[TRACE] 15:35:11.892 shell.go:Getenv(OMP_CACHE_DIR) - 4.469µs
[DEBUG] 15:35:11.892 shell.go:Getenv:325 → /home/mirza/.cache
[TRACE] 15:35:11.892 shell.go:Getenv(XDG_CACHE_HOME) - 2.715µs
[TRACE] 15:35:11.892 shell_unix.go:CachePath() - 26.721µs
[DEBUG] 15:35:11.894 shell.go:Getenv:325 → /home/mirza/.config/oh-my-posh/config.json
[TRACE] 15:35:11.894 shell.go:Getenv(POSH_THEME) - 19.026µs
[DEBUG] 15:35:11.894 shell_unix.go:Platform:87 → nixos
[TRACE] 15:35:11.894 shell.go:resolveConfigPath() - 35.035µs
[TRACE] 15:35:11.894 shell.go:Init() - 2.591719ms
[TRACE] 15:35:11.894 shell.go:Flags() - 100ns
[TRACE] 15:35:11.895 config.go:loadConfig() - 581.422µs
[TRACE] 15:35:11.895 shell.go:Flags() - 30ns
[DEBUG] 15:35:11.895 shell.go:Getenv:325 → NO DATA
[TRACE] 15:35:11.896 shell.go:Getenv(OMP_CACHE_DISABLED) - 444.556µs
[DEBUG] 15:35:11.896 shell.go:Shell:593 → no shell name provided in flags, trying to detect it
[DEBUG] 15:35:11.897 shell.go:Shell:601 → process name: zsh
[TRACE] 15:35:11.897 shell.go:Shell() - 1.472828ms
[DEBUG] 15:35:11.897 shell.go:Getenv:325 → 5.9
[TRACE] 15:35:11.897 shell.go:Getenv(POSH_SHELL_VERSION) - 3.817µs
[DEBUG] 15:35:11.897 debug.go:PrintDebug:22 → Segment: Title
[DEBUG] 15:35:11.897 text.go:Render:70 → Rendering template:
[DEBUG] 15:35:11.897 shell.go:Getenv:325 → NO DATA
[TRACE] 15:35:11.897 shell.go:Getenv(POSH_CURSOR_LINE) - 7.545µs
[DEBUG] 15:35:11.897 shell.go:Getenv:325 → NO DATA
[TRACE] 15:35:11.897 shell.go:Getenv(POSH_CURSOR_COLUMN) - 1.994µs
[TRACE] 15:35:11.897 shell.go:Flags() - 40ns
[TRACE] 15:35:11.897 shell.go:Flags() - 30ns
[TRACE] 15:35:11.897 shell.go:Shell() - 40ns
[TRACE] 15:35:11.897 shell.go:Shell() - 20ns
[TRACE] 15:35:11.897 shell.go:Flags() - 81ns
[TRACE] 15:35:11.897 shell.go:Flags() - 160ns
[TRACE] 15:35:11.897 shell.go:GOOS() - 70ns
[DEBUG] 15:35:11.897 shell.go:Pwd:355 → /home/mirza/.config/nixfiles
[TRACE] 15:35:11.897 shell.go:Pwd() - 13.816µs
[TRACE] 15:35:11.897 shell.go:Pwd() - 90ns
[TRACE] 15:35:11.897 shell.go:GOOS() - 20ns
[TRACE] 15:35:11.897 shell.go:GOOS() - 40ns
[DEBUG] 15:35:11.897 segment.go:SetEnabled:535 → Segment: Text
[TRACE] 15:35:11.897 shell_unix.go:Root() - 320ns
[DEBUG] 15:35:11.897 segment.go:SetEnabled:535 → Segment: Path
[TRACE] 15:35:11.897 shell.go:Shell() - 50ns
[TRACE] 15:35:11.897 shell.go:StatusCodes() - 130ns
[TRACE] 15:35:11.897 shell.go:Flags() - 250ns
[TRACE] 15:35:11.897 shell.go:Pwd() - 40ns
[TRACE] 15:35:11.897 shell_unix.go:IsWsl() - 3.136µs
[TRACE] 15:35:11.897 shell.go:Shell() - 50ns
[TRACE] 15:35:11.897 shell.go:Shell() - 40ns
[TRACE] 15:35:11.897 shell.go:Pwd() - 130ns
[TRACE] 15:35:11.897 shell.go:GOOS() - 40ns
[DEBUG] 15:35:11.897 segment.go:SetEnabled:535 → Segment: Git
[DEBUG] 15:35:11.897 properties.go:GetBool:22 → mapped_locations_enabled: true
[DEBUG] 15:35:11.897 shell_unix.go:IsWsl:35 → false
[TRACE] 15:35:11.897 shell_unix.go:IsWsl() - 3.838µs
[DEBUG] 15:35:11.897 properties.go:GetString:28 → 
[TRACE] 15:35:11.897 shell_unix.go:IsWsl2() - 9.498µs
[TRACE] 15:35:11.897 shell.go:GOOS() - 30ns
[TRACE] 15:35:11.897 shell.go:GOOS() - 30ns
[DEBUG] 15:35:11.897 shell.go:TemplateCache:774 → environment: [ANSIBLE_HOME=/home/mirza/.local/share/ansible COLORTERM=truecolor CUDA_CACHE_PATH=/home/mirza/.cache/nv CUPS_DATADIR=/nix/store/6gapzg6f1pb7nizzj6b5wc0d2a1g4w8s-cups-progs/share/cups DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus DESKTOP_SESSION=gnome DISPLAY=:0 DOCKER_CONFIG=/home/mirza/.config/docker DOTNET_CLI_HOME=/home/mirza/.local/share/dotnet EDITOR=nvim FLAKE=/home/mirza/.config/nixfiles FZF_DEFAULT_OPTS=--layout=reverse --info=inline --height=90% GDK_PIXBUF_MODULE_FILE=/nix/store/0fr739dz4c12ass3ca3n76s5als20p6d-gdk-pixbuf-loaders.cache GDMSESSION=gnome GDM_LANG=en_US.UTF-8 GDM_X_SERVER_EXTRA_ARGS=-config /nix/store/aha38f0xrsmv9wgy48b45dkq5cljp6ar-xserver.conf -xkbdir /nix/store/9scfxaxwvzvwy36lv3293jwnwxkxqizq-xkeyboard-config-2.41/etc/X11/xkb -logfile /dev/null -nolisten tcp GIO_EXTRA_MODULES=/nix/store/ah6v9jqqwwyn8a10kp8ns7kbmd70mj44-glib-networking-2.80.0/lib/gio/modules:/nix/store/9r67fiw0nr2b0vrf82gadmdx77cx5mvs-dconf-0.40.0-lib/lib/gio/modules:/nix/store/ah6v9jqqwwyn8a10kp8ns7kbmd70mj44-glib-networking-2.80.0/lib/gio/modules:/nix/store/9r67fiw0nr2b0vrf82gadmdx77cx5mvs-dconf-0.40.0-lib/lib/gio/modules:/nix/store/9p8nvycvy93c540wnmf771vxj7z549gx-gvfs-1.54.2/lib/gio/modules:/nix/store/ah6v9jqqwwyn8a10kp8ns7kbmd70mj44-glib-networking-2.80.0/lib/gio/modules:/nix/store/9r67fiw0nr2b0vrf82gadmdx77cx5mvs-dconf-0.40.0-lib/lib/gio/modules GIO_LAUNCHED_DESKTOP_FILE=/home/mirza/.nix-profile/share/applications/org.wezfurlong.wezterm.desktop GIO_LAUNCHED_DESKTOP_FILE_PID=97653 GI_TYPELIB_PATH=/nix/store/sr6skahp2mvi6y8d4g89a9vwk4yh4z0p-glib-2.80.2/lib/girepository-1.0:/nix/store/331y81vaac63masxs7z26hhm920qkv03-gdk-pixbuf-2.42.12/lib/girepository-1.0:/nix/store/6pzq7v1xdjg8qqdn5ysyxq1i20mmxc1h-graphene-1.10.8/lib/girepository-1.0:/nix/store/h8ipr16jd5kbyrj2qxiscagsl408ggrn-harfbuzz-8.4.0/lib/girepository-1.0:/nix/store/d0mmd22f5w5c34ir227d5c4ypwscir88-pango-1.52.2/lib/girepository-1.0:/nix/store/g831ifbcgfqi8qc5svwr84waqxbxbv7q-gsettings-desktop-schemas-46.0/lib/girepository-1.0:/nix/store/ihbam8y7yblgxhhb06fxixdc3zvvybdx-gtk4-4.14.4/lib/girepository-1.0:/nix/store/8xjmr33xpq9931mkkddxbgxwmm4a6msd-librsvg-2.58.1/lib/girepository-1.0:/nix/store/irkly278ydqz3hs7ab17k5aicps4j7z1-gobject-introspection-wrapped-1.80.1/lib/girepository-1.0:/nix/store/fy77fzhhcfgdb0jg3s0gd0rq5q5lnsiq-gobject-introspection-1.80.1/lib/girepository-1.0:/nix/store/9fdzzangndz3fx8wgd4mkmijg4k6b7by-gcr-4.3.0/lib/girepository-1.0:/nix/store/816y7bn1w7ykvwpz9jz2fqadbghf3a5s-accountsservice-23.13.9/lib/girepository-1.0:/nix/store/8zvi0m8hamzglcr24w5c2ass1g2h812z-libsecret-0.21.4/lib/girepository-1.0:/nix/store/yv61rp99d3qzdlbx6x6z5n3ll7ksx744-polkit-124/lib/girepository-1.0:/nix/store/bbf68zxssby9sddmndfiq1z5s8zl7y6k-networkmanager-1.46.2/lib/girepository-1.0:/nix/store/c4hys54dprml435lkinjz679f9cfhf70-libical-3.0.18/lib/girepository-1.0:/nix/store/7kf2nzpz6aw3jp2yby3w7cscfin8rq6z-libsoup-3.4.4/lib/girepository-1.0:/nix/store/225jsq79gll01srq6n2mkybiazlg9s0c-json-glib-1.8.0/lib/girepository-1.0:/nix/store/xiy34h9qkx1bkb8ccdg4jb6qlih65kch-evolution-data-server-3.52.2/lib/girepository-1.0:/nix/store/0ihfdhbj39xaa4mc48w5vgysbq7swnqv-at-spi2-core-2.52.0/lib/girepository-1.0:/nix/store/54hz1pc0zk1cgm5qy7ky45963aq6j6mx-gtk+3-3.24.43/lib/girepository-1.0:/nix/store/dcgpyzg4ggfc02zflg76b9y9zc2mr6mk-libadwaita-1.5.1/lib/girepository-1.0:/nix/store/4wni6vqcj4cgn7qhlvypq8hbjivaj9dh-gdm-46.2/lib/girepository-1.0:/nix/store/35aqflz93fbzl1vkqpnh384cqlb8svmd-geoclue-2.7.0/lib/girepository-1.0:/nix/store/6drn2rj9bwl929hc7dzwh9jxbb8an5dj-gnome-bluetooth-46.0/lib/girepository-1.0:/nix/store/4i039v2qfa9nmkahqvicw2cdww0dgd4i-upower-1.90.4/lib/girepository-1.0:/nix/store/wswz8sfaanzgn3xbr1miihrhssbw0y38-ibus-1.5.30/lib/girepository-1.0:/nix/store/bmds670hcg5r3y09rd9r62sk19rsyhq2-gnome-desktop-44.0/lib/girepository-1.0:/nix/store/vcs2n7d80s8qqk8zbq6dhzcp5cfsmpqq-gstreamer-1.24.3/lib/girepository-1.0:/nix/store/dyswiqw8aifsdi41vffph7d4yvnfs22m-gst-plugins-base-1.24.3/lib/girepository-1.0:/nix/store/4xj38ncg7s59fwxbmvjv7bb4hyybayg4-libgweather-4.4.2/lib/girepository-1.0:/nix/store/drd97c7wcmph83i222jjc1ckmzik11fw-libnma-1.10.6/lib/girepository-1.0:/nix/store/bgf5rvw7lg5sypq242plwlnpjljbdzrq-gnome-autoar-0.4.4/lib/girepository-1.0 GJS_DEBUG_OUTPUT=stderr GJS_DEBUG_TOPICS=JS ERROR;JS LOG GNOME_SETUP_DISPLAY=:1 GNUPGHOME=/home/mirza/.local/share/gnupg GOMODCACHE=/home/mirza/.cache/go/mod GOPATH=/home/mirza/.local/share/go GRADLE_USER_HOME=/home/mirza/.local/share/gradle GST_PLUGIN_SYSTEM_PATH_1_0=/nix/store/24p9byz947cajginshw9rp0c8p2s0nj6-pipewire-1.0.7/lib/gstreamer-1.0:/nix/store/vcs2n7d80s8qqk8zbq6dhzcp5cfsmpqq-gstreamer-1.24.3/lib/gstreamer-1.0:/nix/store/dyswiqw8aifsdi41vffph7d4yvnfs22m-gst-plugins-base-1.24.3/lib/gstreamer-1.0:/nix/store/h8m0hb8nkk7am30ibzr8i837pr84pzh6-gst-plugins-good-1.24.3/lib/gstreamer-1.0 GTK2_RC_FILES=/home/mirza/.config/gtk-2.0/gtkrc GTK_PATH=/home/mirza/.nix-profile/lib/gtk-2.0:/home/mirza/.nix-profile/lib/gtk-3.0:/home/mirza/.nix-profile/lib/gtk-4.0:/home/mirza/.local/state/nix/profile/lib/gtk-2.0:/home/mirza/.local/state/nix/profile/lib/gtk-3.0:/home/mirza/.local/state/nix/profile/lib/gtk-4.0:/home/mirza/.local/state/nix/profile/lib/gtk-2.0:/home/mirza/.local/state/nix/profile/lib/gtk-3.0:/home/mirza/.local/state/nix/profile/lib/gtk-4.0:/etc/profiles/per-user/mirza/lib/gtk-2.0:/etc/profiles/per-user/mirza/lib/gtk-3.0:/etc/profiles/per-user/mirza/lib/gtk-4.0:/nix/var/nix/profiles/default/lib/gtk-2.0:/nix/var/nix/profiles/default/lib/gtk-3.0:/nix/var/nix/profiles/default/lib/gtk-4.0:/run/current-system/sw/lib/gtk-2.0:/run/current-system/sw/lib/gtk-3.0:/run/current-system/sw/lib/gtk-4.0 HISTFILE=/home/mirza/.config/zsh/history HOME=/home/mirza INFOPATH=/home/mirza/.nix-profile/info:/home/mirza/.nix-profile/share/info:/home/mirza/.local/state/nix/profile/info:/home/mirza/.local/state/nix/profile/share/info:/home/mirza/.local/state/nix/profile/info:/home/mirza/.local/state/nix/profile/share/info:/etc/profiles/per-user/mirza/info:/etc/profiles/per-user/mirza/share/info:/nix/var/nix/profiles/default/info:/nix/var/nix/profiles/default/share/info:/run/current-system/sw/info:/run/current-system/sw/share/info INVOCATION_ID=4b4ecf3f584b4a5691b27168bb825aec JOURNAL_STREAM=8:15736 JQ_COLORS=1;30:0;37:0;37:0;37:0;32:1;37:1;37 KUBECACHEDIR=/home/mirza/.cache/kube KUBECONFIG=/home/mirza/.config/kube/config LANG=en_US.UTF-8 LC_ADDRESS=en_GB.UTF-8 LC_IDENTIFICATION=en_GB.UTF-8 LC_MEASUREMENT=en_GB.UTF-8 LC_MONETARY=en_GB.UTF-8 LC_NAME=en_GB.UTF-8 LC_NUMERIC=en_GB.UTF-8 LC_PAPER=en_GB.UTF-8 LC_TELEPHONE=en_GB.UTF-8 LC_TIME=en_GB.UTF-8 LD_LIBRARY_PATH=/nix/store/yxxvcg5i7r7gfni4nclsviz1vyd528xn-pipewire-1.0.7-jack/lib LESSKEYIN_SYSTEM=/nix/store/sq0vq146mn2xw9qaqx1896r0icx1f3ia-lessconfig LESSOPEN=|/nix/store/l0p0s9l3glng4isqddm97kdw40slxv47-lesspipe-2.11/bin/lesspipe.sh %s LIBEXEC_PATH=/home/mirza/.nix-profile/libexec:/home/mirza/.local/state/nix/profile/libexec:/home/mirza/.local/state/nix/profile/libexec:/etc/profiles/per-user/mirza/libexec:/nix/var/nix/profiles/default/libexec:/run/current-system/sw/libexec LOCALE_ARCHIVE=/run/current-system/sw/lib/locale/locale-archive LOCALE_ARCHIVE_2_27=/nix/store/2rrp3c1mr22dndd5lhxrc3nnvn3akjic-glibc-locales-2.39-52/lib/locale/locale-archive LOGNAME=mirza MANAGERPID=1995 MEMORY_PRESSURE_WATCH=/sys/fs/cgroup/user.slice/user-1000.slice/user@1000.service/session.slice/org.gnome.Shell@wayland.service/memory.pressure MEMORY_PRESSURE_WRITE=c29tZSAyMDAwMDAgMjAwMDAwMAA= MOZ_ENABLE_WAYLAND=1 NAUTILUS_4_EXTENSION_DIR=/nix/store/p9ak6mh9js0r30laizj2aaj0blvwn197-system-path/lib/nautilus/extensions-4 NIXPKGS_CONFIG=/etc/nix/nixpkgs-config.nix NIX_GSETTINGS_OVERRIDES_DIR=/nix/store/4w2cnknlpwi2kj1phjh6qcn4nykhjycb-gnome-gsettings-overrides/share/gsettings-schemas/nixos-gsettings-overrides/glib-2.0/schemas NIX_PATH=nixpkgs=flake:nixpkgs:/nix/var/nix/profiles/per-user/root/channels NIX_PROFILES=/run/current-system/sw /nix/var/nix/profiles/default /etc/profiles/per-user/mirza /home/mirza/.local/state/nix/profile /home/mirza/.local/state/nix/profile /home/mirza/.nix-profile NIX_USER_PROFILE_DIR=/nix/var/nix/profiles/per-user/mirza NIX_XDG_DESKTOP_PORTAL_DIR=/run/current-system/sw/share/xdg-desktop-portal/portals NPM_CONFIG_USERCONFIG=/home/mirza/.config/npm/npmrc NUGET_PACKAGES=/home/mirza/.cache/NuGetPackages OLDPWD=/home/mirza PAGER=less PATH=/run/wrappers/bin:/home/mirza/.nix-profile/bin:/home/mirza/.local/state/nix/profile/bin:/etc/profiles/per-user/mirza/bin:/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin PWD=/home/mirza/.config/nixfiles QTWEBKIT_PLUGIN_PATH=/home/mirza/.nix-profile/lib/mozilla/plugins/:/home/mirza/.local/state/nix/profile/lib/mozilla/plugins/:/home/mirza/.local/state/nix/profile/lib/mozilla/plugins/:/etc/profiles/per-user/mirza/lib/mozilla/plugins/:/nix/var/nix/profiles/default/lib/mozilla/plugins/:/run/current-system/sw/lib/mozilla/plugins/ SESSION_MANAGER=local/nixsina:@/tmp/.ICE-unix/2091,unix/nixsina:/tmp/.ICE-unix/2091 SHELL=/nix/store/k3wa47kc7v38nbj6gcqnhhl380zk8ykr-zsh-5.9/bin/zsh SHLVL=1 SSH_ASKPASS=/nix/store/mpbx2ghbwdw3bf8lcamzglhiq6sgrscp-seahorse-43.0/libexec/seahorse/ssh-askpass SSH_AUTH_SOCK=/run/user/1000/keyring/ssh SYSTEMD_EXEC_PID=2125 TERM=tmux-256color TERMINFO_DIRS=/home/mirza/.nix-profile/share/terminfo:/home/mirza/.local/state/nix/profile/share/terminfo:/home/mirza/.local/state/nix/profile/share/terminfo:/etc/profiles/per-user/mirza/share/terminfo:/nix/var/nix/profiles/default/share/terminfo:/run/current-system/sw/share/terminfo TERM_PROGRAM=tmux TERM_PROGRAM_VERSION=3.4 TMUX=/run/user/1000/tmux-1000/default,97669,0 TMUX_PANE=%0 TMUX_TMPDIR=/run/user/1000 TRACKER_CLI_SUBCOMMANDS_DIR=/nix/store/xylp5xfypk0kl74y5i96nz8h0pgz2h6w-tracker-with-subcommands-3.7.3/libexec/tracker3 TZDIR=/etc/zoneinfo USER=mirza USERNAME=mirza WAYLAND_DISPLAY=wayland-0 WEZTERM_CONFIG_DIR=/home/mirza/.config/wezterm WEZTERM_CONFIG_FILE=/home/mirza/.config/wezterm/wezterm.lua WEZTERM_EXECUTABLE=/nix/store/3zp82zz7avpjsdq2sd8gym4znlb4div3-wezterm-20240203-110809-5046fc22/bin/wezterm-gui WEZTERM_EXECUTABLE_DIR=/nix/store/3zp82zz7avpjsdq2sd8gym4znlb4div3-wezterm-20240203-110809-5046fc22/bin WEZTERM_PANE=0 WEZTERM_UNIX_SOCKET=/run/user/1000/wezterm/gui-sock-97653 XAUTHORITY=/run/user/1000/.mutter-Xwaylandauth.OSWWV2 XCURSOR_PATH=/home/mirza/.icons:/home/mirza/.local/share/icons:/home/mirza/.nix-profile/share/icons:/home/mirza/.nix-profile/share/pixmaps:/home/mirza/.local/state/nix/profile/share/icons:/home/mirza/.local/state/nix/profile/share/pixmaps:/home/mirza/.local/state/nix/profile/share/icons:/home/mirza/.local/state/nix/profile/share/pixmaps:/etc/profiles/per-user/mirza/share/icons:/etc/profiles/per-user/mirza/share/pixmaps:/nix/var/nix/profiles/default/share/icons:/nix/var/nix/profiles/default/share/pixmaps:/run/current-system/sw/share/icons:/run/current-system/sw/share/pixmaps XDG_CACHE_HOME=/home/mirza/.cache XDG_CONFIG_DIRS=/etc/xdg:/home/mirza/.nix-profile/etc/xdg:/home/mirza/.local/state/nix/profile/etc/xdg:/home/mirza/.local/state/nix/profile/etc/xdg:/etc/profiles/per-user/mirza/etc/xdg:/nix/var/nix/profiles/default/etc/xdg:/run/current-system/sw/etc/xdg:/nix/store/jwpaz9v4rbifn6ydy0d8ka1rkid1yibc-gnome-settings-daemon-46.0/etc/xdg XDG_CONFIG_HOME=/home/mirza/.config XDG_CURRENT_DESKTOP=GNOME XDG_DATA_DIRS=/nix/store/klhhb0rkaacq1ij8l88xpxp8kidk100p-shared-mime-info-2.4/share:/nix/store/xq29i019xymvmmb2yy5gx7b9ls3rjq12-gnome-shell-46.2/share:/nix/store/g831ifbcgfqi8qc5svwr84waqxbxbv7q-gsettings-desktop-schemas-46.0/share/gsettings-schemas/gsettings-desktop-schemas-46.0:/nix/store/ihbam8y7yblgxhhb06fxixdc3zvvybdx-gtk4-4.14.4/share/gsettings-schemas/gtk4-4.14.4:/nix/store/6qdxncvzwjcj4z7dkghv63h6rrq339r1-gnome-keyring-46.2/share/gsettings-schemas/gnome-keyring-46.2:/nix/store/fgii4805dh0pa3wcwldn53m1amhs4ldi-mutter-46.2/share/gsettings-schemas/mutter-46.2:/nix/store/xiy34h9qkx1bkb8ccdg4jb6qlih65kch-evolution-data-server-3.52.2/share/gsettings-schemas/evolution-data-server-3.52.2:/nix/store/54hz1pc0zk1cgm5qy7ky45963aq6j6mx-gtk+3-3.24.43/share/gsettings-schemas/gtk+3-3.24.43:/nix/store/4wni6vqcj4cgn7qhlvypq8hbjivaj9dh-gdm-46.2/share/gsettings-schemas/gdm-46.2:/nix/store/aahldiaw9lsgzvqn7iv1wbmjas8x2i0j-gnome-clocks-46.0/share/gsettings-schemas/gnome-clocks-46.0:/nix/store/wswz8sfaanzgn3xbr1miihrhssbw0y38-ibus-1.5.30/share/gsettings-schemas/ibus-1.5.30:/nix/store/jwpaz9v4rbifn6ydy0d8ka1rkid1yibc-gnome-settings-daemon-46.0/share/gsettings-schemas/gnome-settings-daemon-46.0:/nix/store/4xj38ncg7s59fwxbmvjv7bb4hyybayg4-libgweather-4.4.2/share/gsettings-schemas/libgweather-4.4.2:/nix/store/drd97c7wcmph83i222jjc1ckmzik11fw-libnma-1.10.6/share/gsettings-schemas/libnma-1.10.6:/nix/store/xq29i019xymvmmb2yy5gx7b9ls3rjq12-gnome-shell-46.2/share/gsettings-schemas/gnome-shell-46.2:/nix/store/4ixhy53kcrfay72za4nx32a281kylkzc-gnome-mimeapps/share:/nix/store/6l8g2pl6hn5msyadwg3j3ijcx12al486-desktops/share:/home/mirza/.nix-profile/share:/home/mirza/.local/state/nix/profile/share:/home/mirza/.local/state/nix/profile/share:/etc/profiles/per-user/mirza/share:/nix/var/nix/profiles/default/share:/run/current-system/sw/share:/nix/store/xq29i019xymvmmb2yy5gx7b9ls3rjq12-gnome-shell-46.2/share/gsettings-schemas/gnome-shell-46.2:/nix/store/gzn1qi6y2kc32szkjkd664fcjs9nn447-gnome-shell-extensions-46.2/share/gsettings-schemas/gnome-shell-extensions-46.2:/nix/store/j4p9xx9p8h3a7zs2mlksb9h5wgpdsp5x-gnome-session-46.0/share:/nix/store/g831ifbcgfqi8qc5svwr84waqxbxbv7q-gsettings-desktop-schemas-46.0/share/gsettings-schemas/gsettings-desktop-schemas-46.0:/nix/store/54hz1pc0zk1cgm5qy7ky45963aq6j6mx-gtk+3-3.24.43/share/gsettings-schemas/gtk+3-3.24.43:/nix/store/jwpaz9v4rbifn6ydy0d8ka1rkid1yibc-gnome-settings-daemon-46.0/share/gsettings-schemas/gnome-settings-daemon-46.0:/nix/store/j4p9xx9p8h3a7zs2mlksb9h5wgpdsp5x-gnome-session-46.0/share/gsettings-schemas/gnome-session-46.0:/nix/store/xq29i019xymvmmb2yy5gx7b9ls3rjq12-gnome-shell-46.2/share XDG_DATA_HOME=/home/mirza/.local/share XDG_MENU_PREFIX=gnome- XDG_RUNTIME_DIR=/run/user/1000 XDG_SESSION_CLASS=user XDG_SESSION_DESKTOP=gnome XDG_SESSION_TYPE=wayland XDG_STATE_HOME=/home/mirza/.local/state ZDOTDIR=/home/mirza/.config/zsh _JAVA_OPTIONS=-Djava.util.prefs.userRoot=/home/mirza/.config/java __HM_SESS_VARS_SOURCED=1 __HM_ZSH_SESS_VARS_SOURCED=1 __NIXOS_SET_ENVIRONMENT_DONE=1 LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=00:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.7z=01;31:*.ace=01;31:*.alz=01;31:*.apk=01;31:*.arc=01;31:*.arj=01;31:*.bz=01;31:*.bz2=01;31:*.cab=01;31:*.cpio=01;31:*.crate=01;31:*.deb=01;31:*.drpm=01;31:*.dwm=01;31:*.dz=01;31:*.ear=01;31:*.egg=01;31:*.esd=01;31:*.gz=01;31:*.jar=01;31:*.lha=01;31:*.lrz=01;31:*.lz=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.lzo=01;31:*.pyz=01;31:*.rar=01;31:*.rpm=01;31:*.rz=01;31:*.sar=01;31:*.swm=01;31:*.t7z=01;31:*.tar=01;31:*.taz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tgz=01;31:*.tlz=01;31:*.txz=01;31:*.tz=01;31:*.tzo=01;31:*.tzst=01;31:*.udeb=01;31:*.war=01;31:*.whl=01;31:*.wim=01;31:*.xz=01;31:*.z=01;31:*.zip=01;31:*.zoo=01;31:*.zst=01;31:*.avif=01;35:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.webp=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:*~=00;90:*#=00;90:*.bak=00;90:*.crdownload=00;90:*.dpkg-dist=00;90:*.dpkg-new=00;90:*.dpkg-old=00;90:*.dpkg-tmp=00;90:*.old=00;90:*.orig=00;90:*.part=00;90:*.rej=00;90:*.rpmnew=00;90:*.rpmorig=00;90:*.rpmsave=00;90:*.swp=00;90:*.tmp=00;90:*.ucf-dist=00;90:*.ucf-new=00;90:*.ucf-old=00;90: MANPATH=/nix/store/fwr9cq3ldyzk9ixn4axwqz3mcclakkwq-antidote-1.9.6/share/antidote/man: __zsh_config_dir=/home/mirza/.config/zsh __zsh_user_data_dir=/home/mirza/.local/share/zsh __zsh_cache_dir=/home/mirza/.cache/zsh GPG_TTY=/dev/pts/1 POSH_THEME=/home/mirza/.config/oh-my-posh/config.json POSH_SHELL_VERSION=5.9 POSH_PID=97684 POWERLINE_COMMAND=oh-my-posh CONDA_PROMPT_MODIFIER=false POSH_PROMPT_COUNT=68 _=/home/mirza/.nix-profile/bin/oh-my-posh]
[DEBUG] 15:35:11.897 properties.go:GetKeyValueMap:46 → mapped_locations: map[]
[TRACE] 15:35:11.897 shell.go:PathSeparator() - 130ns
[TRACE] 15:35:11.897 shell.go:GOOS() - 30ns
[TRACE] 15:35:11.897 shell.go:GOOS() - 30ns
[TRACE] 15:35:11.897 shell.go:Pwd() - 90ns
[TRACE] 15:35:11.897 shell.go:GOOS() - 30ns
[TRACE] 15:35:11.897 shell.go:GOOS() - 30ns
[TRACE] 15:35:11.897 shell.go:GOOS() - 30ns
[TRACE] 15:35:11.897 shell.go:GOOS() - 20ns
[TRACE] 15:35:11.897 shell.go:GOOS() - 21ns
[TRACE] 15:35:11.897 shell.go:GOOS() - 30ns
[TRACE] 15:35:11.897 shell.go:GOOS() - 31ns
[TRACE] 15:35:11.897 shell.go:GOOS() - 30ns
[TRACE] 15:35:11.897 shell.go:PathSeparator() - 30ns
[TRACE] 15:35:11.897 shell.go:GOOS() - 30ns
[TRACE] 15:35:11.897 shell.go:PathSeparator() - 30ns
[TRACE] 15:35:11.897 shell.go:GOOS() - 30ns
[TRACE] 15:35:11.897 shell.go:GOOS() - 30ns
[DEBUG] 15:35:11.897 shell.go:CommandPath:545 → /home/mirza/.nix-profile/bin/git
[TRACE] 15:35:11.897 shell.go:GOOS() - 30ns
[TRACE] 15:35:11.897 shell.go:PathSeparator() - 30ns
[TRACE] 15:35:11.897 shell.go:CommandPath(git) - 60.143µs
[TRACE] 15:35:11.897 shell.go:GOOS() - 30ns
[TRACE] 15:35:11.897 shell.go:GOOS() - 20ns
[TRACE] 15:35:11.897 shell.go:HasCommand(git) - 64.02µs
[TRACE] 15:35:11.897 shell.go:GOOS() - 30ns
[TRACE] 15:35:11.897 shell.go:GOOS() - 30ns
[TRACE] 15:35:11.897 shell.go:PathSeparator() - 31ns
[TRACE] 15:35:11.897 shell.go:Pwd() - 50ns
[DEBUG] 15:35:11.897 shell.go:User:493 → mirza
[TRACE] 15:35:11.897 shell.go:GOOS() - 20ns
[TRACE] 15:35:11.897 shell.go:User() - 2.605µs
[TRACE] 15:35:11.897 shell.go:GOOS() - 30ns
[DEBUG] 15:35:11.897 shell.go:Host:505 → nixsina
[TRACE] 15:35:11.897 shell.go:PathSeparator() - 30ns
[TRACE] 15:35:11.897 shell.go:PathSeparator() - 30ns
[TRACE] 15:35:11.897 shell.go:Host() - 5.401µs
[TRACE] 15:35:11.897 shell.go:GOOS() - 30ns
[TRACE] 15:35:11.897 shell.go:PathSeparator() - 30ns
[DEBUG] 15:35:11.897 properties.go:GetString:28 → NO DATA
[DEBUG] 15:35:11.897 shell_unix.go:Platform:87 → nixos
[TRACE] 15:35:11.897 shell.go:PathSeparator() - 30ns
[DEBUG] 15:35:11.897 shell.go:Getenv:325 → 1
[TRACE] 15:35:11.897 shell.go:PathSeparator() - 30ns
[TRACE] 15:35:11.897 shell.go:Getenv(SHLVL) - 2.525µs
[TRACE] 15:35:11.897 shell.go:HasParentFilePath(.git) - 15.108µs
[TRACE] 15:35:11.897 shell.go:PathSeparator() - 20ns
[TRACE] 15:35:11.897 shell.go:TemplateCache() - 160.582µs
[DEBUG] 15:35:11.897 properties.go:GetStringArray:52 → exclude_folders: []
[DEBUG] 15:35:11.897 properties.go:GetString:28 → agnoster_short
[TRACE] 15:35:11.897 shell.go:GOOS() - 30ns
[TRACE] 15:35:11.897 shell.go:GOOS() - 40ns
[DEBUG] 15:35:11.897 properties.go:GetInt:40 → max_depth: 1
[DEBUG] 15:35:11.897 properties.go:GetString:28 → ..
[DEBUG] 15:35:11.897 properties.go:GetBool:22 → fetch_user: false
[TRACE] 15:35:11.897 shell.go:GOOS() - 30ns
[DEBUG] 15:35:11.897 properties.go:GetBool:22 → hide_root_location: false
[TRACE] 15:35:11.897 shell.go:GOOS() - 31ns
[TRACE] 15:35:11.897 shell.go:PathSeparator() - 30ns
[TRACE] 15:35:11.897 shell.go:GOOS() - 60ns
[DEBUG] 15:35:11.897 properties.go:GetStringArray:52 → cycle: []
[TRACE] 15:35:11.897 shell.go:GOOS() - 60ns
[TRACE] 15:35:11.897 shell.go:GOOS() - 60ns
[DEBUG] 15:35:11.897 properties.go:GetString:28 → NO DATA
[TRACE] 15:35:11.897 shell.go:GOOS() - 50ns
[TRACE] 15:35:11.897 shell.go:PathSeparator() - 60ns
[TRACE] 15:35:11.897 shell.go:GOOS() - 60ns
[DEBUG] 15:35:11.897 properties.go:GetString:28 → /
[TRACE] 15:35:11.897 shell.go:GOOS() - 61ns
[DEBUG] 15:35:11.897 properties.go:GetBool:22 → cycle_folder_separator: false
[TRACE] 15:35:11.897 shell.go:GOOS() - 30ns
[DEBUG] 15:35:11.897 properties.go:GetString:28 → %s
[DEBUG] 15:35:11.897 shell.go:Getenv:325 → NO DATA
[DEBUG] 15:35:11.897 properties.go:GetString:28 → %s
[TRACE] 15:35:11.897 shell.go:Getenv(POSH_GIT_STATUS) - 2.615µs
[DEBUG] 15:35:11.897 properties.go:GetString:28 → %s
[DEBUG] 15:35:11.897 properties.go:GetString:28 → %s
[DEBUG] 15:35:11.897 properties.go:GetBool:22 → fetch_status: false
[TRACE] 15:35:11.897 shell.go:PathSeparator() - 30ns
[DEBUG] 15:35:11.897 properties.go:GetStringArray:52 → ignore_status: []
[TRACE] 15:35:11.897 shell.go:GOOS() - 20ns
[TRACE] 15:35:11.897 shell.go:Pwd() - 41ns
[DEBUG] 15:35:11.897 shell_unix.go:IsWsl:35 → false
[TRACE] 15:35:11.897 shell_unix.go:IsWsl() - 2.675µs
[TRACE] 15:35:11.897 shell.go:StackCount() - 60ns
[TRACE] 15:35:11.897 shell_unix.go:DirIsWritable(/home/mirza/.config/nixfiles) - 5.34µs
[TRACE] 15:35:11.897 shell.go:TemplateCache() - 110ns
[DEBUG] 15:35:11.897 shell.go:FileContent:467 ↓
    ref: refs/heads/master

[TRACE] 15:35:11.897 shell.go:FileContent(/home/mirza/.config/nixfiles/.git/HEAD) - 30.677µs
[DEBUG] 15:35:11.897 properties.go:GetString:28 →  <#ff94df><b> </b></>
[DEBUG] 15:35:11.897 properties.go:GetInt:40 → branch_max_length: 0
[DEBUG] 15:35:11.897 properties.go:GetBool:22 → fetch_upstream_icon: false
[TRACE] 15:35:11.897 shell.go:TemplateCache() - 280ns
[DEBUG] 15:35:11.897 text.go:Render:70 → Rendering template: $
[TRACE] 15:35:11.897 shell.go:Shell() - 140ns
[DEBUG] 15:35:11.897 text.go:Render:70 → Rendering template: :{{ .Path }}
[DEBUG] 15:35:11.897 text.go:Render:70 → Rendering template: <#ffffff>on</> {{ .HEAD }}{{ if gt .StashCount 0 }}  {{ .StashCount }}{{ end }}
[TRACE] 15:35:11.898 shell.go:TemplateCache() - 220ns
[TRACE] 15:35:11.898 shell.go:TemplateCache() - 130ns
[TRACE] 15:35:11.898 shell.go:Shell() - 70ns
[ERROR] 15:35:11.898 shell.go:FileContent:463 → open /home/mirza/.config/nixfiles/.git/logs/refs/stash: no such file or directory
[TRACE] 15:35:11.898 shell.go:FileContent(/home/mirza/.config/nixfiles/.git/logs/refs/stash) - 11.611µs
[TRACE] 15:35:11.898 shell.go:Shell() - 90ns
[DEBUG] 15:35:11.898 text.go:Render:70 → Rendering template: plain
[DEBUG] 15:35:11.898 text.go:Render:70 → Rendering template: plain
[DEBUG] 15:35:11.898 text.go:Render:70 → Rendering template: plain
[TRACE] 15:35:11.898 shell.go:Shell() - 60ns
[TRACE] 15:35:11.898 shell.go:Shell() - 20ns
[TRACE] 15:35:11.898 shell.go:Shell() - 20ns
[TRACE] 15:35:11.898 shell.go:Shell() - 30ns
[TRACE] 15:35:11.898 shell.go:Flags() - 51ns
[DEBUG] 15:35:11.898 shell.go:Getenv:325 → NO DATA
[TRACE] 15:35:11.898 shell.go:Getenv(OMP_CACHE_DIR) - 2.625µs
[DEBUG] 15:35:11.898 shell.go:Getenv:325 → /home/mirza/.cache
[TRACE] 15:35:11.898 shell.go:Getenv(XDG_CACHE_HOME) - 2.575µs
[TRACE] 15:35:11.898 shell_unix.go:CachePath() - 18.084µs
[TRACE] 15:35:11.898 shell.go:Flags() - 31ns
JanDeDobbeleer commented 1 month ago

@mirzahilmi what you try to achieve isn't possible. Transient is generated BEFORE the command your entered is executed.