Hyper: Edit->Preferences ignoring EDITOR/system .js editor on Windows

Created on 17 Apr 2018  路  15Comments  路  Source: vercel/hyper

  • [x] I am on the latest Hyper.app version
  • [x] I have searched the issues of this repo and believe that this is not a duplicate
  • OS version and name: Windows 10
  • Hyper.app version: Hyper 2.0.0 (stable)
  • Link of a Gist with the contents of your .hyper.js: https://gist.github.com/jfro/33522fb05e05277de6c0b07daa4c9655
  • Relevant information from devtools _(CMD+ALT+I on macOS, CTRL+SHIFT+I elsewhere)_:
  • The issue is reproducible in vanilla Hyper.app: This is a vanilla install

Issue

I'm unable to get Edit->Preferences to respect my editor of choice. Windows understands .js files are to open in VS Code, and double clicking .hyper.js in windows Explorer does indeed open in Code. I also tried assigning EDITOR=code in my bashrc and restarting Hyper. So far it continues to open in Notepad.

I just updated to Hyper 2.0 today, and only recently installed Hyper on my windows machine. I haven't configured or installed plugins yet beyond pointing it at bash instead of powershell/cmd.

Windows 馃槹 Can't Reproduce

All 15 comments

Can you try changing the default program to something else and then back again?

Tried it, changed to Atom... opened in Atom... Changed back to Code and it opened in Notepad again...
strange, any ideas? Something about being assigned to Code seems to confuse it?

Are you changing them in the same way?

Yes, this test was done by right clicking .hyper.js, properties, click change for the editor type, choose new editor. Repeated that for Atom and then for Code. Relaunched Hyper inbetween.

I have exactly the same issue. I followed the steps @albinekb and had the same result as OP.

@jfro I am using the Insiders version of VS Code, I don't know if you are too?

Nope, regular release version.

I'm looking in Windows registry at this key: \HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.js\UserChoice. When Notepad++ is the default editor then ProgId has the data: notepad++.exe. When VSCode is the default editor, ProgId has the data: vscode.js. I'm guessing this is a reference to this key: HKEY_LOCAL_MACHINE\SOFTWARE\Classes\VSCode.js and not to an executable, but I can't find Microsofts documentation for these keys.

In Hyper's code in the file \app\config\open.js:48, the method hasDefaultProgramConfigured reads the UserChoice key from registry and iterates trough all the values and their data, returning false if the data is WScript.exe or isn't an executable:

value.endsWith('.exe') && !value.includes('WScript.exe')

So if VSCode.js is the default ProgId then hasDefaultProgramConfigured returns false and notepad opens instead. Is there a reason the code checks for .exe?

+1 Have the exact same issue as @jfro as well, followed all the suggested steps as well. Also using vanilla Hyper 2.0.0 with the latest version of VSCode (v 1.26.1)

I can reproduce this reliably on Hyper 3, Canary 8 on Windows 10.

Let me know if you need any debug info from my registry or anything else.

I can reproduce as well. Actually came across this issue trying to find a solution as I'm having this problem too.

Please add a preference setting to be able to override the editor using the config in .hyper.js

Following the information provided by @emptyother above, I opened regedit.exe, browsed to Computer\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.js, added a new Key UserChoice, added a new string value ProgId, and set the value to Code.exe. Now hyper opens .hyper.js in vscode

Did this actually get fixed? AFAICT it didn't and Hyper will still not open the default editor.

does not need a change in Hyper, if your system gets your default wrong, there is little we can do. it works just fine here.

@mikemaccana Check your Computer\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.js\UserChoice key in registry editor. It should contain a Progid value with the data VSCode.js or Applications\Code.exe.

Whichever of them it is, that key must exist in either Computer\HKEY_CURRENT_USER\Software\Classes\ or Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.

Using "Open with.." sets the ProgId to VSCode.js and I guess it relates to a (relatively) new way of handling document icons because there is another VSCode.* key for every extension that vscode supports.

If your registry keys differ from this, post them and maybe we can find out why it fails.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

aem picture aem  路  3Comments

rauchg picture rauchg  路  3Comments

ghost picture ghost  路  3Comments

yvan-sraka picture yvan-sraka  路  3Comments

cilice picture cilice  路  3Comments