mosh (mobile shell) は、NWが不安定で接続が切れたり、IP が変わっても接続を維持することがsshです。
主要なLinuxでは、バイナリパッケージがあるので、簡単にインストールできるのですが、cygwin から接続したい場合、cygwin向けのバイナリがないので、自分でコンパイルする必要が出てきます。
コンパイルは、https://gist.github.com/eerohele/2349067 を参考に実施しましたが、最新のcygwinやmoshでは若干異なるので、以下にメモ残します。
使用したバージョンは、mosh-1.3.2 + protobuf-3.5.1です。
まずはcygwinに必要なパッケージですが、私の環境では以下をインストールしました。
gcc-core
gcc-c++
make
libncurses-devel
pkg-config
perl
boost-build
openssl-devel
zlib-devel
moshコンパイルに必要なprotobufをコンパイルします。
$ wget https://github.com/google/protobuf/releases/download/v3.5.1/protobuf-all-3.5.1.tar.gz $ tar zxvf protobuf-all-3.5.1.tar.gz $ cd protobuf-3.5.1 $ ./configure $ make $ make install $ cd ..
moshをコンパイルします。
$ wget https://github.com/mobile-shell/mosh/releases/download/mosh-1.3.2/mosh-1.3.2.tar.gz $ tar zxvf mosh-1.3.2.tar.gz $ cd mosh-1.3.2 $ ./configure CPFLAGS="-I/usr/include/ncurses" PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/ $ make $ make install
以上で、mosh コマンドが使えるようになりました。