Quantcast
Channel: Bashタグが付けられた新着記事 - Qiita
Viewing all articles
Browse latest Browse all 2833

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

$
0
0

事象

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:redif[$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のブランチ名をターミナルで表示できるようにする


Viewing all articles
Browse latest Browse all 2833

Latest Images

Trending Articles