-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CTRL+U incorrect behaviour #115
Comments
That's not entirely correct - this is an expected default behavior in readline only and you're probably using libedit (you can check readline_info() output to make sure). In libedit, by default, Ctrl-U deletes entire line (as long as you're in emacs mode). Ctrl-W deletes all before cursor in libedit (in readline, Ctrl-W removes a word before cursor). You can also re-map Ctrl-U to delete everything before the cursor by adding the following to your ~/.editrc : |
Actually I was referring to bash conventions but thanks for the information. It's too bad boris can't use bash. |
The thing is bash itself does not provide any of the line-editing/history capabilities. Instead, it leverages a library which manages all of that - readline. The conventions (keyboard shortcuts) you're referring to - are actually readline conventions. Due to the fact readline is GPL-licensed, a number of alternative interface-compatible libraries have been developed for those wishing to remain under less permissive license (with libedit (BSD licensed) being the most widespread I believe). Others just choose to implement their own line-editing libraries (like Haskelline in Haskell or ZLE in ZSH). Back to php and boris - boris relies on php's readline extension capabilities which in turn can be compiled with either readline or libedit libraries support. I believe in Debian-derivatives you'd mostly find php-readline package to be linked to libedit (as opposed to RHEL and CentOS - they link php5-readline to libreadline) - this is what I meant by "you're probably using libedit". All in all, boris doesn't have any control on the underlying line-editing implementation (and thus default keyboard shortcuts) - it all depends on the environment. |
Thanks for the detailed explanation @sserbin, I didn't realize the behavior was platform-dependent. Your suggestion to modify Since you appear so knowledgeable on this topic, do you have a way to fix my one other outstanding complaint about the [delete] key not working as expected? (#116) |
CTRL+U is supposed to remove characters before the cursor. Instead, it removes all characters. NB: CTRL+K works correctly by only deleting characters after the cursor.
The text was updated successfully, but these errors were encountered: