{"id":21968,"date":"2018-06-28T16:13:40","date_gmt":"2018-06-28T20:13:40","guid":{"rendered":"https:\/\/mjtsai.com\/blog\/?p=21968"},"modified":"2018-06-29T09:32:01","modified_gmt":"2018-06-29T13:32:01","slug":"making-your-shell-prompt-show-xcode-and-git-status","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2018\/06\/28\/making-your-shell-prompt-show-xcode-and-git-status\/","title":{"rendered":"Making Your Shell Prompt Show Xcode and Git Status"},"content":{"rendered":"<p><a href=\"http:\/\/marcpalmer.net\/hacking-my-shell-prompt-so-i-make-less-mistakes-working-with-xcode-projects\/\">Marc Palmer<\/a>:<\/p>\n<blockquote cite=\"http:\/\/marcpalmer.net\/hacking-my-shell-prompt-so-i-make-less-mistakes-working-with-xcode-projects\/\">\n<p>Often I run two or more different Xcode builds on the same machine, either because a client project can&rsquo;t yet build on the latest Xcode release, or because we&rsquo;re in a new Xcode beta period. Of course I forget which one I am running, especially if switching between projects multiple times in the same day.<\/p>\n<p>[&#8230;]<\/p>\n<p>I&rsquo;ve never customised my shell prompt before but I knew it was possible and I suspected it would be simple to show the current version of Xcode toolchain that the shell is using (which is controlled by <tt>xcode-select<\/tt>).<\/p>\n<p>[&#8230;]<\/p>\n<p>By default it is set up to show your host and working dir, Xcode version &mdash; yep that&rsquo;s the bit with the hammer &#x1F528; &mdash; and following that your git branch and status, if any.<\/p>\n<\/blockquote>","protected":false},"excerpt":{"rendered":"<p>Marc Palmer: Often I run two or more different Xcode builds on the same machine, either because a client project can&rsquo;t yet build on the latest Xcode release, or because we&rsquo;re in a new Xcode beta period. Of course I forget which one I am running, especially if switching between projects multiple times in the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"2018-06-29T13:32:03Z","apple_news_api_id":"97ff3199-778b-4413-95ad-cf1917d4e517","apple_news_api_modified_at":"2018-06-29T13:32:05Z","apple_news_api_revision":"AAAAAAAAAAAAAAAAAAAAAA==","apple_news_api_share_url":"https:\/\/apple.news\/Al_8xmXeLRBOVrc8ZF9TlFw","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[],"tags":[257,377,30,1529,318,226],"class_list":["post-21968","post","type-post","status-publish","format-standard","hentry","tag-emoji","tag-git","tag-mac","tag-macos-10-13","tag-terminal","tag-xcode"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/21968","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=21968"}],"version-history":[{"count":1,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/21968\/revisions"}],"predecessor-version":[{"id":21969,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/21968\/revisions\/21969"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=21968"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=21968"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=21968"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}