Quantcast
Viewing all articles
Browse latest Browse all 2722

bashからzshへの乗り換え

Image may be NSFW.
Clik here to view.
:pencil:
このエントリーは、MacOS Catalinaからデフォルトシェルが bashから zshになったことを期に、bashからzshへ乗り換えるための作業メモ

前提条件

ホームディレクトリで作業

$ pwd
/Users/gentamura

現在利用しているシェルはbash

$ echo $SHELL
/bin/bash

zshがインストールされている

❯ 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

移行作業

ログインシェルを入れ替え

$ chsh -s /bin/zsh

一旦ターミナルを閉じて、再起動

利用しているシェルを確認

$ echo $SHELL
/bin/bash

設定ファイルをコピー

$ cp .bash_profile .zsh_profile

設定ファイルを一部書き換え

$ vim .zsh_profile

export PATH="$HOME/.anyenv/bin:$PATH"
eval "$(anyenv init -)"

export PATH="$HOME/.cargo/bin:$PATH"
export PATH="/Applications/flutter/bin:$PATH"

export GOPATH="$(go env GOPATH)"
export PATH="$GOPATH/bin:$PATH"

eval "$(starship init bash)" => eval "$(starship init zsh)" に変更

再起動

$ source .zsh_profile

以上です。
今の所無事動いているので、なにかあれば追記しますImage may be NSFW.
Clik here to view.
:elephant:


Viewing all articles
Browse latest Browse all 2722

Trending Articles