LoginSignup
33
32

More than 3 years have passed since last update.

Macでfishを使う

Last updated at Posted at 2017-12-26

自分用メモ。
Macを初期化した状態からfishを追加しよう、というだけの記事です。

準備

Homebrewをインストールする

参考:Homebrewを使いこなせ!Macへのインストールや使い方。

$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
$ brew -v

fishをインストールする

$ brew install fish
$ fish -v

準備はこれで終了です。

確認(飛ばしてok)

「変更できるshellの一覧」を確認する

$ cat /etc/shells
# List of acceptable shells for chpass(1).
# Ftpd will not allow users to connect who are not using
# one of these shells.

/bin/bash
/bin/csh
/bin/ksh
/bin/sh
/bin/tcsh
/bin/zsh

後でこの一覧の中にfishを追加します。

fishのパスの確認

$ which fish
/usr/local/bin/fish

設定

fishの追加

「確認」の項目で表示したshell一覧の中にfishを追加します。

$ sudo -e /etc/shells
# List of acceptable shells for chpass(1).
# Ftpd will not allow users to connect who are not using
# one of these shells.

/bin/bash
/bin/csh
/bin/ksh
/bin/sh
/bin/tcsh
/bin/zsh
/usr/local/bin/fish
~                                                                  
~                                                                  
~                                                                  
~                                                                  
~                                                                  
~                                                                  
~                                                                  
~                                                                  
-- INSERT --

上記のように、$ sudo -e /etc/shellsを実行したあと、aでインサートモード(編集モード)に入り、shell一覧の最後にfishのパス/usr/local/bin/fishを追加します。
追加し終わったらEscでコマンドモードに戻り、:wqを入力してファイルを保存で終了です。

参考:VIM (Vi) をターミナルで操作 / Mac OS X

これで変更できるshell一覧の中にfishが追加されました。

shellの変更

$ chsh -s /usr/local/bin/fish
上記を実行後、ターミナルを再起動して終了です。

おまけ

現在使っているshellの確認
$ echo $SHELL

参考

fishshellの導入方法 mac編
【Mac】ログインシェルの変更方法について (chsh, chpass)

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