Skip to content

Instantly share code, notes, and snippets.

@Siphonay
Last active November 16, 2024 21:56
Show Gist options
  • Save Siphonay/c52c5afe587ffe2e0aa716272afd6936 to your computer and use it in GitHub Desktop.
Save Siphonay/c52c5afe587ffe2e0aa716272afd6936 to your computer and use it in GitHub Desktop.
Windows/DOS style prompt for bash
winprompt() {
printf "%s:%s>" "$(printf "\\$(printf '%03o' $(( $(df -x tmpfs --output=target | tail -n +2 | grep -wn "$(findmnt -T . -o target -n)" | cut -d':' -f1) + 66 )))")" "$(pwd | sed 's/\//\\/g')";
}
PS1='$(winprompt)'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment