Hyper: Open Hyper in Current Folder (macOS)

Created on 25 May 2017  路  10Comments  路  Source: vercel/hyper

I have been a long time user of hyper on windows, but I have recently switched to mac and have found no clear method to launch a hyper terminal from a folder. This then leads to a tedious process of having to "cd" to the specified folder. Is there a feature that does this that I am missing or has it not been implemented yet? Other than that, the terminal works great.

Thank You.

Question

Most helpful comment

IMO just put the workflow file from this archive to your ~/Library/Services folder and then use this service in keyboard preferences to bind a shortcut.
But this will open a tab for selected folder, not the current one. Similar to default Terminal services.
New Hyper Tab at Folder.workflow.zip

All 10 comments

@IanCarrasco Unfortunately, at the moment you can't set cwd for that matter. Hyper wont open at the specific cwd. You can see if some plugins have that specific feature.

Example of such plugins: https://github.com/hharnisc/hypercwd

Can one make an automator service that calls hyper with specific arguments? I've seen this done for other terminals like iTerm2 - https://gist.github.com/pdanford/158d74e2026f393e953ed43ff8168ec1. This would make it possible to access terminal via right click. See: Mac preferences > keyboard > services

In fact, it is possible to create an instance of hyper with a different starting directory programmatically. See: https://github.com/htkoca/cdto or https://github.com/ealeksandrov/cdto

In macOS you can just type "cd <-drag folder here>" and it will insert the correct path, this is the "mac" way of doing things, you can drag any folder/icon in finder and it should work :)

See http://osxdaily.com/2014/08/20/open-files-new-app-proxy-icon-mac-os-x/ for more info about how this works. Search term is proxy icon

It's a good solution 馃憤 but doesn't address exactly what this issue is about.

Guys I finally solved it. Here is a guide I made to implement the solution. https://gist.github.com/IanCarrasco/60364134e2649fb0d94751b7a04f25b1

We can potentially skip using cd_to by just executing: open '/path/to/hyper' '/path/to/current/directory' in apple script's syntax. Not fluent in applescript but it should be possible !

Or something like this - from: https://gist.github.com/pdanford/158d74e2026f393e953ed43ff8168ec1:

on run {input, parameters}
    tell application "Finder"
        set dir_path to quoted form of (POSIX path of (folder of the front window as alias))
    end tell
    CD_to(dir_path)
end run

on CD_to(theDir)
    tell application "hyper"
        activate
        set win to (create window with default profile)
        set sesh to (current session of win)
        tell sesh to write text "cd " & theDir & ";clear"
    end tell
end CD_to

IMO just put the workflow file from this archive to your ~/Library/Services folder and then use this service in keyboard preferences to bind a shortcut.
But this will open a tab for selected folder, not the current one. Similar to default Terminal services.
New Hyper Tab at Folder.workflow.zip

In Hyper I type: pwd|pbcopy, press 鈱楾, then cd + 鈱榁. Takes about 3 seconds, but I realize it's a workaround.

IMO just put the workflow file from this archive to your ~/Library/Services folder and then use this service in keyboard preferences to bind a shortcut.
But this will open a tab for selected folder, not the current one. Similar to default Terminal services.
New Hyper Tab at Folder.workflow.zip

Love you brother

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cristian-sima picture cristian-sima  路  51Comments

amilajack picture amilajack  路  48Comments

xscheiner picture xscheiner  路  73Comments

keirlawson picture keirlawson  路  45Comments

indutny picture indutny  路  46Comments