Closed Chaitanyabsprip closed 10 months ago
In the logs your HEAD points to a commit which is detached. At least there, it's correct. Please provide the logs where you aren't on a detached head and .Detached
is true.
Wait, is it true or false? Because the title and text contradict each other.
I'm aware you've made some changes and fixed the issue but just to satisfy myself I'll answer the question. As you can see in the prompt, .Detached is returning false, and I tried checking out to a commit(detached HEAD) and then to a branch, .Detached stayed false.
Thanks for the prompt response and fix
@Chaitanyabsprip yes, there was no logic that enabled this without having fetch_status enabled.
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?
I'm trying to show the name of the git branch conditioned on whether I'm in detached mode or not. The .Detached variable in the template, always returns true.
Theme
Theme config
"$schema" = "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json" final_space = true version = 2 [palette] base = "#191724" surface = "#1f1d2e" overlay = "#26233a" muted = "#6e6a86" subtle = "#908caa" text = "#e0def4" love = "#eb6f92" gold = "#f6c177" rose = "#ebbcba" pine = "#31748f" foam = "#9ccfd8" iris = "#c4a7e7" hilow = "#21202e" himed = "#403d52" hihigh = "#524f67" [[blocks]] type = "prompt" alignment = "left" # starting new line before the prompt. Used to disjoint two consecutive prompts [[blocks.segments]] type = "text" style = "plain" template = "\n" [[blocks.segments]] type = "status" style = "plain" foreground = "green" background = "p:hilow" foreground_templates = ["{{ if .Error }}red{{end}}"] template = "β" [blocks.segments.properties] always_enabled = true [[blocks.segments]] type = "path" style = "plain" foreground = "cyan" background = "p:hilow" template = " {{ .Folder }} " [blocks.segments.properties] style = "folder" home_icon = "home" [[blocks.segments]] type = "git" style = "plain" background = "p:hilow" foreground = "black" template = "What OS are you seeing the problem on?
macOS
Which shell are you using?
fish
Log output
log output
```Shell Version: 19.5.1 Shell: fish (3.7.0) Prompt: β neovim on π· nightly false β Segments: ConsoleTitle(false) - 0 ms Text(true) - 1 ms Status(true) - 1 ms Path(true) - 1 ms Git(true) - 9 ms Status(true) - 0 ms Run duration: 11.869042ms Cache path: /Users/chaitanyasharma/.local/cache/oh-my-posh Config path: /Users/chaitanyasharma/dotfiles/oh-my-posh.rc.toml Logs: [DEBUG] 23:46:15.770 shell.go:Getenv:399 β tmux [TRACE] 23:46:15.770 shell.go:Getenv(TERM_PROGRAM) - 84.125Β΅s [DEBUG] 23:46:15.770 shell.go:Getenv:399 β NO DATA [TRACE] 23:46:15.770 shell.go:Getenv(OMP_CACHE_DIR) - 5.166Β΅s [DEBUG] 23:46:15.770 shell.go:Getenv:399 β /Users/chaitanyasharma/.local/cache [TRACE] 23:46:15.770 shell.go:Getenv(XDG_CACHE_HOME) - 2.875Β΅s [TRACE] 23:46:15.771 shell_unix.go:CachePath() - 34.042Β΅s [DEBUG] 23:46:15.771 shell.go:Getenv:399 β /Users/chaitanyasharma/dotfiles/oh-my-posh.rc.toml [TRACE] 23:46:15.771 shell.go:Getenv(POSH_THEME) - 5.5Β΅s [DEBUG] 23:46:15.771 shell_unix.go:Platform:77 β darwin [TRACE] 23:46:15.771 shell.go:resolveConfigPath() - 15Β΅s [TRACE] 23:46:15.771 shell.go:Init() - 893.708Β΅s [TRACE] 23:46:15.771 shell.go:Flags() - 83ns [TRACE] 23:46:15.772 config.go:loadConfig() - 498.25Β΅s [TRACE] 23:46:15.772 shell.go:Flags() - 84ns [DEBUG] 23:46:15.772 shell.go:Getenv:399 β NO DATA [TRACE] 23:46:15.772 shell.go:Getenv(OMP_CACHE_DISABLED) - 2.542Β΅s [DEBUG] 23:46:15.772 shell.go:Shell:662 β no shell name provided in flags, trying to detect it [DEBUG] 23:46:15.772 shell.go:Shell:670 β process name: fish [TRACE] 23:46:15.772 shell.go:Shell() - 80.791Β΅s [DEBUG] 23:46:15.772 shell.go:Getenv:399 β 3.7.0 [TRACE] 23:46:15.772 shell.go:Getenv(POSH_SHELL_VERSION) - 2.625Β΅s [DEBUG] 23:46:15.772 debug.go:PrintDebug:22 β Segment: Title [DEBUG] 23:46:15.772 text.go:Render:70 β Rendering template: [DEBUG] 23:46:15.772 shell.go:Getenv:399 β NO DATA [TRACE] 23:46:15.772 shell.go:Getenv(POSH_CURSOR_LINE) - 3.5Β΅s [DEBUG] 23:46:15.772 shell.go:Getenv:399 β NO DATA [TRACE] 23:46:15.772 shell.go:Getenv(POSH_CURSOR_COLUMN) - 2.083Β΅s [TRACE] 23:46:15.772 shell.go:Flags() - 41ns [TRACE] 23:46:15.772 shell.go:Flags() - 84ns [TRACE] 23:46:15.772 shell.go:Shell() - 83ns [TRACE] 23:46:15.772 shell.go:Shell() - 41ns [TRACE] 23:46:15.772 shell.go:Flags() - 83ns [TRACE] 23:46:15.772 shell.go:Flags() - 167ns [TRACE] 23:46:15.772 shell.go:GOOS() - 167ns [DEBUG] 23:46:15.772 shell.go:Pwd:429 β /Users/chaitanyasharma/programs/neovim [TRACE] 23:46:15.772 shell.go:Pwd() - 18.625Β΅s [TRACE] 23:46:15.772 shell.go:GOOS() - 42ns [DEBUG] 23:46:15.772 properties.go:GetString:28 β {{ .Code }} [DEBUG] 23:46:15.772 segment.go:SetEnabled:512 β Segment: Git [TRACE] 23:46:15.772 shell.go:Pwd() - 167ns [TRACE] 23:46:15.772 shell.go:GOOS() - 42ns [DEBUG] 23:46:15.772 shell_unix.go:IsWsl:35 β false [DEBUG] 23:46:15.772 segment.go:SetEnabled:512 β Segment: Status [TRACE] 23:46:15.772 shell_unix.go:IsWsl() - 2.833Β΅s [TRACE] 23:46:15.772 shell_unix.go:IsWsl2() - 4.916Β΅s [TRACE] 23:46:15.772 shell.go:StatusCodes() - 84ns [TRACE] 23:46:15.772 shell.go:GOOS() - 0s [DEBUG] 23:46:15.772 text.go:Render:70 β Rendering template: {{ .Code }} [DEBUG] 23:46:15.772 shell.go:CommandPath:615 β /opt/homebrew/bin/git [TRACE] 23:46:15.772 shell.go:CommandPath(git) - 23.208Β΅s [TRACE] 23:46:15.772 shell.go:HasCommand(git) - 25.667Β΅s [TRACE] 23:46:15.772 shell.go:Pwd() - 83ns [TRACE] 23:46:15.772 shell.go:HasParentFilePath(.git) - 8.958Β΅s [DEBUG] 23:46:15.772 properties.go:GetStringArray:52 β exclude_folders: [] [TRACE] 23:46:15.772 shell.go:GOOS() - 0s [TRACE] 23:46:15.772 shell.go:GOOS() - 42ns [DEBUG] 23:46:15.772 properties.go:GetBool:22 β fetch_user: false [TRACE] 23:46:15.772 shell.go:GOOS() - 42ns [TRACE] 23:46:15.772 shell.go:GOOS() - 42ns [TRACE] 23:46:15.772 shell.go:GOOS() - 41ns [TRACE] 23:46:15.772 shell.go:GOOS() - 42ns [TRACE] 23:46:15.772 shell.go:GOOS() - 41ns [TRACE] 23:46:15.772 shell.go:GOOS() - 42ns [TRACE] 23:46:15.772 shell.go:GOOS() - 42ns [DEBUG] 23:46:15.772 shell.go:Getenv:399 β NO DATA [TRACE] 23:46:15.772 shell.go:Getenv(POSH_GIT_STATUS) - 2.084Β΅s [DEBUG] 23:46:15.772 properties.go:GetBool:22 β fetch_status: false [DEBUG] 23:46:15.772 properties.go:GetStringArray:52 β ignore_status: [] [TRACE] 23:46:15.772 shell.go:GOOS() - 42ns [TRACE] 23:46:15.772 shell.go:Flags() - 42ns [TRACE] 23:46:15.772 shell.go:Flags() - 167ns [DEBUG] 23:46:15.772 shell.go:FileContent:538 β 748eae6bb59be742fddec587f9f8171d9d0c6a9e [TRACE] 23:46:15.772 shell.go:FileContent(/Users/chaitanyasharma/programs/neovim/.git/HEAD) - 61.125Β΅s [TRACE] 23:46:15.772 shell.go:Pwd() - 125ns [TRACE] 23:46:15.772 shell.go:GOOS() - 41ns [TRACE] 23:46:15.772 shell.go:Pwd() - 167ns [DEBUG] 23:46:15.772 segment.go:SetEnabled:512 β Segment: Path [TRACE] 23:46:15.772 shell.go:GOOS() - 41ns [TRACE] 23:46:15.772 shell.go:Pwd() - 42ns [DEBUG] 23:46:15.772 segment.go:SetEnabled:512 β Segment: Text [TRACE] 23:46:15.772 shell.go:Shell() - 83ns [TRACE] 23:46:15.772 shell.go:Shell() - 42ns [TRACE] 23:46:15.772 shell_unix.go:Root() - 791ns [TRACE] 23:46:15.772 shell.go:Shell() - 125ns [TRACE] 23:46:15.772 shell.go:StatusCodes() - 42ns [DEBUG] 23:46:15.772 shell_unix.go:IsWsl:35 β false [TRACE] 23:46:15.772 shell_unix.go:IsWsl() - 2.541Β΅s [DEBUG] 23:46:15.772 properties.go:GetBool:22 β mapped_locations_enabled: true [DEBUG] 23:46:15.772 properties.go:GetString:28 β ο [DEBUG] 23:46:15.772 properties.go:GetString:28 β ο [TRACE] 23:46:15.772 shell.go:GOOS() - 0s [DEBUG] 23:46:15.772 properties.go:GetString:28 β home [DEBUG] 23:46:15.772 properties.go:GetKeyValueMap:46 β mapped_locations: map[] [TRACE] 23:46:15.772 shell.go:PathSeparator() - 83ns [TRACE] 23:46:15.772 shell.go:GOOS() - 41ns [TRACE] 23:46:15.772 shell.go:GOOS() - 125ns [TRACE] 23:46:15.773 shell.go:GOOS() - 41ns [TRACE] 23:46:15.773 shell.go:GOOS() - 42ns [TRACE] 23:46:15.773 shell.go:PathSeparator() - 41ns [TRACE] 23:46:15.773 shell.go:PathSeparator() - 41ns [TRACE] 23:46:15.773 shell.go:GOOS() - 0s [TRACE] 23:46:15.773 shell.go:GOOS() - 42ns [TRACE] 23:46:15.773 shell.go:PathSeparator() - 0s [TRACE] 23:46:15.773 shell.go:GOOS() - 42ns [TRACE] 23:46:15.773 shell.go:GOOS() - 42ns [TRACE] 23:46:15.773 shell.go:PathSeparator() - 42ns [TRACE] 23:46:15.773 shell.go:GOOS() - 83ns [TRACE] 23:46:15.773 shell.go:GOOS() - 42ns [TRACE] 23:46:15.773 shell.go:PathSeparator() - 83ns [TRACE] 23:46:15.773 shell.go:PathSeparator() - 42ns [DEBUG] 23:46:15.773 properties.go:GetString:28 β folder [TRACE] 23:46:15.773 shell.go:GOOS() - 83ns [TRACE] 23:46:15.773 shell.go:GOOS() - 83ns [TRACE] 23:46:15.773 shell.go:GOOS() - 83ns [TRACE] 23:46:15.773 shell.go:GOOS() - 42ns [TRACE] 23:46:15.773 shell.go:GOOS() - 83ns [TRACE] 23:46:15.773 shell.go:GOOS() - 41ns [TRACE] 23:46:15.773 shell.go:GOOS() - 42ns [TRACE] 23:46:15.773 shell.go:PathSeparator() - 41ns [DEBUG] 23:46:15.773 properties.go:GetString:28 β NO DATA [TRACE] 23:46:15.773 shell.go:PathSeparator() - 42ns [DEBUG] 23:46:15.773 properties.go:GetString:28 β / [TRACE] 23:46:15.773 shell.go:Pwd() - 83ns [DEBUG] 23:46:15.773 shell_unix.go:IsWsl:35 β false [TRACE] 23:46:15.773 shell_unix.go:IsWsl() - 4.667Β΅s [TRACE] 23:46:15.773 shell.go:StackCount() - 83ns [TRACE] 23:46:15.773 shell_unix.go:DirIsWritable(/Users/chaitanyasharma/programs/neovim) - 11.416Β΅s [DEBUG] 23:46:15.773 shell.go:TemplateCache:843 β environment: [PYENV_SHELL=zsh EDITOR=nvim ALACRITTY_SOCKET=/var/folders/jw/9y5g06rn0nbggxgd91lsz5fm0000gn/T/Alacritty-1905.sock USER=chaitanyasharma STARSHIP_SESSION_KEY=1964023208250412 ZAP_PLUGIN_DIR=/Users/chaitanyasharma/.local/share/zap/plugins PATH=/Users/chaitanyasharma/.rbenv/shims:/opt/homebrew/bin:/opt/homebrew/sbin:/Users/chaitanyasharma/go/bin:/Users/chaitanyasharma/Library/Android/sdk/platform-tools:/Users/chaitanyasharma/.pub-cache/bin:/Users/chaitanyasharma/.cargo/bin:/Users/chaitanyasharma/fvm/default/bin/cache/dart-sdk/bin:/Users/chaitanyasharma/fvm/default/bin:/home/chaitanya/.local/share/nvim/plugged/fzf/bin:/Users/chaitanyasharma/.rbenv/shims:/Users/chaitanyasharma/.pyenv/shims:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Library/Apple/usr/bin:/Users/chaitanyasharma/.local/bin/overrides:/Users/chaitanyasharma/Library/Android/sdk/platform-tools/:/Users/chaitanyasharma/.poetry/bin:/Users/chaitanyasharma/.config/bin:/Users/chaitanyasharma/.local/share/nvim/mason/bin:/opt/homebrew/bin:/opt/homebrew/sbin JAVA_HOME=/Library/Java/JavaVirtualMachines/zulu-11.jre/Contents/Home __CF_USER_TEXT_ENCODING=0x1F5:0x0:0x0 XPC_FLAGS=0x0 GOPATH=/Users/chaitanyasharma/go __CFBundleIdentifier=org.alacritty FLUTTER_SDK_ROOT=/Users/chaitanyasharma/fvm/default CDPATH=.:/Users/chaitanyasharma/dotfiles:/Users/chaitanyasharma/.config:/Users/chaitanyasharma/Programs:/Users/chaitanyasharma/projects:/Users/chaitanyasharma/.local/share/nvim/lazy SHELL=/bin/zsh ZDOTDIR=/Users/chaitanyasharma/.config/zsh LOGNAME=chaitanyasharma LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 HOME=/Users/chaitanyasharma HISTORY_IGNORE=(la|ls|cd|pwd|exit|history|cd -|cd ..|q|c|vim|nvim) XDG_CONFIG_HOME=/Users/chaitanyasharma/.config HOMEBREW_CELLAR=/opt/homebrew/Cellar HOMEBREW_REPOSITORY=/opt/homebrew ALACRITTY_WINDOW_ID=4729187328 FZF_DEFAULT_COMMAND=fd --type file --hidden --exclude .git TMUX_PANE=%60 RBENV_SHELL=fish VISUAL=nvim PYENV_ROOT=/Users/chaitanyasharma/.pyenv TMPDIR=/var/folders/jw/9y5g06rn0nbggxgd91lsz5fm0000gn/T/ STARSHIP_SHELL=zsh TERM_PROGRAM_VERSION=3.3a TERM_PROGRAM=tmux SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.A78xVwExmY/Listeners NOTESPATH=/Users/chaitanyasharma/projects/notes OLDPWD=/Users/chaitanyasharma/.local/share/zap HISTSIZE=200000 LDFLAGS=-L/opt/homebrew/opt/llvm/lib MANPATH=/opt/homebrew/share/man:/opt/homebrew/share/man:: omp_last_status_generation=68 TERM=screen-256color XDG_STATE_HOME=/Users/chaitanyasharma/.local/state FZF_DEFAULT_OPTS= --cycle --info=hidden --prompt='β' --pointer='β' --tabstop=4 --color=fg:#a6accd,bg:#0f111a,hl:#464b5d --color=fg+:#a6accd,bg+:#0f111a,hl+:#89ddff --color=info:#0f111a,prompt:#c792ea,pointer:#f07178 --color=marker:#c792ea,spinner:#c792ea,header:#464b5d --color=preview-bg:#090b10,border:#464b5d FZF_ALT_C_COMMAND=fd . -t d --hidden FZF_CTRL_T_COMMAND=fd --type file --hidden --exclude .git CPPFLAGS=-I/opt/homebrew/opt/llvm/include HOMEBREW_PREFIX=/opt/homebrew POSH_SHELL_VERSION=3.7.0 XDG_DATA_HOME=/Users/chaitanyasharma/.local/share COLORTERM=truecolor FLUTTER_ROOT=/Users/chaitanyasharma/fvm/default BAT_THEME=Visual Studio Dark+ omp_lastcommand=oh-my-posh debug --plain | pbc COMMAND_MODE=unix2003 SHLVL=3 ANDROID_SDK_ROOT=/Users/chaitanyasharma/Library/Android/Sdk XDG_CACHE_HOME=/Users/chaitanyasharma/.local/cache PWD=/Users/chaitanyasharma/programs/neovim FZF_CTRL_T_OPTS= --info=hidden --border --preview 'bat -n --color=always {}' --bind 'ctrl-/:change-preview-window(down|hidden|)' TMUX=/private/tmp/tmux-501/default,1910,15 FZF_CTRL_R_OPTS= --info=inline --border --reverse --preview 'echo {}' --preview-window up:3:hidden:wrap --bind 'ctrl-/:toggle-preview' --bind 'ctrl-y:execute-silent(echo -n {2..} | pbcopy)+abort' --color header:italic --header 'Press CTRL-Y to copy command into clipboard' ZSHRC=/Users/chaitanyasharma/.config/zsh/.zshrc ZAP_DIR=/Users/chaitanyasharma/.local/share/zap INFOPATH=/opt/homebrew/share/info:/opt/homebrew/share/info: XPC_SERVICE_NAME=0 POSH_THEME=/Users/chaitanyasharma/dotfiles/oh-my-posh.rc.toml WINDOWID=4729187328 FZF_ALT_C_OPTS= --preview='tree -C {} | head -50' ALACRITTY_LOG=/var/folders/jw/9y5g06rn0nbggxgd91lsz5fm0000gn/T/Alacritty-1905.log] [TRACE] 23:46:15.773 shell.go:Pwd() - 83ns [TRACE] 23:46:15.773 shell.go:GOOS() - 41ns [TRACE] 23:46:15.773 shell.go:GOOS() - 42ns [TRACE] 23:46:15.773 shell.go:GOOS() - 41ns [TRACE] 23:46:15.773 shell.go:GOOS() - 42ns [TRACE] 23:46:15.773 shell.go:GOOS() - 84ns [TRACE] 23:46:15.773 shell.go:GOOS() - 42ns [TRACE] 23:46:15.773 shell.go:GOOS() - 41ns [TRACE] 23:46:15.773 shell.go:GOOS() - 42ns [DEBUG] 23:46:15.773 shell.go:User:564 β chaitanyasharma [TRACE] 23:46:15.773 shell.go:User() - 2.667Β΅s [DEBUG] 23:46:15.773 shell.go:Host:576 β 192.168.1.17 [TRACE] 23:46:15.773 shell.go:Host() - 15.125Β΅s [TRACE] 23:46:15.773 shell.go:GOOS() - 42ns [DEBUG] 23:46:15.773 shell.go:Getenv:399 β 3 [TRACE] 23:46:15.773 shell.go:Getenv(SHLVL) - 2.625Β΅s [TRACE] 23:46:15.773 shell.go:TemplateCache() - 1.077542ms [TRACE] 23:46:15.773 shell.go:TemplateCache() - 599.583Β΅s [TRACE] 23:46:15.774 shell.go:TemplateCache() - 1.065916ms [DEBUG] 23:46:15.774 properties.go:GetBool:22 β always_enabled: true [TRACE] 23:46:15.774 shell.go:TemplateCache() - 167ns [DEBUG] 23:46:15.781 shell.go:RunCommand:594 β nightly [TRACE] 23:46:15.781 shell.go:RunCommand(git -C /Users/chaitanyasharma/programs/neovim --no-optional-locks -c core.quotepath=false -c color.status=false describe --tags --exact-match) - 8.846042ms [DEBUG] 23:46:15.781 properties.go:GetString:28 β π· [DEBUG] 23:46:15.781 properties.go:GetBool:22 β fetch_upstream_icon: false [TRACE] 23:46:15.781 shell.go:TemplateCache() - 208ns [DEBUG] 23:46:15.781 text.go:Render:70 β Rendering template: β [TRACE] 23:46:15.781 shell.go:Shell() - 250ns [DEBUG] 23:46:15.781 text.go:Render:70 β Rendering template: