LoginSignup
1
1

More than 5 years have passed since last update.

bashのプロンプトにmercurialのbranch名を表示する

Posted at
# ブランチ表示用の関数を定義
branch() {
  hg branch 2> /dev/null | awk '{print "(" $1 ")"}'
}

# プロンプト定義
export PS1="[\\u@\\h \w\$(branch)]\n$ "

こちらを参考にしました

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1