Showing posts with label prompt. Show all posts
Showing posts with label prompt. Show all posts

Thursday, July 16, 2020

Add git information to your bash prompt

To show git information in your bash prompt, add the following function in your ~/.bashrc

function git-shell() {
  export GIT_PS1_SHOWDIRTYSTATE=1
  export PS1='\[\033[01;33m\] (git) \[\033[01;34m\]\w$(__git_ps1 " \[\033[01;32m\](%s)")\[\033[00m\]\n\$ '
}

Then, in your bash, run "git-shell" and you will get a nice git prompt:

 (git) /path_to_your_git_project (master *)
$ 

Tuesday, December 17, 2019

Keep the color prompt in tmux

To keep your prompt (PS1) with color shown in tmux screen, add the following property in .bashrc:

force_color_prompt=yes


CSP on Apache

To add CSP to root if sort of funny. The following will NOT work for most cases !!     <LocationMatch "^/$">        Header s...