aicommits icon indicating copy to clipboard operation
aicommits copied to clipboard

fix: Update cli to exit with force-0 on completion

Open wadabum opened this issue 2 years ago • 6 comments

without terminal "hangs" after selecting "NO" on a generated commit

wadabum avatar Feb 22 '23 07:02 wadabum

Based on the code, this shouldn't be necessary. I can only imagine it happening if a dependency has left some async/open handles (e.g. clack).

Do you know how I can reproduce it? What OS?

privatenumber avatar Feb 22 '23 07:02 privatenumber

Sure, @privatenumber "git-for-windows" - so bash.exe, mingw64 geshizzle 😈

Broken:

-> "to get it to move on" it needs an extra-enter press there after i typed to the void

Fixed:

wadabum avatar Feb 22 '23 07:02 wadabum

I investigated this and it seems like it's a problem with openai.createCompletion(). I didn't investigate further but it seems to be leaving a handler open somewhere.

Honestly, the dependency was too large so I was considering removing it anyway. Will remove it and that should fix this.

privatenumber avatar Feb 22 '23 09:02 privatenumber

Any plans on the timescale for that? ((I got no clue how much work that may entail... 😁))

But potentially I would pack up a "windows" branch then with this remedy to bridge...

wadabum avatar Feb 22 '23 10:02 wadabum

Probably tomorrow.

privatenumber avatar Feb 22 '23 11:02 privatenumber

I investigated further and I think it's actually a deeper issue in readline: https://github.com/nodejs/node/issues/31762#issuecomment-1441223907

privatenumber avatar Feb 23 '23 05:02 privatenumber

seems that is the case yep (I didn´t further crosspost here as I had noticed you to be active on both ends ;D)

and can confirm, "@clack/prompts": "^0.2.2", -> "@clack/prompts": "^0.6.0", fixes it.

closing this PR - (and I assume you dont need a fresh one for that oneliner ;-) ) Thanks for investigating and fixing!

wadabum avatar Feb 25 '23 04:02 wadabum