Search code examples
gitterminalwindows-10appearance

Is there a way to make git bash for windows look like ubuntu's terminal?


The title says it all - i hate the default git bash look. Is there a way to quickly change a theme without using 3d-party terminal programs?


Solution

  • You can just modify your PS1 global variable. You can take a look on this variable doing

    echo $PS1
    

    You will see : code like \[\033[35m\] start a color style and this code specifically \[\033[0m\]\ ends the color.

    __git_ps1 is the reference of your branch.

    With gitbash, by default you have :

    \[\033]0;$TITLEPREFIX:${PWD//[^[:ascii:]]/?}\007\]\n\[\033[32m\]\u@\h \[\033[35m\]$MSYSTEM \[\033[33m\]\w\[\033[36m\]`__git_ps1`\[\033[0m\]\n$
    

    but you can do something like :

    export PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]`__git_ps1`\[\033[0m\] \$> '
    

    Put the previous line in your .bashrc: you can type this line in the prompt and go back typing >bash