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

Macでgit-prompt.sh のPROMPT_DIRTRIM が効かない解決法

Posted at

起こったこと

Mac terminal(bash) で git-prompt.sh でCommand Lineをいい感じに
整形しようとしたら
現在pathの表示部分が長いときに折りたたむ

PROMPT_DIRTRIM=2

のように PROMPT_DIRTRIMが効かなかった。

解決法

bash のバージョンが古いらしい。(>= v4.0が対応のよう)
ので、バージョンアップ。
(そして利用shellの変更。)

$ brew install bash

# Add the new shell to the list of legit shells
$ sudo bash -c "echo /usr/local/bin/bash >> /private/etc/shells"

# Change the shell for the user
$ chsh -s /usr/local/bin/bash

そしてterminal に入り直す。

参考

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