I would like to share a nice ‘secret’. I want to introduce you to the Starship prompt! This is a getting started guide for Starship. I’m using Starship every day.
Starship Prompt, not to be confused with the Starship from SpaceX 😆 , is a cross-shell prompt written in Rust. The prompt works in any common shell you may already use under GNU/Linux, like Bash.
In fact, Starship prompt works under any shell under any operating system.
Why would you want to use Starship prompt in the first place? Let’s say you are already using Bash.
Well.. If you are a software engineer like myself. Starship is very useful. It extends your terminal with additional features. It’s not a replacement of Bash, instead Starship is more an addition.
For example Starship will show you information about when you enter a git repository using the Git modules.
Starship shows you the current git branch that is checked-out and the latest git tag. It also shows you in the terminal if you have any uncommitted changes left to commit. As well as if there are git commits that still need to be pushed, using the git status module.
Download and install the Startship prompt with the terminal via:
sh -c "$(curl -fsSL https://starship.rs/install.sh)"
Now add Starship to your favorite shell (example below is for the Bash shell).
Add the following line to the end of the
eval "$(starship init bash)"
Now, close your terminal and reopen a new terminal window. And Voilà!
You are running Starship!
Note: If you are running into font / icon issues, try installing a nerd font, to be sure you have all the icons available within the terminal.
The default configuration is actually pretty good already. That being said, Starship offers a ton of configuration options to customize your experience. So again, the following section is optionally.
Did you know?
There are general configuration settings for Starship, but almost each Starship module has additional configuration options available.
If you want to adapt the Starship configuration, create a new file:
The content of this file is up to you. See the Configuration docs web page fore more info. An example of the content of
# Increase Starship command scan & duration time-outs scan_timeout = 80 command_timeout = 1000 # Do not add new line add_newline = false # Do not truncate the directory listing [directory] truncation_length = 0 # Show even very fast command executions in terminal (in ms) [cmd_duration] min_time = 5 show_milliseconds = true
Restarting your terminal should apply the new changes.
Hint: Check-out my my dotfiles repository as well. This git repository contains more files besides my
If you are still reading this, try out Fish shell as well 🙂 . Yes, Starship works perfectly fine under Fish shell.