Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Weird behaviour when opening config on Windows #1529

Closed
2 tasks done
Stanzilla opened this issue Feb 16, 2017 · 21 comments
Closed
2 tasks done

Weird behaviour when opening config on Windows #1529

Stanzilla opened this issue Feb 16, 2017 · 21 comments

Comments

@Stanzilla
Copy link
Collaborator

Stanzilla commented Feb 16, 2017

  • I am on the latest Hyper.app version
  • I have searched the issues of this repo and believe that this is not a duplicate

Issue

hyper_2017-02-16_19-10-00

When opening the config, a new tab is opened and gets a lot of echos, is this the correct behaviour? From the text it is looking like it's failing a few times but notepad is actually opened.

Should opening the config even spawn a new tab at all?

@Stanzilla Stanzilla changed the title Opening config on Windows Weird behaviour when opening config on Windows Feb 16, 2017
@stefanivic
Copy link
Contributor

stefanivic commented Feb 17, 2017

@Stanzilla you are opening the config using the Bash, that's why it only echoes the text as start notepad is not a valid bash command. Your best option is to manually go to c:\Users\yourUser\.hyper.js and edit it.

@jonathanrdelgado
Copy link

Looks like #1510 reverted the previous windows fix for this.

@stefanivic
Copy link
Contributor

@jonathandelgado it wasn't really a fix, it just opened the directory instead of directly opening the editor. I am trying to find a better fix as we speak.

@Stanzilla
Copy link
Collaborator Author

@stefanivic it does that with cmd as well
hyper_2017-02-20_00-47-17

@Stanzilla
Copy link
Collaborator Author

Can the process of trying to open it be done in background though? Also the echo, currently looks like a debug print left there by accident, if you ask me :D

@stefanivic
Copy link
Contributor

@Stanzilla We got this merged : 36f96ab So now, it will check which shell you are runing and open with coresponding option. The echo is there just to notify you what is going on, but i will look into it, how we can make it nicer...

@MartyGentillon
Copy link
Contributor

Related: #901

@MartyGentillon
Copy link
Contributor

Of course, that doesn't work with powershell, which has a different syntax for environment variables ($Env:variableName).

Also, notepad?? it can't make sense of Unix style line endings, which is the default for the preferences file. It might make sense to look that up from the configuration (or environment)

@albinekb
Copy link
Contributor

@MartyGentillon the line-ending issue was fixed with #1713

@Stanzilla
Copy link
Collaborator Author

My main gripe with this was the echo anyway, so if we could make the settings open without any echo or new tab spawning, that would be great

@albinekb
Copy link
Contributor

Yes I think that would be better, use something like https://github.com/sindresorhus/opn ?

@stefanivic
Copy link
Contributor

I don't think we really need any addition library to solve this, you can remove the echo frome the code and still have it working. But to be honest i think the best option would be to replace the echo and have a notification pop up.

@chabou
Copy link
Collaborator

chabou commented Apr 14, 2017

I think opn is a good solution. With this, editing config directly uses an OS feature and do not depend on a shell/term feature.

@MartyGentillon
Copy link
Contributor

@albinekb The line endings are only one of very many reasons to dislike the choice of notepad when other editors are available. Roughly speaking, the editor should be controllable either though the editor environment variable or configuration.

As for using a library rather than the shell, vastly simplifies the logic and error proofs the solution. Suddenly there is no need for a "which shell are you running" guessing game to decide how to include the environment variable.

@MartyGentillon
Copy link
Contributor

Alternately, Gordon's solution is interesting:

#1736

@chabou
Copy link
Collaborator

chabou commented Apr 18, 2017

Another reason to launch editor with node/lib: #417

@MartyGentillon
Copy link
Contributor

One other advantage of the library approach: it works even when you have sshed into another machine.

@Stanzilla
Copy link
Collaborator Author

Stanzilla commented May 1, 2017

Is this even remotely correct? It works fine on WIndows Stanzilla@12ffb17

(first timer here)

@chabou
Copy link
Collaborator

chabou commented May 3, 2017

Ok guys, I found a solution: https://github.com/electron/electron/blob/master/docs/api/shell.md#shellopenitemfullpath

We don't need a lib, Electron will do it for us :)
Thank you @Stanzilla for your PR, it helps me to think about it.

@chabou
Copy link
Collaborator

chabou commented May 3, 2017

Another reason to launch native editor: https://zeit-community.slack.com/archives/C1TMVKPFH/p1493735061557196
Some people doesn't know how to save.

@MartyGentillon
Copy link
Contributor

Not to mention that not all systems come with nano....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants