What do you want to happen when you use these keys?
Aaron Hsu
--
+++++++++++++++ ((lambda (x) (x x)) (lambda (x) (x x))) +++++++++++++++
Email: <arc...@sacrideo.us> | WWW: <http://www.sacrideo.us>
Scheme Programming is subtle; subtlety can be hard.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
home - begining of line (ctrl-a)
end - end of line (ctrl-e)
delete - delete character (ctrl-d)
page-up/down - scroll buffer
I suppose I should just get used to using the ctrl-x keys instead...
>home - begining of line (ctrl-a)
>end - end of line (ctrl-e)
>delete - delete character (ctrl-d)
>page-up/down - scroll buffer
You can do the PGUP and PGDN stuff if you just hold down shift when
you are using those keys. As for the delete, it should work if you
have delete mapped appropriately in X Windows or your Terminal.
Home and End I am less sure about, but there ought to be a way to
do it. You can check out editing modes for ksh if you want, as there
is a vi editing mode that I like to use, which allows me to use
vi commands instead of the emacs commands when I am doing my line
editing.
I've tried to do the same thing, and I think you can only get one to work
at a time. I opted for the delete key, which works with the following
bind commands:
bind '^[[3'=prefix-2
bind '^[[3~'=delete-char-forward
If you want home, try these:
bind '^[[1'=prefix-2
bind '^[[1~'=beginning-of-line
And end is like this:
bind '^[[4'=prefix-2
bind '^[[4~'=end-of-line
If you try doing all three pairs in the same shell, all three keys will be
mapped to the last action you specified. So, if you did the binds in the
order I've typed them above, the home, end, and delete keys would all map
to end-of-line. It's a little frustrating.
I don't have openbsd's (pd)ksh here, but looking at the example in the
manpage I think you could try bind '^[['=prefix-2 instead.
--
j p d (at) d s b (dot) t u d e l f t (dot) n l .
This message was originally posted on Usenet in plain text.
Any other representation, additions, or changes do not have my
consent and may be a violation of international copyright law.
did you try this two? Read the ksh(1) man page.
$ grep ENV ~/.profile
export ENV=$HOME/.kshrc
$ cat ~/.kshrc
#
. /etc/ksh.kshrc
export PS1="\u@\H:\w\n\\$ "
case $UID in
0) ulimit -n 256
;;
*)
ulimit -p 128
ulimit -n 256
;;
esac
#
if [ -o interactive ]; then
case "$TERM" in
vt220)
bind '^[[3'=prefix-2 # DEL
bind '^[[3~'=delete-char-forward # DEL
;;
xterm*)
export TERM=xterm-color # force color
bind '^XH'=beginning-of-line # Pos1
bind '^XF'=end-of-line # End
;;
nxterm)
bind '^XH'=beginning-of-line # Pos1
bind '^XF'=end-of-line # End
;;
*) ;;
esac
fi
#
Home, end, and delete function with that approach, except that each of
them prints an extra '~' character. So, for example, if you hit the home
key, your cursor will move to the start of the line, then a ~ will show
up, and your cursor will be at the second character. Delete will replace
the current character with a ~ and end will move the cursor to the end of
the line and add an extra ~.
Yup, doesn't work. Home, end, and delete all just beep and print a tilde
with those binds.
I think I will just get accustomed to using the default emacs mode key
bindings, It makes more sense to learn to use the default openbsd
shell environment...