{"id":1824,"date":"2024-04-23T10:49:59","date_gmt":"2024-04-23T17:49:59","guid":{"rendered":"https:\/\/www.bradleycbuchanan.com\/b\/?p=1824"},"modified":"2024-04-23T10:49:59","modified_gmt":"2024-04-23T17:49:59","slug":"zsh-git-prompt-workaround","status":"publish","type":"post","link":"https:\/\/www.bradleycbuchanan.com\/b\/zsh-git-prompt-workaround\/","title":{"rendered":"ZSH git prompt workaround"},"content":{"rendered":"\n<p>I use a <a href=\"https:\/\/github.com\/islemaster\/donatello-theme\" data-type=\"URL\" data-id=\"https:\/\/github.com\/islemaster\/donatello-theme\">personal oh-my-zsh theme<\/a> which includes git status. Recently the git status part of my prompt stopped working &#8211; no error messages, it just vanished. I&#8217;m not sure what I broke.<br><br>I found the code for the <code>git_prompt_info<\/code> and <code>git_prompt_status<\/code> functions used to display this <a href=\"https:\/\/github.com\/ohmyzsh\/ohmyzsh\/blob\/5d2d35cd1741af19553007fe0cc5324744fc58fa\/lib\/git.zsh#L43\" data-type=\"URL\" data-id=\"https:\/\/github.com\/ohmyzsh\/ohmyzsh\/blob\/5d2d35cd1741af19553007fe0cc5324744fc58fa\/lib\/git.zsh#L43\">here in the ohmyzsh repo<\/a>, and determined that something about the async versions of these is broken. I have not successfully tracked down why; <code>_OMZ_ASYNC_OUTPUT<\/code> is empty, and there might be a clue <a href=\"https:\/\/github.com\/ohmyzsh\/ohmyzsh\/blob\/5d2d35cd1741af19553007fe0cc5324744fc58fa\/lib\/async_prompt.zsh#L123\" data-type=\"URL\" data-id=\"https:\/\/github.com\/ohmyzsh\/ohmyzsh\/blob\/5d2d35cd1741af19553007fe0cc5324744fc58fa\/lib\/async_prompt.zsh#L123\">here in async_prompt.zsh<\/a>. But for now, I&#8217;ve worked around this by pushing the following line into my <code>~\/.zshrc<\/code> file.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Switch to synchronous git status\nzstyle ':omz:alpha:lib:git' async-prompt false;<\/code><\/pre>\n\n\n\n<p>It will probably slow down my prompt a bit, but it seems snappy enough and got things working again for now.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I use a personal oh-my-zsh theme which includes git status. Recently the git status part of my prompt stopped working &#8211; no error messages, it just vanished. I&#8217;m not sure what I broke. I found the code for the git_prompt_info and git_prompt_status functions used to display this here in the ohmyzsh repo, and determined that&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[518,520,519],"class_list":["post-1824","post","type-post","status-publish","format-standard","hentry","category-programmer","tag-git","tag-oh-my-zsh","tag-zsh"],"_links":{"self":[{"href":"https:\/\/www.bradleycbuchanan.com\/b\/wp-json\/wp\/v2\/posts\/1824","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.bradleycbuchanan.com\/b\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bradleycbuchanan.com\/b\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bradleycbuchanan.com\/b\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bradleycbuchanan.com\/b\/wp-json\/wp\/v2\/comments?post=1824"}],"version-history":[{"count":2,"href":"https:\/\/www.bradleycbuchanan.com\/b\/wp-json\/wp\/v2\/posts\/1824\/revisions"}],"predecessor-version":[{"id":1827,"href":"https:\/\/www.bradleycbuchanan.com\/b\/wp-json\/wp\/v2\/posts\/1824\/revisions\/1827"}],"wp:attachment":[{"href":"https:\/\/www.bradleycbuchanan.com\/b\/wp-json\/wp\/v2\/media?parent=1824"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bradleycbuchanan.com\/b\/wp-json\/wp\/v2\/categories?post=1824"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bradleycbuchanan.com\/b\/wp-json\/wp\/v2\/tags?post=1824"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}