mithrandie / csvq

SQL-like query language for csv
https://mithrandie.github.io/csvq
MIT License
1.48k stars 65 forks source link

terminal navigation: supporting more common key combinations #121

Open dtgoitia opened 1 month ago

dtgoitia commented 1 month ago

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!

mithrandie commented 1 month ago

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.

dtgoitia commented 1 month ago

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