adamwathan / sublime-phpunit

Run individual unit test files directly from Sublime
281 stars 43 forks source link

Support for Hyper #18

Closed pimpeters closed 6 months ago

pimpeters commented 7 years ago

Is there going to be any support for Hyper? Seems like iTerm and Terminal are the only useable terminals at this moment.

c-fitzmaurice commented 7 years ago

Second this, that would be sweeeeet.

davidhemphill commented 7 years ago

Would love to get a PR on this, but not sure what Electron provides as far as scriptability is concerned.

zaknesler commented 6 years ago

Any news on this?

zaknesler commented 6 years ago

Update: So unfortunately, Electron does not support AppleScript, so I am afraid that the solution below is the only thing we have.

So I've been playing around with this, and so far, I have this (excuse the tab indentation):

on runTest(_command)
    tell application "Hyper" to activate

    tell application "System Events"
        repeat until exists window 1 of process "Hyper"
            delay 0.1
        end repeat

        keystroke "k" using {command down}
        keystroke "u" using {control down}

        keystroke _command
        keystroke return
    end tell
end runTest

on run argv
    set _command to item 1 of argv
    runTest(_command)
end run

This waits for Hyper to open before it attempts to run any commands, but the problem is that it requires you to allow Sublime to "control your computer," which is not ideal. I tried to make it work with the current solution for iTerm with no success

screen shot 2018-07-06 at 3 35 04 pm

If anybody here has more experience with AppleScript, we can make this a PR in no time.