Adding Ctrl-L as "clear" hotkey in OpenBSD's ksh

According to the OpenBSD ksh man page, Ctrl+L is bound to redraw.

 redraw: ^L
         Reprints the prompt string and the current input line.

If that isn't sufficient, I can't see any editing command that will help, so I would suggest learning more about bind -m.

Perhaps you can do something like bind -m '^L'=clear'^J' to make it type clear Enter.


You should be able to add an alias to your .kshrc to do this. Try

alias "^L"=clear

Where ^L is the single char Ctrl-L. You might not need the quoting, if it still doesn't work the last resort would be to escape it like (what you are typing, not what will be visible in your file) Ctrl-VCtrl-L→clear.

IHTH