Page MenuHomeDevCentral

Add a VCS informative prompt to `arc shell`
Open, WishlistPublic

Description

Install Steve Losh zsh prompt or nojhan Liquidprompt to offer a shell with visual clues in the prompt.

The Cloud9 containers are especially nice and minimalist in this aspect.

Information needed

  • The name of the branch (mandatory)
  • The type of VCS (facultative)
  • Some indicators when a merge isn't completed (nice to have)

Done for Git. Still to do for Mercurial and SVN.

Event Timeline

Liquidprompt doesn't seem to print correctly Git information as root.

For Git, we can use https://github.com/git/git/blob/master/contrib/completion/git-prompt.sh.

It requires to set the following prompt:

To add to .bashrc
PS1='[\u@\h \W$(__git_ps1 " (%s)")]\$ '

Options to test

Some options indicate relevant information before arc diff or arc land:

To add to .bashrc
GIT_PS1_SHOWDIRTYSTATE=1
GIT_PS1_SHOWUNTRACKEDFILES=1
GIT_PS1_SHOWUPSTREAM="auto"
GIT_PS1_SHOWCOLORHINTS=1

zsh + starship looks a good solution too, but it's not packaged for Debian.

rOPS provisions starship through a package for FreeBSD and snap for Linux.