Created
April 6, 2022 02:34
-
-
Save srkiNZ84/90f0a6e8ea86843db2b42d212e72e6b0 to your computer and use it in GitHub Desktop.
Custom bash bits
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Add git branch name to end of the shell prompt | |
source /etc/bash_completion.d/git-prompt | |
# Git bit is just '\[\033[02;03;31m\]$(__git_ps1 " (%s)")\[\033[00m\]' and explained below | |
# [033 - Set the terminal colours and formatting | |
# [02;03; - light font (not bold) | |
# 03; - italic | |
# 31m - red colour | |
# $(__git_ps1 " (%s)") - get the branch name | |
# [033[00m] - Reset the formatting back to 'normal' | |
PS1='\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\[\033[02;03;31m\]$(__git_ps1 " (%s)")\[\033[00m\]\$ ' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment