Display the current Git branch in the Terminal prompt (PS1) #3284
Labels
feature: terminal
meta: never-stale
This issue can never become stale
type: feature request
New feature or request
type: improvement
Improves an existing feature or existing code
Today, the Git branch/context is not shown in Gitpod's Terminal prompt.
But maybe it could be nice to have it included (this seems to be a common pattern, and Git even comes standard with the dedicated helper
__git_ps1
).Current prompt
Proposed new prompt
This can be achieved like so:
PS1='\[\033[01;32m\]\u\[\033[00m\] \[\033[01;34m\]\w\[\033[00m\]$(__git_ps1 " (%s)") $ '
Criticism
I believe we've previously decided against having this, because the current branch name is already displayed in the bottom left of the IDE:
However, I personally find it hard to spot, and sometimes still accidentally push to the wrong place because I don't know I'm on the wrong branch.
The text was updated successfully, but these errors were encountered: