Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

home, end, delete, page up/down keys not working

116 views
Skip to first unread message

Brendon G.

unread,
Sep 26, 2008, 5:08:04 AM9/26/08
to
Hi all,
I am having a bit of frustration with the openbsd default shell (ksh),
I am used to working in a linux bash shell and need the have fore-
mentioned keys "working" as normal. I get a tilde (~) sign as output
whenever I use one of these keys. My $TERM is vt220. Any suggestions?

Aaron W. Hsu

unread,
Sep 26, 2008, 10:23:19 AM9/26/08
to
"Brendon G." <brendon...@gmail.com> writes:

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.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Brendon G.

unread,
Sep 26, 2008, 2:28:15 PM9/26/08
to
...

> What do you want to happen when you use these keys?
...

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...

Aaron W. Hsu

unread,
Sep 26, 2008, 10:08:26 PM9/26/08
to
"Brendon G." <brendon...@gmail.com> writes:

>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.

Shane Almeida

unread,
Sep 27, 2008, 8:06:38 AM9/27/08
to

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.

jpd

unread,
Sep 27, 2008, 9:54:52 AM9/27/08
to
On Sat, 27 Sep 2008 12:06:38 +0000 (UTC),
Shane Almeida <almeida.sp...@spam.is.evil.mindless.com> wrote:
>
> 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:

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.

use...@d-ra.ath.cx

unread,
Sep 27, 2008, 3:27:26 PM9/27/08
to
Hi,

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
#

Shane Almeida

unread,
Sep 28, 2008, 9:22:28 AM9/28/08
to
On 27 Sep 2008 13:54:52 GMT, jpd wrote:
> On Sat, 27 Sep 2008 12:06:38 +0000 (UTC),
> Shane Almeida <almeida.sp...@spam.is.evil.mindless.com> wrote:
>>
>> 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:
>
> 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.

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 ~.

Shane Almeida

unread,
Sep 28, 2008, 9:14:48 PM9/28/08
to
On Sat, 27 Sep 2008 19:27:26 +0000 (UTC), <use...@d-ra.ath.cx> wrote:
> Hi,
>
> did you try this two? Read the ksh(1) man page.

Yup, doesn't work. Home, end, and delete all just beep and print a tilde
with those binds.

Brendon G.

unread,
Sep 29, 2008, 2:59:30 AM9/29/08
to

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...

0 new messages