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-w should delete a word instead of a whole line #3
Comments
This appears to be a difference between editline and readline. Editline:
—https://www.daemon-systems.org/man/editline.7.html Readline:
—https://www.gnu.org/software/bash/manual/html_node/Commands-For-Killing.html#Commands-For-Killing You should be able to fix it for not just Cockroach but all editline based programs with a config like
|
This doesn't appear to work. I made that my |
It definitely works for me. Dumb question: you restarted the Cockroach shell after changing editrc, right? |
Yup. And tried putting .editrc in the same directory as the binary. Dunno. |
Happy to take a look with you if you'd like. Somehow I feel like it's related to your Linux setup. The next step is to put a bare
If you don't see anything like that, strace'ing the shell would be illustrative. |
In order to source ~/.editrc, libedit looks up the value of the HOME environment variable using secure_getenv. Previously, because HAVE_SECURE_GETENV was not defined when compiling libedit on Linux, libedit would be unable to lookup HOME and give up on sourcing ~/.editrc. Defining HAVE_SECURE_GETENV fixes the problem, but only with glibc. Musl does not provide a secure_getenv function. Work around that by providing a shim implementation of secure_getenv for musl that uses the issetugid function instead. Compilation against a non-glibc library that does not provide issetugid will fail. I don't think it's possible to fix this (i.e., compiling but refusing to lookup HOME at runtime) while continuing to compile libedit with cgo, though. Fix #3.
In order to source ~/.editrc, libedit looks up the value of the HOME environment variable using secure_getenv. Previously, because HAVE_SECURE_GETENV was not defined when compiling libedit on Linux, libedit would be unable to lookup HOME and give up on sourcing ~/.editrc. Defining HAVE_SECURE_GETENV fixes the problem, but only with glibc. Musl does not provide a secure_getenv function. Work around that by providing a shim implementation of secure_getenv for musl that uses the issetugid function instead. Compilation against a non-glibc library that does not provide issetugid will fail. I don't think it's possible to fix this (i.e., compiling but refusing to lookup HOME at runtime) while continuing to compile libedit with cgo, though. Fix #3.
@benesch I have tried your |
The |
This works now. |
Pressing ctrl-w deletes a line (which I expect from ctrl-u) instead of a word. Is this intended? If not can it be changed to be a word only? It makes fixing a bad word much more annoying, as I usually delete the entire line due to muscle memory.
The text was updated successfully, but these errors were encountered: