7
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Bash のプロンプトを bash-powerline でカッコよくする

Last updated at Posted at 2017-05-21

bash-powerline-with-git.png

OS X で環境構築するときに忘れないように Bash のプロンプトを bash-powerline でカッコよくする設定をメモっとく。Bash で Git のコマンドをオートコンプリートするの続き。

bash-powerline をインストールする

bash-powerline のスクリプトを .bash_powerline というファイル名でホームディレクトリにダウンロードする。ターミナルで ⌘T を実行したときにカレントワーキングディレクトリに移動する動作を維持するためにスクリプトを修正する。その上で .bash_profile.bash_powerline を読み込む設定を追加する。

$ curl -o ~/.bash_powerline https://raw.githubusercontent.com/riobard/bash-powerline/master/bash-powerline.sh
$ sed -i '' -e 's/PROMPT_COMMAND=ps1/PROMPT_COMMAND="ps1; $PROMPT_COMMAND"/' ~/.bash_powerline
$ cat <<EOF >> ~/.bash_profile
> [ -f ~/.bash_powerline ] && . ~/.bash_powerline
> EOF

参考文献

7
7
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
7
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?