On Mon, 6 Apr 2009 14:55:12 +1000 Chris <atstake@gmail.com> wrote:
In short, there is *no* default mapping in ksh for PageUp and PageDown.
Surprisingly enough, your shell history, and how it is accessed,
depends, for the most part, on the shell you are using. If you look at
your configuration files for the C shell, ~/.login and ~/.chsrc, in the
first you'll find 'savehist' and in the second you'll find the 'h'
alias for accessing the shell history.
The default shell on OpenBSD is no longer the C Shell, but instead is a
variant of the Korn Shell (ksh). If you take the time to read the man
page for ksh, you'll find that 'history' is just a *default* alias for
the `fc -l` command.
Your main problem is mistaken perception; you are expecting UNIX to
behave like GNU crap (bash/screen/whatever).
If you are running the default system shell, namely ksh(1), you can
access the history, line by line, in two different ways:
1.) The Up-Arrow and Down-Arrow keys
2.) The CTRL-P (Previous, also known as "up-history") and CTRL-N (Next,
also known as "down-history") key combinations.
The ksh(1) man page even details the exact default key bindings used to
make the Up and Down Arrow keys access the shell history.
If you are using ksh, and the above keys/key-combos do not work, then
you have screwed around with the default ksh settings, or you are using
a garbage terminal emulator that is screwing with the key-bindings.
The terminal emulator in XFCE is stupidly named "Terminal" and like all
terminal emulators, has it's own set of quirks, conflicts and
limitations. The "GNU screen" program is terminal multiplexer and has
countless quirks, conflicts and bugs, in addition to a virus license.
Unless you are using the default xterm(1), without modification, it's
nearly impossible to tell what kind of remapping/rebinding your
terminal emulator is doing, assuming it's doing any rebinding/remapping.
None the less, in ksh you can set your own bindings. To get a list of
existing bindings, just run the `bind` command without arguments.
# UpArrow - up-history - works (default)
# ^XA = up-history
$ bind '^[[A'=up-history
# DownArrow - down-history - works (default)
# ^XB = down-history
$ bind '^[[B'=down-history
# RightArrow - forward-char - works (default)
# ^XC = forward-char
$ bind '^[[C'=forward-char
# LeftArrow - backward-char - works (default)
# ^XD = backward-char
$ bind '^[[D'=backward-char
These two are useful additions:
# End Key - Goto Last Character In Line - works
# ^XF = end-of-line
$ bind '^[[F'=end-of-line
# Home Key - Goto First Character In Line - works
# ^XH = beginning-of-line
$ bind '^[[H'=beginning-of-line
Unfortunately, I've got no clue what the correct eXtra-key binding is
for the PageUp and PageDown keys. I thought they were either ^XI and
^XG, or ^XJ and ^XK, but both of those combinations are wrong.
# PageUp Key - broken
# ^XI = up-history
# ^XJ = up-history
$ bind '^[[I'=up-history
# PageDown Key - broken
# ^XG = down-history
# ^XK = down-history
$ bind '^[[G'=down-history
If you spend enough time digging through termcap/terminfo you'll
probably figure out the correct magic for PgUp and PgDn.
--
J.C. Roberts