0
0

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.

[メモ]macOSをアップデートした時、ターミナルの表示がおかしくなる対処法

Last updated at Posted at 2020-05-17

事象

macOSをMojave → Catalinaにアップデートした時、
ターミナルがうまく動かなかったので行ったことを示す.

やったこと

1.シェルをzh → bashに変更

$ chsh -s /bin/bash

2.下記のファイルをインストール
・git-prompt.sh
・git-completion.bash

$ curl -o "/usr/local/etc/bash_completion.d/git-prompt.sh" https://raw.githubusercontent.com/git/git/master/contrib/completion/git-prompt.sh

$ curl -o "/usr/local/etc/bash_completion.d/.git-completion.bash" https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash

3..bashrcを編集

source /usr/local/etc/bash_completion.d/git-prompt.sh
source /usr/local/etc/bash_completion.d/git-completion.bash
GIT_PS1_SHOWDIRTYSTATE=true

# default:cyan / root:red
if [ $UID -eq 0 ]; then
    PS1='\[\033[31m\]\u@\h\[\033[00m\]:\[\033[01m\]\w\[\033[31m\]$(__git_ps1)\[\033[00m\]\\$ '
else
    PS1='\[\033[36m\]\u@\h\[\033[00m\]:\[\033[01m\]\w\[\033[31m\]$(__git_ps1)\[\033[00m\]\\$ '
fi

# "-F":ディレクトリに"/"を表示 / "-G"でディレクトリを色表示
alias ls='ls -FG'
alias ll='ls -alFG'

メモ

.bash_profile
 → ログイン時に読み込まれるファイル

.bashrc
 → bashを入力したときに読み込まれるファイル

参考:
[gitのブランチ名をターミナルで表示できるようにする]
(https://qiita.com/lemtosh469/items/334ff76366e054a3a3aa)

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?