What you termed "navigation" is part of line-editing.
If you're using ksh
, the way to best use its line-editing capabilities is to turn on emacs mode:
set -o emacs
Apparently ksh's developer doesn't use vi
, because the vi-mode is very limited. However, emacs
mode is the default.
In your question, the cursor-keys are in normal mode (the ^[[
characters), which is assumed if TERM=linux
, while other terminals conventionally use application mode (^[O
characters). If your TERM
is set incorrectly, that might confuse ksh
. Some people define aliases in their shell initialization to make the shell work with either.
See for example Make Arrow and delete keys work in KornShell command line. The solutions in that answer should work for you, since RHEL6 (and CentOS6) use ksh-93:
Name : ksh Relocations: (not relocatable)
Version : 20120801 Vendor: CentOS
Release : 28.el6_7.3 Build Date: Tue Sep 22 11:08:59 2015
Install Date: Mon Mar 28 16:22:50 2016 Build Host: c6b9.bsys.dev.centos>
Group : System Environment/Shells Source RPM: ksh-20120801-28.el6_7.3>
Size : 1743023 License: EPL
Signature : RSA/SHA1, Tue Sep 22 14:35:03 2015, Key ID 0946fca2c105b9de
Packager : CentOS BuildSystem <http://bugs.centos.org>
URL : http://www.kornshell.com/
Summary : The Original ATT Korn Shell
Description :
KSH-93 is the most recent version of the KornShell by David Korn of
AT&T Bell Laboratories.
KornShell is a shell programming language, which is upward compatible
with "sh" (the Bourne Shell).
Further reading:
- 2.1 Enabling Command-line Editing (Learning the Korn Shell)
- Command Line Editing in Bash and Ksh notes
Some actions are also bound to keys with special markings, eg: Up Arrow, Del (or Delete). These are also shown where applicable. Note that these might not work if the terminal emulation is incorrect, ksh
does not support them as well as does bash
.