LoginSignup
75
78

More than 5 years have passed since last update.

Bash on Ubuntu on Windows + オールインワンmintty

Last updated at Posted at 2016-08-26

はじめに

先日、mattnさんがBash on Ubuntu on Windows の最高の端末環境を教えてやるからちょっと来い。と素晴しい記事を書かれていたのですが、cbwinも一緒に使えないかと思っていたら既に統合されたものがありました!!!

インストール

wsl-terminal/releaseから最新の7zもしくはzipをダウンロードして任意のフォルダーに展開するだけです。

使い方

  • open-wsl.exeをWindowsから実行するとminttyが起動します。
  • tools/add-open-wsl-here-menu.jsを実行するとエクスプローラのコンテキストメニューからminttyを実行できます。
  • run-wsl-file.exeをWindowsから実行すると.shなどのスクリプトを実行できます。

ログインシェルとして実行したい!

デフォルトのままではログインシェルではないので実行パスが起動時のカレントディレクトリになっていますが、minttyから使うときはログインシェルにしたいものです。
その場合は以下の設定でログインシェルとしてbashを実行してホームディレクトリから起動できます。

v0.5.1より後のバージョン

2016/9/9現在、まだリリースされていませんが、以下のコミットでopen-wsl.exeに-lオプションが追加されたので、これを利用します。
https://github.com/goreliu/wsl-terminal/commit/1b1b74b85f54dafb57c999e4c46bf0e756a96a96
https://github.com/goreliu/wsl-terminal/commit/7d0a8832acf00f0678063c4fddd83ecd35102e5e

v0.5.1以前のバージョン

wsl-terminal.confのshellを上記のコミットと同じようなコマンドに変更します。

etc/wsl-terminal.conf
[config]
title="        "
shell=bash -c "cd; bash -l"
use_cbwin=0
use_tmux=0

cbwin

wsl-terminalのbinフォルダーにcbwinが同梱されています。
Bash on Ubuntu on Windows側からインストーラを実行してetc/wsl-terminal.confuse_cbwin1に設定すればwcmd(Windowsのcmd)とwstart(Windowsのstart)を使うことができます。

インストール
cd bin && sudo ./install_cbwin.sh
etc/wsl-terminal.conf
[config]
title="        "
shell=bash
use_cbwin=1
use_tmux=0

以上でminttyを使いつつWindowsのコマンドを実行することもできる環境の完成です。

75
78
4

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
75
78