Tag Archive for ubuntu wsl

Ubuntu/Debian (linux) WSL and Docker

If you would like to use docker on windows Ubuntu/Debain WSL you have to modify the .bashrc file in your home directory.

vi ~/.bashrc

and add this line to the end:

export DOCKER_HOST=tcp://localhost:2375

reload the modifications:

source ~/.bashrc

That’s all folks 😀

Ubuntu WSL add git brach name to promt

you have to mofify ~/.basrc from that:

 

if [ "$color_prompt" = yes ]; then
    PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else
    PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi
unset color_prompt force_color_prompt

to

if [ "$color_prompt" = yes ]; then
    PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[01;31m\]$(parse_git_branch)\[\033[00m\]\$ '
else
    PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w$(parse_git_branch)\$ '
fi
#unset color_prompt force_color_prompt

Modification details:

  • add $(parse_git_branch)\[\033[00m\] 
  • and COMMENT the unset color_prompt force_color_prompt line

src: https://askubuntu.com/questions/730754/how-do-i-show-the-git-branch-with-colours-in-bash-prompt