...

Oh man. I love stuff like this. It is so nice to just know where you are in the terminal (especially as someone who gets lost a lot 😆), adn this is where Starship comes in. Starship is a cross-shell prompt utility that lets you control what your prompt looks like, and completely configure all kinds of extra information that you want displayed on your prompt. This article will show you how to get setup, specifically if you're working in macOS.

So, first things first, you have to install Starship. The easiest way to do this is with Homebrew, so if you don't have that installed, go ahead and do that first. Then, run the following command:

bash
1brew install starship

Next, you need to make sure you have a Nerd Font installed. I'd recommend FiraCode. This link will actually download the zip file. All you have to do is select the font from the unarchived folder and install it. I installed the "mono regular" font because it is most compatible with other terminal emulators (we'll get to that later).

On the guide link, there are tons of examples of how to setup your shell. I use zsh, so I added the eval line to my ~/.zshrc file. But also because I want to store my config file in a specific place I have add this line before the eval in the rc file.

bash
1export STARSHIP_CONFIG=~/.workspace/starship.toml 2eval "$(starship init zsh)"

Now this is because I keep all my aliases, bash function, scripts, and stuff in a ~/.workspace folder that lives in GitHub. I also keep my starship.toml file there, so I can version control it.

As I said before, it can be helpful to select a mono font, because for instance, if you use VS Code and the integrated terminal, it will need a setting change to know to use the Nerd Font in its terminal emulator. You need to update the setting for Terminal > Integrated: Font Family to the name of the Nerd Font you installed. As stated, I set mine to Fira Code Nerd Font Mono. If you try not to use a mono font, VS code will complain, and it won't work but in the end...

Sweet victory!
Sweet victory!

Mine is a bit of a minimalist approach but you can go pretty crazy with what you want on that prompt. Here is my starship.toml file:

toml
1"$schema" = 'https://starship.rs/config-schema.json' 2 3add_newline = true 4 5[character] 6# success_symbol = '[->](bold green)' 7 8[package] 9disabled = true 10 11[aws] 12disabled = true 13format = '\[[$symbol($profile)(\($region\))(\[$duration\])]($style)\]' 14 15[bun] 16format = '\[[$symbol($version)]($style)\]' 17 18[c] 19format = '\[[$symbol($version(-$name))]($style)\]' 20 21[cmake] 22format = '\[[$symbol($version)]($style)\]' 23 24[cmd_duration] 25format = '\[[⏱ $duration]($style)\]' 26 27[cobol] 28format = '\[[$symbol($version)]($style)\]' 29 30[conda] 31format = '\[[$symbol$environment]($style)\]' 32 33[crystal] 34format = '\[[$symbol($version)]($style)\]' 35 36[daml] 37format = '\[[$symbol($version)]($style)\]' 38 39[dart] 40format = '\[[$symbol($version)]($style)\]' 41 42[deno] 43format = '\[[$symbol($version)]($style)\]' 44 45[directory] 46home_symbol = "🏠" 47 48[docker_context] 49format = '\[[$symbol$context]($style)\]' 50 51[dotnet] 52format = '\[[$symbol($version)(🎯 $tfm)]($style)\]' 53 54[elixir] 55format = '\[[$symbol($version \(OTP $otp_version\))]($style)\]' 56 57[elm] 58format = '\[[$symbol($version)]($style)\]' 59 60[erlang] 61format = '\[[$symbol($version)]($style)\]' 62 63[fennel] 64format = '\[[$symbol($version)]($style)\]' 65 66[fossil_branch] 67format = '\[[$symbol$branch]($style)\]' 68 69[gcloud] 70disabled = true 71format = '\[[$symbol$account(@$domain)(\($region\))]($style)\]' 72 73[git_branch] 74format = '\[[$symbol$branch]($style)\]' 75 76[git_status] 77disabled = true 78format = '([\[$all_status$ahead_behind\]]($style))' 79 80[golang] 81format = '\[[$symbol($version)]($style)\]' 82 83[gradle] 84format = '\[[$symbol($version)]($style)\]' 85 86[guix_shell] 87format = '\[[$symbol]($style)\]' 88 89[haskell] 90format = '\[[$symbol($version)]($style)\]' 91 92[haxe] 93format = '\[[$symbol($version)]($style)\]' 94 95[helm] 96format = '\[[$symbol($version)]($style)\]' 97 98[hg_branch] 99format = '\[[$symbol$branch]($style)\]' 100 101[java] 102format = '\[[$symbol($version)]($style)\]' 103 104[julia] 105format = '\[[$symbol($version)]($style)\]' 106 107[kotlin] 108format = '\[[$symbol($version)]($style)\]' 109 110[kubernetes] 111format = '\[[$symbol$context( \($namespace\))]($style)\]' 112 113[lua] 114format = '\[[$symbol($version)]($style)\]' 115 116[memory_usage] 117format = '\[$symbol[$ram( | $swap)]($style)\]' 118 119[meson] 120format = '\[[$symbol$project]($style)\]' 121 122[nim] 123format = '\[[$symbol($version)]($style)\]' 124 125[nix_shell] 126format = '\[[$symbol$state( \($name\))]($style)\]' 127 128[nodejs] 129format = '\[[$symbol($version)]($style)\]' 130 131[ocaml] 132format = '\[[$symbol($version)(\($switch_indicator$switch_name\))]($style)\]' 133 134[opa] 135format = '\[[$symbol($version)]($style)\]' 136 137[openstack] 138format = '\[[$symbol$cloud(\($project\))]($style)\]' 139 140[os] 141format = '\[[$symbol]($style)\]' 142 143[perl] 144format = '\[[$symbol($version)]($style)\]' 145 146[php] 147format = '\[[$symbol($version)]($style)\]' 148 149[pijul_channel] 150format = '\[[$symbol$channel]($style)\]' 151 152[pulumi] 153format = '\[[$symbol$stack]($style)\]' 154 155[purescript] 156format = '\[[$symbol($version)]($style)\]' 157 158[python] 159format = '\[[${symbol}${pyenv_prefix}(${version})(\($virtualenv\))]($style)\]' 160 161[raku] 162format = '\[[$symbol($version-$vm_version)]($style)\]' 163 164[red] 165format = '\[[$symbol($version)]($style)\]' 166 167[ruby] 168format = '\[[$symbol($version)]($style)\]' 169 170[rust] 171format = '\[[$symbol($version)]($style)\]' 172 173[sudo] 174disabled = false 175 176[scala] 177format = '\[[$symbol($version)]($style)\]' 178 179[spack] 180format = '\[[$symbol$environment]($style)\]' 181 182[swift] 183format = '\[[$symbol($version)]($style)\]' 184 185[terraform] 186format = '\[[$symbol$workspace]($style)\]' 187 188[time] 189format = '\[[$time]($style)\]' 190 191[username] 192format = '\[[$user]($style)\]' 193 194[vagrant] 195format = '\[[$symbol($version)]($style)\]' 196 197[vlang] 198format = '\[[$symbol($version)]($style)\]' 199 200[zig] 201format = '\[[$symbol($version)]($style)\]' 202 203[solidity] 204format = '\[[$symbol($version)]($style)\]'