This page looks best with JavaScript enabled

Consistent Prompt With Starship

 ยท  โ˜• 2 min read  ยท  โœ๏ธ Syed Dawood

Intro

The minimal, blazing-fast, and infinitely customizable prompt for any shell!
- starship

Reasons starship

  • It is written in rust, you can expect almost C-language like performance.
  • Starship provides consistent and identical prompt across shell, this was the biggest selling point for me.
  • Shows active git branch and repo status if navigated directory is git repository, huge time saver.
    active branch
  • Smart enough to show major programming language version based on contents of directory and virtual environment name if it is active.
    Major programming language
  • Last command status via color, green for success and red for failure
    Last command status

Installation

Fire up your favourite terminal emulator.

1
yay -S starship-bin

Configuration

Next up, initialize startship. To do that, Update config file based on the shell in use.

1
eval "$(starship init bash)"

starship offers lots of bell and whistles when it cames to configuration with ability to customize every aspect of the prompt.

Use this config as a starting point. Remove/update parts to fit your taste.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
[hostname]
format =  "on [$hostname](bold red) "

[git_status]
conflicted = "๐Ÿณ"
ahead = "๐ŸŽ๐Ÿ’จ"
behind = "๐Ÿ˜ฐ"
diverged = "๐Ÿ˜ต"
stashed = "๐Ÿ“ฆ"
modified = "๐Ÿ“"
staged = '[++\($count\)](green)'
renamed = "๐Ÿ‘…"
deleted = "๐Ÿ—‘"


# if you are use gcloud
[gcloud]
symbol = "๏ธ๐Ÿ‡ฌ๏ธ "
format = "on [$symbol$account(\\($project\\))]($style) "

Closing thoughts

After I made the switch to starship, I felt my search for creating perfect prompt is completed. It provides me consistecy, the other day I have installed powershell and first thing I did was set up starship. After a while, I was confused as to why regular linux commands are not working only to find out that I was in powershell ๐Ÿ˜„.

References

Share on

ALLSYED
WRITTEN BY
Syed Dawood
< frontend | backend | fullstack > Developer