Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

My Starship Prompt Setup

A cross-shell prompt configuration for my terminal with consistent icons and git status across shells

Prerequisite

  • A terminal (of course)
  • Starship installed in shell (see below)
  • A Nerd Font installed (e.g., JetBrainsMono Nerd Font)

Installation

1. Download and install any NerdFont and select in your terminal of choice

2. Install Starship on your shell

PowerShell (Windows):

choco install starship

Linux:

curl -sS https://starship.rs/install.sh | sh

3. Do any of these for your respective shell

  • PowerShell (Windows)

Run these:

# Allow local scripts to run
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser

# Fix profile file encoding (preserves icons)
$ProfileContent = Get-Content $PROFILE
$ProfileContent | Set-Content $PROFILE -Encoding UTF8

Then run:

# Use your preferrred code editor. Example uses VS code
code $PROFILE

Add the contents of Microsoft.Powershell_profile.ps1 to the opened file and save

  • Linux: Add the contents of .bashrc to your .bashrc or .zshrc, followed by either of these:

.bashrc:

PROMPT_COMMAND="update_dir_icon;$PROMPT_COMMAND"

.zshrc:

precmd() {
  update_dir_icon
}

Then run this

# or .zshrc
source .bashrc

4. Create or open the config File on the respective locations

  • PowerShell (Windows)
# Use your preferrred code editor. Example uses VS code
code "$env:USERPROFILE\.config\starship.toml"
  • Linux:
# Use your preferrred code editor. Example uses Vim
vim ~/.config/starship.toml

Copy the starship.toml config here, paste in the file and save.

4. Restart your shell

  • PowerShell (Windows)
. $PROFILE
  • Linux:
exec $SHELL

Sharing the Config Across All Shells

If you use WSL and you want to share the same starship.toml config across all your profiles:

  • Place config in a shared location eg:

Windows (PowerShell): C:\Users\YourName\.config\starship.toml

WSL (Linux profiles): Symlink to the Windows file:

mkdir -p ~/.config
ln -sf /mnt/c/Users/YourName/.config/starship.toml ~/.config/starship.toml

Configuration Overview

Module Purpose
os Shows OS icon
username Displays current username
directory Shows current folder (truncated to 1 level)
git_branch Shows git branch with icon
git_status Shows git staged or unstaged
character Shows Input prompt character

Troubleshooting

Issue Solution
Icons showing as squares Install Nerd Font and set in Terminal
"Running scripts is disabled" Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
WSL scanning timeout warning Add scan_timeout = 500 to config
Editor terminal missing icons Set terminal.font_family = "JetBrainsMono Nerd Font" in Editor settings

Files in This Repo

  • starship.toml — Main Starship configuration
  • profile.ps1 — PowerShell profile contents
  • .bashrc — Bash configuration

References

You should be good to go. If it fails, ask AI or something lol.

About

Configuration settings for starship

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages