Skip to content

Instantly share code, notes, and snippets.

View saccarosium's full-sized avatar
💤
Probably sleeping

Luca Saccarola saccarosium

💤
Probably sleeping
  • Italy
View GitHub Profile
@saccarosium
saccarosium / .bashrc
Last active April 16, 2025 12:28
Fancy bash prompt
has() { type "$1" >/dev/null 2>&1; }
__ps1_git() {
local B S C c u z
# If not in working tree return
git rev-parse --is-inside-work-tree &>/dev/null || return
B=$(git branch --show-current 2>/dev/null)
# If there is no branch your are detached
[[ -z $B ]] && B=$(git rev-parse --short HEAD)
S=$(git status --porcelain -s 2>/dev/null)