CWSpear / hyperterm-visor

Open your Hyper terminal from anywhere with a global hotkey.
MIT License
165 stars 24 forks source link

Hotkey doesn't work after waking from sleep #15

Closed Qard closed 7 years ago

Qard commented 8 years ago

I've noticed that the hotkey seems to not work anymore after waking OSX from sleep. The other hotkeys in hyperterm for stuff like interacting with tabs still work, so I think it has something to do with how hyperterm-visor is setting up the hotkey bindings.

ericclemmons commented 8 years ago

I was wondering if I was the only one! Is this something fixable by the author or something we'd be able to test/fix in the community?

CWSpear commented 7 years ago

Is there a way you can more consistently reproduce this? I tried shutting my laptop for a while and opening it back up, and I also tried Apple Menu > Sleep, but the hotkey was working after both of those.

I have seen this very occasionally, so I do think something fishy is going on, but it doesn't appear to be triggered by sleep (or at least not by only going to sleep...).

Either way, finding a consistent cause will definitely help in debugging.

philwade commented 7 years ago

I've been seeing this about once a day during my work day, so far have been unable to figure out a consistent way to reproduce. Seems to happen after being idle as well.

I left open developer tools to try and catch something when it happens, no errors or anything 😞

dieggsy commented 7 years ago

I've noticed the same issue. I can't quite pinpoint what it is, but the hotkey definitely stops working for me every so often.

dcalhoun commented 7 years ago

From my experience, hyperterm-summon does not suffer from this issue. I know it utilizes hyperterm-register-shortcut (a library created by the same author).

It may be worth exploring using hyperterm-register-shortcut for hyperterm-visor or, at the very least, comparing the approaches used to bind the global shortcut.

Hope this helps some. 😊

philwade commented 7 years ago

it looks like hyperterm-register-shortcut uses the same mechanism, namely: const { globalShortcut } = require('electron');

Although it is called a little different: https://github.com/soutar/hyperterm-register-shortcut/blob/master/index.js#L10 vs https://github.com/CWSpear/hyperterm-visor/blob/master/visor.js#L34

philwade commented 7 years ago

Just to see if it will resolve the issues, I implemented hyperterm-register-shortcut on this branch: https://github.com/philwade/hyperterm-visor/tree/try-hyperterm-register-shortcut

It would still need cleanup to get released, but if some people experiencing this issue could test and see if it fixes things, that would be handy.

Note: This branch requires you to add a different config setting for the hotkey

config: {
    hotkeys: {
        hotkey: 'CommandOrControl+Z',
    }
}
RTSchriner commented 7 years ago

@philwade: Testing it now! I'll let you know if I continue to have issues. Thanks for your work! 👍

RTSchriner commented 7 years ago

@philwade: I haven't had any issues yet. Seems to be working.

philwade commented 7 years ago

@RTSchriner cool, I haven't either, going to test it out again for the rest of today and if everything looks good I'll clean it up and put together a PR

You were able to figure out the new config setting even though I failed to put it my original comment? 🙃

RTSchriner commented 7 years ago

@philwade Hmmmm... config setting!? 🙃 Haha If I did it was accidental.

Note: Your fix is still working great! Great work! 👍

CWSpear commented 7 years ago

Released on npm as v0.3.2.

Special thanks to @philwade for the fix and thanks to the rest of you for help testing and stuff!

CWSpear commented 7 years ago

The people in this thread has been especially helpful... think I could get your help with a non-sleep issue?

Need help testing the new anchor (replaces position) option in the forthcoming 1.0: https://github.com/CWSpear/hyperterm-visor/issues/5#issuecomment-295996253

revelt commented 7 years ago

I can confirm it is still happening (as has been since the beginning). The scenario is simple, after the day I drag the mouse to activate one of the hotcorners on my screen to put display to sleep. Next morning the visor's shortcut does not work any more, I have to restart Hyper, then all is ok again. Visor always works until I put display to sleep, after that Hyper's restart is needed.