j178 / chatgpt

An elegant interactive CLI for ChatGPT
728 stars 54 forks source link

add basic actions like Ctrl + Arrows #16

Closed Goosegit11 closed 1 year ago

Goosegit11 commented 1 year ago

Ctrl + Up: your last sentence Ctrl + Left: move one word to the left Ctrl + Right: move one word to the right

Goosegit11 commented 1 year ago

I see that you can use Ctrl + A to get to the beginning of the line and Ctrl + E to get to the end of the line.

Does this have something to do with the shell?
it would be nice to integrate shell functions into the program, I already have Ctrl + Arrows configured in my shell

j178 commented 1 year ago

Text input relies on the textarea implementation of bubbletea, which comes with built-in support for some shortcut keys: https://github.com/charmbracelet/bubbles/blob/78a82d1616ddfab1d47c7c9051926b900e9e4017/textarea/textarea.go#L62-L87

it would be nice to integrate shell functions into the program

It can be a bit challenging to implement using Bubble Tea, perhaps you could try https://github.com/diemus/chatgpt.

Goosegit11 commented 1 year ago

perhaps you could try https://github.com/diemus/chatgpt.

it's cool, but it too doesn't have ctrl + arrows functionality :-(

j178 commented 1 year ago

@goosegit11 Hi, this ctrl+up and ctrl+down shortcuts are supported in #19 .