tag:crieit.net,2005:https://crieit.net/users/sato_c/feed
sato_cの投稿 - Crieit
Crieitでユーザーsato_cによる最近の投稿
2019-09-23T12:27:38+09:00
https://crieit.net/users/sato_c/feed
tag:crieit.net,2005:PublicArticle/15109
2019-06-15T11:16:12+09:00
2019-09-23T12:27:38+09:00
https://crieit.net/posts/VSCode
VSCodeメモ書き
<p>バージョンアップするたびに機能増えるのはいいんですがちょっとこれどうすんのっていうのをメモ</p>
<p>ボードにしたほうがよかった気がする。</p>
<h2 id="各バージョンのリリースノート"><a href="#%E5%90%84%E3%83%90%E3%83%BC%E3%82%B8%E3%83%A7%E3%83%B3%E3%81%AE%E3%83%AA%E3%83%AA%E3%83%BC%E3%82%B9%E3%83%8E%E3%83%BC%E3%83%88">各バージョンのリリースノート</a></h2>
<p><a target="_blank" rel="nofollow noopener" href="https://code.visualstudio.com/updates/v1_35#_improved-surfacing-of-shell-selector-on-windows">v1.35</a><br />
<a target="_blank" rel="nofollow noopener" href="https://code.visualstudio.com/updates/v1_38#_integrated-terminal">v1.38</a></p>
<h3 id="1.35"><a href="#1.35">1.35</a></h3>
<h4 id="shell 切り替え"><a href="#shell+%E5%88%87%E3%82%8A%E6%9B%BF%E3%81%88">shell 切り替え</a></h4>
<p>windows10環境で1.35.1だとpowershell(integrate console)がデフォルトで今までと同じくコマンドプロンプトにならないのか?って思ってたら、cfg書き直さなくてもターミナルのドロップダウンリストで選択できるようになった。</p>
<p>ターミナルの横にドロップダウンリストが表示されているので</p>
<p><a href="https://crieit.now.sh/upload_images/00d6f6b8552e58836dee425a95316acb5d0451c919524.PNG" target="_blank" rel="nofollow noopener"><img src="https://crieit.now.sh/upload_images/00d6f6b8552e58836dee425a95316acb5d0451c919524.PNG?mw=700" alt="規定のシェルの選択" /></a></p>
<p>選択を選ぶと使えるシェルが選択できる。WSL環境のbashまで選択肢に入ってる。<br />
次回以降は、ここで選んだものがデフォルトになる。cmdを選ぶと次回以降もcmd</p>
<p><a href="https://crieit.now.sh/upload_images/34e3e6486dd66b41579f580919e49e8e5d0452cbc35c4.PNG" target="_blank" rel="nofollow noopener"><img src="https://crieit.now.sh/upload_images/34e3e6486dd66b41579f580919e49e8e5d0452cbc35c4.PNG?mw=700" alt="選択可能なシェルが表示される" /></a></p>
<p>msのpowershell機能拡張(ms-vscode.powershell)を入れてるとPowershellは右下にpsengineのバージョンが表示される。</p>
<p><a href="https://crieit.now.sh/upload_images/e256e0915f479ff24ae6a0c1a6455e4a5d0454605ae61.PNG" target="_blank" rel="nofollow noopener"><img src="https://crieit.now.sh/upload_images/e256e0915f479ff24ae6a0c1a6455e4a5d0454605ae61.PNG?mw=700" alt="PowerShellのバージョン" /></a></p>
<h4 id="WSL側のファイルを編集する"><a href="#WSL%E5%81%B4%E3%81%AE%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E3%82%92%E7%B7%A8%E9%9B%86%E3%81%99%E3%82%8B">WSL側のファイルを編集する</a></h4>
<p><a target="_blank" rel="nofollow noopener" href="https://code.visualstudio.com/docs/remote/wsl">WSLを使ったリモート開発</a>の手順を実行するだけで、WSL側の環境を手軽に使えるようになって、非常に便利</p>
<p>Windows側のVSCodeに<a target="_blank" rel="nofollow noopener" href="https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.vscode-remote-extensionpack">RemoteDevelopment機能拡張</a>をインストールする</p>
<p>WSL側で</p>
<pre><code>code .
</code></pre>
<p>といれるとWindows側のCodeが起動して必要なファイルを自動でダウンロードして接続してくれる。<br />
ワークスペースが存在する場合は、</p>
<pre><code>code ./[ワークスペースファイル.code-workspace]
</code></pre>
<p>で、ワークスペースを反映した状況で起動する</p>
<h3 id="1.38"><a href="#1.38">1.38</a></h3>
<h4 id="統合されたターミナル"><a href="#%E7%B5%B1%E5%90%88%E3%81%95%E3%82%8C%E3%81%9F%E3%82%BF%E3%83%BC%E3%83%9F%E3%83%8A%E3%83%AB">統合されたターミナル</a></h4>
<p>teminal.integrated.cwd を使った際の動作を改善した。</p>
<p>次のようにcwd変数を使うように設定した場合</p>
<pre><code>"terminal.integrated.cwd": "${fileDirname}"
</code></pre>
<p>変数が参照できなかった場合は、エラーを出す代わりにターミナルにエラーを表示して、ワークスペースのディレクトリに移動する</p>
<h4 id="自動処理用シェルセッティング"><a href="#%E8%87%AA%E5%8B%95%E5%87%A6%E7%90%86%E7%94%A8%E3%82%B7%E3%82%A7%E3%83%AB%E3%82%BB%E3%83%83%E3%83%86%E3%82%A3%E3%83%B3%E3%82%B0">自動処理用シェルセッティング</a></h4>
<p>統合ターミナルで、シェルのセッティングが追加されていて、<br />
シェルの指定が可能になった。(例えばタスクなど)<br />
特に便利なのは、tmuxのような自動処理の際に利用できないシェルを利用している場合。<br />
In addition to setting the shell for the Integrated Terminal, you can now specify a shell for automation (such as Tasks). This is particularly useful if you use tmux as your shell since that doesn't work with all automation.</p>
<pre><code>"terminal.integrated.shell.osx": "/Users/user/bin/tmux_script"
"terminal.integrated.automationShell.osx": "bash",
</code></pre>
sato_c