troglobit / editline

A small replacement for GNU readline() for UNIX
https://troglobit.com/projects/editline/
Other
282 stars 58 forks source link

How to bind Ctrl + W to delete word backwards? #11

Closed k0pernikus closed 7 years ago

k0pernikus commented 7 years ago

I am using the mysql client from which comes with editLine in my distribution:

$ mysql --version
mysql  Ver 14.14 Distrib 5.7.17, for Linux (x86_64) using  EditLine wrapper

I would not mind if it was a in-place replacment behaving similar to readline. Yet certain emac-like keybindings from readline, I am very much used to, don't work anymore, breaking my habitual workflow.

I am very much used to delete the last word by Ctrl + W. Yet via editline, it deletes to the beginning of the line instead just one word back.

I tried adding .editrc with the content:

bind ^W backward-delete-word

Yet it doesn't work.

How can I bind keys to my liking, and how can I get Ctrl + W to delete one word backwards?

troglobit commented 7 years ago

I'm sorry, but I don't think they use my version of editline. That's the first I've heard of an .editrc, and the fact that mysql doesn't use GNU Readline.

Fascinating how Rich's original usenet posting has spread to so many projects. I must see if I can find some time to integrate mysql's version, at least the best bits, into my own.

Also, I guess it's best anyway to report your issue with mysql rather than me.

troglobit commented 7 years ago

Seems to be the NetBSD derivative, which Jess ported to Linux, http://thrysoee.dk/editline/

k0pernikus commented 7 years ago

As a followup, I switched to mariadb-client, as it's a fork of mysql is built with readline support.

Mysql dropped readline in favor of that other editline due due to licensing reasons, since editline has BSD, readline has GNU GPL. Further details on unix stackexchange