LoginSignup
31

More than 5 years have passed since last update.

Ubuntu on Windows で zshをデフォルトシェルにする

Last updated at Posted at 2016-06-12

はじめに

この方法は現在(2016/06/12)のPreviewであるWindows10 build 14361.0の仕様に基づいています。
また、いかなる事態が発生しようと当方は責任を負いかねますので了承ください。

準備

  1. Bash on Ubuntu on Windowsをセットアップする
  2. #apt-get update && apt-get upgradeで最新の状態にする
  3. #apt-get install -y zshでzshをインストール

ラッパースクリプトを作成

  1. #mv /bin/bash /bin/.bashでbashのバイナリを退避させる
  2. 以下のシェルスクリプトを/bin/bashとして保存
  3. #chmod 755 /bin/bashで実行可能な状態にする
/bin/bash
#!/bin/sh
export SHELL=/bin/zsh
exec $SHELL
exit

結果

これでBash on Ubuntu が起動するとラッパースクリプトがzshを起動させる
実際に#pstreeとすると

#pstree
init───zsh───pstree

となっていてzshがシェルとして動いてるのがわかる

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
31