デフォルトシェルがBashじゃないとVisual Studio for Macでコンソールアプリをデバッグしようとするとエラーになる

環境情報

内容

タイトルの通り。 VS for Macで、C#で作成したコンソールアプリをデバッグしてみたところエラーになってしまった。 f:id:kyokushi7ya:20171029221145p:plain f:id:kyokushi7ya:20171029214718p:plain

ter=vscode --connection=/var/folders/sp/mwvxp3qs2x590qp6vj7fjlcr0000gn/T/CoreFxPipe_vsdbg-ui-be8ed2c9c49644b4b22eb0e0ad822650; echo $? > /var/folders/sp/mwvxp3qs2x590qp6vj7fjlcr0000gn/T/tmp607f41ec.tmp; echo; read -p 'Press any key to continue...' -n1; exit
fish: $? is not the exit status. In fish, please use $status.
clear; cd "/Applications/Visual Studio.app/Contents/Resources/lib/monodevelop/AddIns/DotNetCore.Debugger/Adapter"; "/Applications/Visual Studio.app/Contents/Resources/lib/monodevelop/AddIns/DotNetCore.Debugger/Adapter/vsdbg" --interpreter=vscode --connection=/var/folders/sp/mwvxp3qs2x590qp6vj7fjlcr0000gn/T/CoreFxPipe_vsdbg-ui-be8ed2c9c49644b4b22eb0e0ad822650; echo $? > /var/folders/sp/mwvxp3qs2x590qp6vj7fjlcr0000gn/T/tmp607f41ec.tmp; echo; read -p 'Press any key to continue...' -n1; exit

原因

これもタイトルの通りで、デフォルトシェルがBashでなく、Fishを使っているから。

解決方法

Bashを使う。 、、、だとあんまりなので以下のように対応

  • デフォルトシェルはBash
  • iTerm2の設定でFishを使うように設定 f:id:kyokushi7ya:20171029221040p:plain

これだけでiTerm2実行時はFishが、デバッグ実行時にはBashが起動するようになる。 普段使っているのがITerm2なので自分的にはこれで解決。

一応、公式も対応するつもりのようですが、保留中になってますね。。。

https://developercommunity.visualstudio.com/content/problem/58220/visual-studio-2017-console-projects-are-incompatib.html

いつになるのだろう。。。