8

I want to use home, end, delete, pageup, pagedown with ksh. My TERM is xterm-color. These keys works fine with tcsh and zsh, but not with ksh (print a tilde ~)

I found this:

bind '^[[3'=prefix-2
bind '^[[3~'=delete-char-forward
bind '^[[1'=prefix-2
bind '^[[1~'=beginning-of-line
bind '^[[4'=prefix-2
bind '^[[4~'=end-of-line

But when I set one bindkey, the last does not work anymore.

How can I use these keys in ksh with a .kshrc ?

Thanks.

Dennis Williamson
  • 346,391
  • 90
  • 374
  • 439
Nicolas
  • 81
  • 2

2 Answers2

1

Have you got the EDITOR or VISUAL variables set? If not, that may be the way forward.

  EDITOR=vi

may be sufficient.

martin clayton
  • 76,436
  • 32
  • 213
  • 198
  • or `EDITOR=emacs`. Either way you can put that in your `~/.kshrc` file – Dennis Williamson Oct 13 '09 at 00:21
  • Copied from *Nicolas*' comment incorrectly posted as an answer: "with `EDITOR=vi` , home, end, delete, pageup, pagedown does not print a tilde ~ (but does not work). Moreover, I do not like vi EDITOR. On the other hand, with `EDITOR=emacs`, the problem is the same. These keys does not work, and print a tilde ~." – agc Sep 04 '17 at 20:45
0

You can start with -o emacs or do set -o emacs on run-time within the shell, then issue bind to list the key bindings.

Other options for key bindings apart from are gmacs and vi.

Read more in: ksh(1).