title: VSCode as Git editor on Windows Subsystem for linux (WSL)
body: <h1>Context</h1>
  
  <h3>System Information (Windows)</h3>
  
  <pre><code>OS Name:                   Microsoft Windows 10 Pro
  OS Version:                10.0.17134 N/A Build 17134
  ...
  System Type:               x64-based PC
  Processor(s):              1 Processor(s) Installed.
                             [01]: Intel64 Family 6 Model 158 Stepping 10 GenuineIntel ~3696 Mhz
  BIOS Version:              American Megatrends Inc. 2.20, 10/27/2017
  </code></pre>
  
  <h3>System Information (WSL)</h3>
  
  <pre><code>OS: Debian
  Kernel: x86_64 Linux 4.4.0-17134-Microsoft
  Shell: zsh 5.3.1
  CPU: Intel Core i7-8700K CPU @ 3.696GHz
  RAM: 8041MiB / 16344MiB
  </code></pre>
  
  <h3>Git</h3>
  
  <p>I have this in my <code>~/.gitconfig</code>:</p>
  
  <pre><code>[core]
      editor = code --wait
  </code></pre>
  
  <h1>Problem:</h1>
  
  <p>When I run <code>git commit</code>, vscode starts with <code>C:\mnt\$PathToRepo$\.git\COMMIT_EDITMSG</code>, but this file is empty (it's supposed to have changes to be commited + a diff).</p>
  
  <p>And when I write a commit message, save and exit, I get this in the terminal:</p>
  
  <pre><code>Aborting commit due to empty commit message.
  </code></pre>
  
  <p><strong>Note</strong>:</p>
  
  <p>when i do this:</p>
  
  <ol>
  <li><p>run <code>git commit</code>;</p></li>
  <li><p>write commit message in vscode (ex: <em>Initialize repo</em>), save and close;</p></li>
  <li><p>after the <code>Aborting commit due to empty commit message.</code>, i run <code>git commit</code> again;</p></li>
  </ol>
  
  <p>VSCode will open with the same commit message i wrote in step 2 (ie: <em>Initialize repo</em>)</p>