memo.xight.org

日々のメモ

カテゴリ : fish

1ページ目 / 全1ページ

fish + tmux + ssh で ProxyCommand が動作しなくなった場合の対処

Summary

fish に乗り換えたら sshのプロキシが動作しなくなったのでその対処。

$HOME/.ssh/config

Host target.example.com
	HostName		target.example.com
	ProxyCommand	ssh -W %h:%p proxy.example.com

ssh に -v オプションを付けて実行してみる

ssh -v target.example.com
...
...
debug1: ssh_exchange_identification: \033Ptmux;\033\033]1337;CursorShape=0\033\\SSH-2.0-OpenSSH_5.3
...
...

ssh_exchange_identification でエスケープシーケンスが見える。

$HOME/.config/fish/config.fish

文字色を付けている部分を、インタラクティブモードで読み込ませないように変更。

if status --is-interactive
	...
	...
	...
end

ログインシェルはbashのままfishを利用したほうが良いかも

Qiita - 2016-10-04 - ログインシェルはbashのままfishを利用するにある通り、
fish は POSIX 非互換なので、インタラクティブシェルのときだけfishを利用するという手が良いかもしれない。

Reference

GitHub - fish-shell/fish-shell - Issues #2160
https://github.com/fish-shell/fish-shell/issues/2160

Qiita - 2016-10-04 - ログインシェルはbashのままfishを利用する
http://qiita.com/tak-onda/items/a90b63d9618d6b15c18c