path: root/ksh
diff options
authorTom Ryder <tom@sanctum.geek.nz>2017-01-07 00:36:43 +1300
committerTom Ryder <tom@sanctum.geek.nz>2017-01-07 00:36:43 +1300
commit74e2f9f15cd205dc0c04f5e30fe7f1216c752db1 (patch)
tree0d0078e6a91a888e0b5974f008b650066a9221eb /ksh
parentMerge branches 'port/bsd/*' (diff)
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.
Diffstat (limited to 'ksh')
1 files changed, 3 insertions, 14 deletions
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
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'