0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

個人的なWSL上でのUbuntu設定

Posted at

概要

最近WSLを使っています。環境をリセットする機会も多いので、構築手順をまとめました。

Windows側のPATHを読み込まないようにする

Windows側の環境変数を読み込む設定の場合、Shellの応答性が極端に低くなる(1行1行表示するたびに時間がかかる)ようになります。/etc/wsl.confを設置し、Windows側のPATH読み込みを無効にします。この設定の副作用として、explorer.exeなどを使う場合、絶対パスで指定する必要が出てきてしまうので、これはaliasを作ることで対処します。

/etc/wsl.conf
[boot]
systemd=true
[interop]
appendWindowsPath=false

以下のエイリアスを設定。

alias e.='/mnt/c/WINDOWS/explorer.exe .'
alias code="/mnt/c/Users/***/AppData/Local/Programs/Microsoft\ VS\ Code/bin/code"
alias powershell.exe="/mnt/c/WINDOWS/System32/WindowsPowerShell/*/powershell.exe"
alias cmd.exe="/mnt/c/WINDOWS/system32/cmd.exe"
alias clip.exe="/c/WINDOWS/system32/clip.exe"

以上です。

0
0
0

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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?