1

Topic: cannot enter control-mode in SQL Server 2016

I'm having a problem with ViEmu 3.7.5 for SQL Server 2016.  It installs, and says it is enabled, running and licensed, but I can't enter control-mode.  I have looked in the Keyboard binding options, and nothing is assigned to the Esc key; nor can I find any ViEmuSQL commands which refer to the Esc key, or to entering control mode.

I am running version 13.0.16100.1 of SSMS on a Windows 10 virtual machine.

Has anyone encountered this problem?

Thanks,
Dan

2

Re: cannot enter control-mode in SQL Server 2016

Hello Dan, I sent you an email with instructions on this, but here they are in case anybody else stumbles upon the same issue:

It turns out the Extension caches SQL Server Management Studio builds can get stale after installing or uninstalling ViEmu or other extensions, and SSMS may be not updating them properly. The way to fix it is to erase the caches and restart SSMS, so that it will rescan the extensions and rebuild the caches. Then ViEmu works fine. Here are the files and directories you need to erase in order to try this (feel free to just copy them over to a safe place in case you want to restore them, although it shouldn't be necessary since they are regenerated):

1. Go to "C:\Users\{username}\AppData\Local\Microsoft\SQL Server Management Studio\13.0\" (substitute your Windows username where I write "{username}")
2. Delete the directories "MEFCacheBackup" and "ComponentModelCache" (maybe not both of them are there, so erase whichever is present)
3. Go to "Extensions" subdirectory, and erase the two "*.cache" files there: "extensions.en-US.cache" and "extensionSdks.en-US.cache"

After this, restart SSMS and hopefully ViEmu will work. Please post here and let us know how it goes!

Apologies for the issue, there are too many fragile things in VS and SSMS extensibility...

Regards,

  -- Jon

3

Re: cannot enter control-mode in SQL Server 2016

Hi Jon, got your email, and responded, but I'll respond here as well for the benefit of anyone else with the same problem.

The problem persists.  There was no "MEFCacheBackup" to remove, but I removed "ComponentModelCache" and the two "Extensions" caches and restarted.

I did find that when I tried disabling ViEmu and re-enabling it, it would come back on in control mode.  But as soon as I return to input mode, it is stuck in that mode until I do the dis-/re-enable again.  Maybe this provides some clue as to what the problem may be?

Thanks again for taking the time to look into this.

Dan

4

Re: cannot enter control-mode in SQL Server 2016

Thanks much Dan. Having no MEFCacheBackup shouldn't be a problem, I think that is just the original name of "ComponentModelCache", which was renamed in a later version of SSMS16, and I just had it lying around from an earlier install of SSMS16.

As I think we already discussed over email, if ViEmu does enter normal mode with the block cursor, it means that it has loaded correctly, so the problem solved by clearing the caches is not happening for you. That is good.

On the other hand, ESC not working later to go back to normal mode means some piece of code is "gobbling up" the event and not passing it down the event processing chain. Some third-party add-ins have been known to do this in the past, especially in VS, and since they think they can handle ESC completely by themselves (as it does little else in stock VS than close a code completion drop down and maybe remove the current selection), they don't worry about processing it correctly.

If you send me the list of third-party extensions you have installed, I will try to look into it and see if that is the case, and then try to find a work-around of some sort.

Regards,

  -- Jon