kit icon indicating copy to clipboard operation
kit copied to clipboard

Hotkey causes all shortcuts to fail

Open probablycorey opened this issue 1 year ago • 1 comments

If I run this simple script, it will work the first time by saying "hello". But then it doesn't work anymore. It also causes all my other kit shortcuts to fail.

// Shortcut:  option  h

const keyInfo = await hotkey()
if (keyInfo.hey == 'x') await say("hello")

probablycorey avatar Jun 05 '24 17:06 probablycorey

Thanks for reporting this. A workaround for now:

const keyInfo = await hotkey()
if (keyInfo.hey == "x") await say("hello")

await arg({
  onInit: async () => {
    exit()
  },
})

All Kit's shortcuts pause when they detect a "hotkey" prompt type, then resume on any other prompt type. So adding an arg that immediately exits will force all the shortcuts back on.

I missed this because all of my use cases follow-up on hotkey with another prompt. I'll get it fixed for v3 where the shortcuts resume on submit/exit instead.

johnlindquist avatar Jun 06 '24 17:06 johnlindquist