Problems making my first VSCode Extension using Git Bash

Earlier today I published my first Extension in the Visual Studio Marketplace.  It’s a simple extension but it’s been a fun and curse inducing 2 weeks having never made an extension before.

In the process I came upon two problems that are caused by using Git Bash and although there are plenty of tutorials on making/publishing extensions, I want to make life a bit easier for anyone else that tries this route.


Problem 1

This comes nice and early when running the Visual Studio Code Extension Generator, when you run

yo code

All the tutorials tell you at this point to use the arrow keys to select the appropriate option.  If however you’re using git bash, the arrow keys don’t work, so you could use a normal terminal type environment or … select the option by typing the index value and hit enter.

Here’s some examples:

  • New Extension (Javascript), type 2
  • New Code Snippets, type 5

No arrow keys just numbers but a nice little workaround!

 


Problem 2

As part of the process to publish you need to get a personal access token with Azure DevOps and set up a publisher name with Visual Studio.  I’d already created my publisher name and inside my project was trying

vsce login (publisher name)

When I got an error instead of being asked for my access token.  I tried the same thing in a command prompt (again navigating inside my project), and the access token was asked for!!  A couple minutes later and my extension was published!


A final note

I did come across other issues but these were the ones that caught me with git bash (that I know about!).  I hope this helps out anyone else that gets stuck, and I may flesh this article out in future.

Here’s my extension for anyone that wants a look

Leave a comment