I found this helpful command bind -x '"\C-r"':reset
to clear the terminal but I wanted to make a simple bash script:
#!/bin/bash
bind -x '"\C-r"':reset
output:
alfred@alfred-laptop:~/bash$ ./bind
./bind: line 2: bind: warning: line editing not enabled
Could someone please explain:
- How can I fix this?
- What does
warning: line editing not enabled
mean?
Best Answer
You need to source that script. Do
. ./bind
orsource ./bind
to make that key binding active in the current session.Running it normally, it doesn't have a terminal so it gives you that error message. Also, if it were to work, it would only be active for the duration of the script.
If you want that keybinding to be persistent, add that command to your
~/.bashrc
.