aandrew-me / tgpt

AI Chatbots in terminal without needing API keys
GNU General Public License v3.0
2.04k stars 171 forks source link

tab for submit query in multiline mode isn't the best choice. #248

Closed ardabro closed 5 months ago

ardabro commented 7 months ago

I think that a configuration file with keyboard shortcut definitions would be the best option, but anyway, TAB for submitting a query isn't the best choice. A programmer hits TAB compulsively and frequently to format code and it inevitably leads to incomplete, useless queries. What about ctrl+Enter?

aandrew-me commented 7 months ago

Fair point, if its possible, I will change it to Ctrl + Enter

aandrew-me commented 7 months ago

Ctrl+ Enter is not an available option :( https://github.com/charmbracelet/bubbletea/issues/927#issuecomment-1944539893

ardabro commented 7 months ago

Hm... what about a command? like: go!<enter> or even only !<enter but only at the beginning of new line? So the sequence would be: <enter>!<enter>

aandrew-me commented 7 months ago

Doesn't sound very reasonable to me

schnz commented 7 months ago

From a semantic standpoint, Ctrl+D (while cursor is placed at the very end in a new line) would be the most reasonable shortcut. It would be perfectly reasonable in the context of the Emacs bindings that bubbletea seems to support out of the box (e.g. Ctrl+A to go to the beginning of the line, etc.). When I first tried tgpt that was the shortcut that I tried first after realizing that in multiline mode "ctrl+enter" doesn't work.

This also would allow to manually paste texts (while in input mode) that contains a Tab character.

aandrew-me commented 5 months ago

From a semantic standpoint, Ctrl+D (while cursor is placed at the very end in a new line) would be the most reasonable shortcut. It would be perfectly reasonable in the context of the Emacs bindings that bubbletea seems to support out of the box (e.g. Ctrl+A to go to the beginning of the line, etc.). When I first tried tgpt that was the shortcut that I tried first after realizing that in multiline mode "ctrl+enter" doesn't work.

This also would allow to manually paste texts (while in input mode) that contains a Tab character.

I will change it to Ctrl + D