Skip to content

Shell

Style Terminal

Colors the command line to make the start of one command easier to find.

Add this to .bashrc:

export PS1="[\[$(tput sgr0)\]\[\033[38;5;9m\]\t\[$(tput sgr0)\]\[\033[38;5;15m\]] \[$(tput sgr0)\]\[\033[38;5;10m\]\u@\[$(tput sgr0)\]\[\033[38;5;34m\]\h\[$(tput sgr0)\]\[\033[38;5;15m\]:\[$(tput sgr0)\]\[\033[38;5;39m\]\w\[$(tput sgr0)\]\[\033[38;5;15m\] \[$(tput sgr0)\]\[\033[38;5;13m\]\\$\[$(tput sgr0)\]"

Make sure that this line is uncommented:

force_color_prompt=yes

Preview

Preview

Show current git branch

Add this to .bashrc:

git_branch() {
  git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}

export PS1=$PS1"\$(git_branch)"

Preview

Preview

Any other customizations will be preserved.

Useful aliases

Activate the venv in the current directory.

alias activenv="source venv/bin/activate"

Favorite Tools

Tool Description Installation
bat A cat clone with syntax highlighting and Git integration. apt install