Thursday, June 28, 2018 [Tweets] [Favorites]

Making Your Shell Prompt Show Xcode and Git Status

Marc Palmer:

Often I run two or more different Xcode builds on the same machine, either because a client project can’t yet build on the latest Xcode release, or because we’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.

[…]

I’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 xcode-select).

[…]

By default it is set up to show your host and working dir, Xcode version — yep that’s the bit with the hammer 🔨 — and following that your git branch and status, if any.

1 Comment

Just a word on compatibility:

macOS 10.13 seems to fully support emojis.
macOS 10.12 doesn't fully support emojis in Terminal.app. Sometimes the first character in the input cannot be removed. (press up&down to browse the history exposes this bug)
Prompt 2 on iOS also gets confused about character position
Ubuntu on Windows doesn't show the emojis but doesn't get confused about character position
Terminal app in Debian 8 doesn't show the emojis and in addition gets confused about character position.
Terminal app in Ubuntu 18.04 seems to fully support emojis

Stay up-to-date by subscribing to the Comments RSS Feed for this post.

Leave a Comment