git bash上でxonshを走らせる [忘備録]

手順

  1. ここを読んで xonsh をインストール Windows Guide — xonsh 0.9.13 documentation https://xon.sh/windows.html

    • pip install xonsh
    • pip install prompt-toolkit
  2. git bash を起動

  3. winpty python.exe -m xonsh で起動するか確認

  4. 起動したらctrl + dで xonsh を閉じる

  5. .bash_profile を作成した記憶がなければ code ~/.bash_profile 等で作成

  6. .bash_profile に winpty python.exe -m xonsh を記述

  7. git bash を再起動すると xonsh が自動で起動する

  8. あとはご自由に

余談

なぜ git bash で動かすのか

コマンドプロンプトで動かすだけなら、1.を実行したあとxonshとプロンプト上で動く。でも、ls等のUNIXコマンドが使えない。
なので、git bash上で動かすことでls等のgit bashがサポートしているUNIXコマンドが動作するようになる。