From 74e2f9f15cd205dc0c04f5e30fe7f1216c752db1 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sat, 7 Jan 2017 00:36:43 +1300 Subject: Tolerate C-M-l for clear window in ksh Already works in ksh93 and mksh. Trapping C-l in ksh93 interferes with the builtin SIGWINCH handling, clearing the screen every time the window resizes, and I can't find a good way to work around it. Probably best not to fight this. --- ksh/kshrc.d/bind.ksh | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) (limited to 'ksh') diff --git a/ksh/kshrc.d/bind.ksh b/ksh/kshrc.d/bind.ksh index 34cb5f5a..a1999731 100644 --- a/ksh/kshrc.d/bind.ksh +++ b/ksh/kshrc.d/bind.ksh @@ -1,28 +1,17 @@ -# Try to bind ^I to complete words and ^L to clear the screen +# Try to bind tab to complete words and Ctrl-Alt-L to clear the screen +# Already done in ksh93 case $KSH_VERSION in - # ksh93 is lovely, but complex; rebind ^L so it does the same as Alt-^L - *'93'*) - keybd_trap() { - # shellcheck disable=SC2154 - case ${.sh.edchar} in - $'\f') .sh.edchar=$'\e\f' ;; - esac - } - trap keybd_trap KEYBD - ;; - # More straightforward with mksh; bind keys to the appropriate emacs mode # editing commands *'MIRBSD KSH'*) bind '^I'='complete' - bind '^L'='clear-screen' ;; # Similar with pdksh; there's a "complete" command, but not a "clear" one, # so we fake it with clear(1) and some yanking *'PD KSH'*) bind '^I'='complete' - bind -m '^L'='^Uclear^J^Y' + bind -m '^[^L'='^Uclear^J^Y' ;; esac -- cgit v1.2.3