35
23

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.

Zsh on Ubuntu on Windows

Last updated at Posted at 2018-07-09

WSLのシェルをbashからzshに乗り換えてみたので、その手順と感想
###1.zshをインストール
まずはzshをインストール


sudo apt install zsh

###2.oh-my-zshをインストール
公式通りにインストール https://github.com/robbyrussell/oh-my-zsh


curl -L https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh | sh

###3.zsh-completionsをインストール
こちらはgithubから公式通りにインストールする https://github.com/zsh-users/zsh-completions


git clone https://github.com/zsh-users/zsh-completions ~/.oh-my-zsh/custom/plugins/zsh-completions

zsh-completionsをzshが読み込むよう、.zshrcに以下を記述

.zshrc
plugins=(… zsh-completions)
autoload -U compinit && compinit

###4.ログインシェルをzshに変更
which zshでzshのパスを取得し、それをコピー(多分/usr/bin/zshと出るからそれをコピー)
次にchshと入力。すると、


Password:
Changing the login shell for <username>
Enter the new value, or press ENTER for the default
        Login Shell [/bin/bash]:

と出てくるので、先ほどコピーしたパスを入力。もう一度WSLを立ち上げると、シェルがzshになってる

###まとめ
bashからzshに移行した途端WSLの使い勝手がすごく増したので、WSLを使っている方は迷うことなくはやくzshに乗り換えたほうがいい!

###参照
Ubuntuのシェルをzshに変更する
[初心者向け:Zshの導入]
(https://qiita.com/iwaseasahi/items/a2b00b65ebd06785b443)

35
23
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
35
23

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?