Skip to content

Instantly share code, notes, and snippets.

@mordr
Last active January 6, 2022 19:22
Show Gist options
  • Save mordr/12a813bdbd28a14be7602fb686b79f06 to your computer and use it in GitHub Desktop.
Save mordr/12a813bdbd28a14be7602fb686b79f06 to your computer and use it in GitHub Desktop.
How to setup powerline-go shell prompt

Get powerline-go

See https://github.com/justjanne/powerline-go

Update bashrc/bash_profile

Add the following. Note, this is customized to my taste.

# Add powerline-go
function _update_ps1() {
    PS1="$($GOPATH/bin/powerline-go \
        -newline -cwd-max-depth 5 -mode compatible -colorize-hostname\
        -max-width 95 -shell bash\
        -modules 'venv,host,ssh,cwd,perms,git,hg,jobs,exit,root')"
}

if [ "$TERM" != "linux" ]; then
    PROMPT_COMMAND="_update_ps1; $PROMPT_COMMAND"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment