karthink / gptel

A simple LLM client for Emacs
GNU General Public License v3.0
1.28k stars 128 forks source link

Cursor is stuck in transient menu #157

Closed karthink closed 9 months ago

karthink commented 9 months ago

Hello @karthink,

I'm sorry I don't have more detailed information, but I'm still experiencing the bug described in this issue, even after updating both gptel and transient to the latest commits from their main branches. Specifically, after pressing h twice to edit the prompt, the cursor remains stuck in the menu, necessitating a manual C-g command to exit. Post-exit, I can edit the prompt buffer and confirm with C-c, and everything functions normally.

Additionally, a similar issue occurs when selecting a crowdsourced prompt: after choosing one, the text loads into the prompt buffer for editing, but the focus remains on the menu. Again, I have to manually kill the transient menu to shift focus to the prompt buffer, edit the prompt, and save it with C-c to return to the main menu of gptel-menu.

Please let me know if there's any more data I can provide to assist in diagnosing this issue.

Best regards.

Originally posted by @kofm in https://github.com/karthink/gptel/issues/140#issuecomment-1869638987

karthink commented 9 months ago

@kofm Could you check a few things?

  1. Transient version (M-x find-library transient, look at the header of the file)
  2. Does this happen when you use Transients provided by any other package? (like magit, for example)
  3. Does this happen if you install gptel in Emacs without customization? (Using emacs -q or emacs --init-directory=/tmp/emacs-test)
meain commented 9 months ago

I am also running into the same issue. Emacs built from source in last week (version reported as 30.0.50). Transient version 0.5.3(installed from melpa). I can repro with with emacs -q as well. The system prompt for refactor, which makes you edit in the minibuffer seems to work fine though.

karthink commented 9 months ago

I can repro with with emacs -q as well.

Does it happen with Magit (or some other feature that depends on Transient) as well?

karthink commented 9 months ago

I updated the package (5470e06) to try to address this. Please give it a try (with emacs -q) when you can.

kofm commented 9 months ago

Hey,

thanks for the time and effort to address this.

  1. Transient: ;; Package-Version: 0.5.3
  2. Magit seems fine; if I try, e.g. to commit the transient menu close and the focus move in the commit msg buffer
  3. It works now (! 🎉) with the last commit. However, the crowdsourced prompts menu still has the same problem I described.
karthink commented 9 months ago

However, the crowdsourced prompts menu still has the same problem I described.

Should be fully fixed now (6e604b2c). This fix introduced a side-effect: quitting the completing-read when selecting a crowdsourced prompt will quit the menu entirely. But I'm guessing this is a better alternative to the current behavior.

goofansu commented 9 months ago

@karthink Upgraded to 20231226.2238, it works perfectly, thank you.

https://github.com/karthink/gptel/assets/1143191/9ba6f7d1-483b-41d2-88c2-9c15eeff00a7

karthink commented 9 months ago

@goofansu Thank you for testing! I'll close this now.

If anyone is still experiencing this issue, feel free to re-open.

kofm commented 9 months ago

Works perfectly. Thank you very much for your help and for creating this fantastic package.