csvq icon indicating copy to clipboard operation
csvq copied to clipboard

terminal navigation: supporting more common key combinations

Open dtgoitia opened this issue 1 year ago • 2 comments

Hi!

I find this tool super useful, so thank you for creating it!

I see there is support for common keyboard combinations, like Ctrl+L. Is there any chance to support other common combinations?

keys action
Ctrl + left arrow move the cursor to one word backwards
Ctrl + right arrow move the cursor to one word forward
Home move the cursor to the line start
End move the cursor to the line end
Ctrl + W delete the previous word

I'm happy to contribute if you point me to the right place (sorry, Go noob here). I've had look around lib/terminal, but I'm not sure where the keystrokes are handled.

Thank you so much in advance!

dtgoitia avatar May 09 '24 10:05 dtgoitia

Interactive shell use https://github.com/chzyer/readline. And here is a list of available shortcuts: https://github.com/chzyer/readline/blob/master/doc/shortcut.md

I can't say what I will do about that in the future, since it depends on external libraries, but I will keep your request in mind.

mithrandie avatar May 12 '24 19:05 mithrandie

Oh, I see! Thanks for sharing the shortcuts, and for keeping the request in mind.

dtgoitia avatar May 12 '24 20:05 dtgoitia