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

API for launching hyper in specific directory #4004

Closed
2 tasks done
sarsamurmu opened this issue Nov 24, 2019 · 4 comments
Closed
2 tasks done

API for launching hyper in specific directory #4004

sarsamurmu opened this issue Nov 24, 2019 · 4 comments

Comments

@sarsamurmu
Copy link

  • I am on the latest Hyper.app version

  • I have searched the issues of this repo and believe that this is not a duplicate

  • OS version and name: Windows 10 Pro

  • Hyper.app version: 3.0.2

Issue

Are there any API which I can use to launch hyper in specific directory, so I can build a plugin for atom which launches hyper in the choosen directory.

@ppot
Copy link
Contributor

ppot commented Nov 24, 2019

Answer is based on your issue number 4004 ->404 Not available.

In fact, We dont't pas cli args to the executable. So no it's unfortunately not possible. But you can use things like hyper-profile or so or implement your own and invoke the "cd yourDesiredDirParam" and move to it after start.

@Haprog
Copy link

Haprog commented Jan 9, 2020

This is the issue that most annoys me with Hyper. Otherwise I like to use Hyper as my terminal on Windows (I've also configured Hyper to open wsl.exe automatically) but I'd like to be able to launch it in a way that would automatically open a specific directory especially so that I could use it as an integration in some IDEs to quickly launch Hyper in the project directory that I'm working on.

For example I use Fork to manage my Git repositories and it has a toolbar button "Console" which opens a terminal in the directory of the currently open repository. By defaul this launches Command Prompt (cmd) but Fork can be configured to open Windows Terminal, PowerShell or any custom executable instead and it passes the working directory as a parameter to it, but it's very sad that I can't use Hyper here properly because I can't make Hyper open the correct directory automatically and would need to manually navigate to the repository directory every time.

Related: fork-dev/TrackerWin#608 (comment)

@Haprog
Copy link

Haprog commented Jan 9, 2020

Can there be some workaround for this atm?

Is it possible to create a wrapper script or executable which would launch Hyper, and then when Hyper is open it would make it cd into a specific directory? Then that directory could just be given as a parameter to the wrapper and I would probably be able to use that as a custom shell executable in Fork to have it work like I want.

Any tips on how this could be accomplished (if possible)?

@Tolgor
Copy link

Tolgor commented May 25, 2020

I had the same issue.

C:\Users>where hyper
C:\Users\kstru\AppData\Local\hyper\app-3.0.2\resources\bin\hyper
C:\Users\kstru\AppData\Local\hyper\app-3.0.2\resources\bin\hyper.cmd

hyper.cmd is the command registered when you type "hyper".
In the hyper.cmd, the set ELECTRON_RUN_AS_NODE=1 seems to cause some issues on Windows.
I edited the hyper.cmd:

@echo off
setlocal
REM set ELECTRON_RUN_AS_NODE=1
REM call "%~dp0..\..\Hyper.exe" "%~dp0..\..\resources\bin\cli.js" %*
call "%~dp0..\..\Hyper.exe" %*
endlocal

And now for "opening" Hyper in specific directory:

C:\Users>hyper c:\my_directory

Disabling the ELECTRON_RUN_AS_NODE=1 may have some side effects, still, this works for me.
Hope this helps.

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

4 participants