LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > *BSD
User Name
Password
*BSD This forum is for the discussion of all BSD variants.
FreeBSD, OpenBSD, NetBSD, etc.

Notices

Reply
 
Search this Thread
Old 02-21-2006, 03:47 PM   #1
taylor_venable
Member
 
Registered: Jun 2005
Location: Indiana, USA
Distribution: OpenBSD, Ubuntu
Posts: 892

Rep: Reputation: 40
OpenBSD 3.8 Home/End Keys Misbehaving


I know this question has been asked a million times, but despite my best attempts to squash it, the problem persists. I just installed OpenBSD 3.8 on a server and every press of Home or End results in "~". I've tried using the .inputrc file with these lines:

"\e[3~": delete-char
"\e[1~": beginning-of-line
"\e[4~": end-of-line

But I still get (mostly) no love; delete now works, but Home and End still do not. I'm using Bash 3.0.16p1, but the issue also manifests when using the default ksh that comes with OpenBSD 3.8. Thanks very much for any advice you can come up with (aside from just using C-a and C-e, of course).

Other details: keyboard is PS/2 104 key EN_US map; console is vt220; anything else needed, please ask.
 
Old 08-20-2006, 08:43 AM   #2
Worksman
Member
 
Registered: Sep 2004
Location: Romania
Distribution: Ubuntu, Debian, Arch Linux, Gentoo, Slackware
Posts: 171
Blog Entries: 1

Rep: Reputation: 31
I have the same problem. I haven't found a fix but it is strange it doesn't happen in xterm just in rxvt and the cli.
I now know rxvt uses readline so the lines you put in inputrc might work for me, will test.
But what does xterm use?
 
Old 08-28-2006, 03:06 PM   #3
Randux
Senior Member
 
Registered: Feb 2006
Location: Siberia
Distribution: Slackware & Slamd64. What else is there?
Posts: 1,705

Rep: Reputation: 54
Taylor checkout bsdforums.org if you haven't already. I had some questions when I installed 3.8 and everything works fine now (although I "upgraded" to 3.9 when it came out.)

Sorry I can't remember exactly what to look for but there aren't many posts in the openbsd forum, you should be able to find it. If not let me know and I'll see what I can find.
 
Old 08-28-2006, 03:53 PM   #4
Worksman
Member
 
Registered: Sep 2004
Location: Romania
Distribution: Ubuntu, Debian, Arch Linux, Gentoo, Slackware
Posts: 171
Blog Entries: 1

Rep: Reputation: 31
Well some things I discovered. I changed my /etc/terminfo. Slackware has /etc/{terminfo;terminfo-BSD;terminfo-Linux}. Using the BSD one made one difference: both End and Home now produce ~. My old terminfo and the terminfo-Linux only affect the End key (produces ~).
 
Old 08-28-2006, 03:57 PM   #5
Randux
Senior Member
 
Registered: Feb 2006
Location: Siberia
Distribution: Slackware & Slamd64. What else is there?
Posts: 1,705

Rep: Reputation: 54
Hi Workman,

On Slackware I also use a keymap for emacs from /usr/share/kbd/keymaps.

Did you mean termcap or terminfo?
 
Old 08-28-2006, 04:11 PM   #6
Worksman
Member
 
Registered: Sep 2004
Location: Romania
Distribution: Ubuntu, Debian, Arch Linux, Gentoo, Slackware
Posts: 171
Blog Entries: 1

Rep: Reputation: 31
Why do we need to use different keymaps for Slackware to work??? :'( Why can't everything use damn English if my locale is English!?
How do you set this keymap separate for each app?
I mean termcap. Even Eterm uses it :S
You use Slackware too, right? What's your status with all this trouble? So far, I haven't found any fix.
 
Old 08-28-2006, 04:27 PM   #7
Randux
Senior Member
 
Registered: Feb 2006
Location: Siberia
Distribution: Slackware & Slamd64. What else is there?
Posts: 1,705

Rep: Reputation: 54
Quote:
Originally Posted by Worksman
Why do we need to use different keymaps for Slackware to work??? :'( Why can't everything use damn English if my locale is English!?
How do you set this keymap separate for each app?
I mean termcap. Even Eterm uses it :S
You use Slackware too, right? What's your status with all this trouble? So far, I haven't found any fix.
I only had a problem because I wanted to use emacs from console. When I used the emacs keymap (and maybe I did something else but it was almost a year ago and I can't remember ) then it fixed all my keyboard problems.

I set the keymap globally in startup by making a symlink from /etc/rc.d/rc.keymap to the emacs keymap in the path i mentioned in the last post.

I don't see any termcap in my /etc but I only have terminfo.

Doing this and what advice I got in bsdforums.org fixed my problems in Slackware and OpenBSD.

Maybe search here for the woodsman's posts because I think his site was the one where I got the information and I didn't use it exactly but I figured out what I needed to do from it. I'm sorry I can't remember. There will be a thread with us discussing something similar, I hope it will also fix your problem.

edit: here is the link I was talking about:
http://www.linuxquestions.org/questi...keyboard+emacs

I am still checking to see if there's any other info.

Last edited by Randux; 08-28-2006 at 04:33 PM.
 
Old 08-28-2006, 06:35 PM   #8
Randux
Senior Member
 
Registered: Feb 2006
Location: Siberia
Distribution: Slackware & Slamd64. What else is there?
Posts: 1,705

Rep: Reputation: 54
Maybe I misunderstood you guys. I did get Home to work in console (I don't use it, it just worked after the other changes I made) but End doesn't work. I really don't care since bash shell uses either emacs or vi key commands- to get to the end of the line you do control e in bash (default) and since I use emacs I'm used to doing it this way and for me it's actually faster. If you prefer vi you can set bash to use vi-style control keys.

I wish I could paste text in this forum using control Y but when I do that nothing happens

I guess next time I should get coffee before trying to answer. Why do we need different keymaps? Because there are many different keyboard types. And not all have keys in the same place on the keyboard. Try writing an ncurses app and you can see the wierd key codes you get in different terminals and console for the same key

Last edited by Randux; 08-28-2006 at 06:36 PM.
 
Old 08-28-2006, 10:21 PM   #9
Worksman
Member
 
Registered: Sep 2004
Location: Romania
Distribution: Ubuntu, Debian, Arch Linux, Gentoo, Slackware
Posts: 171
Blog Entries: 1

Rep: Reputation: 31
Angry

Quote:
Originally Posted by Randux
Maybe I misunderstood you guys. I did get Home to work in console (I don't use it, it just worked after the other changes I made) but End doesn't work. I really don't care since bash shell uses either emacs or vi key commands- to get to the end of the line you do control e in bash (default) and since I use emacs I'm used to doing it this way and for me it's actually faster. If you prefer vi you can set bash to use vi-style control keys.

I wish I could paste text in this forum using control Y but when I do that nothing happens

I guess next time I should get coffee before trying to answer. Why do we need different keymaps? Because there are many different keyboard types. And not all have keys in the same place on the keyboard. Try writing an ncurses app and you can see the wierd key codes you get in different terminals and console for the same key
I meant why can't one setting just set them all. If I live in the USA (which I don't but I prefer my sytem to "thinks" it's in the USA), them why doesn't every app just use a en_US standard keyboard map with Home and End working. But that not the real problem, the problem is that vi (elvis on Slackware) doesn't run properly: text won't delete, cursor moves blocks of text with it while editing and in fact that text that it "carries around" ain't there (as you can see if you save the file and cat it).
Argh, I wish Slackware was as easy as Gentoo! Maybe I should go back to Gentoo... or Arch! Dammit!

Sorry for my cursing but I can't stand it anymore! I'm using Slackware cause it's the most stable (not so patched) distro there is and I care for stability and software that works as the creators intended(vanilla).
 
Old 08-28-2006, 10:25 PM   #10
Worksman
Member
 
Registered: Sep 2004
Location: Romania
Distribution: Ubuntu, Debian, Arch Linux, Gentoo, Slackware
Posts: 171
Blog Entries: 1

Rep: Reputation: 31
Quote:
Originally Posted by Randux
I only had a problem because I wanted to use emacs from console. When I used the emacs keymap (and maybe I did something else but it was almost a year ago and I can't remember ) then it fixed all my keyboard problems.

I set the keymap globally in startup by making a symlink from /etc/rc.d/rc.keymap to the emacs keymap in the path i mentioned in the last post.

I don't see any termcap in my /etc but I only have terminfo.

Doing this and what advice I got in bsdforums.org fixed my problems in Slackware and OpenBSD.

Maybe search here for the woodsman's posts because I think his site was the one where I got the information and I didn't use it exactly but I figured out what I needed to do from it. I'm sorry I can't remember. There will be a thread with us discussing something similar, I hope it will also fix your problem.

edit: here is the link I was talking about:
http://www.linuxquestions.org/questi...keyboard+emacs

I am still checking to see if there's any other info.
Yes I heard termcap was absolete and terminfo is now used. I wonder why I still have it? I use Slackware -current. Will check that... can I see the terminfo file?

Does this thing you did for Emacs solve all console problems including vi/vim/jed?
 
Old 08-29-2006, 07:58 AM   #11
Randux
Senior Member
 
Registered: Feb 2006
Location: Siberia
Distribution: Slackware & Slamd64. What else is there?
Posts: 1,705

Rep: Reputation: 54
Quote:
Originally Posted by Worksman
I meant why can't one setting just set them all. If I live in the USA (which I don't but I prefer my sytem to "thinks" it's in the USA), them why doesn't every app just use a en_US standard keyboard map with Home and End working. But that not the real problem, the problem is that vi (elvis on Slackware) doesn't run properly: text won't delete, cursor moves blocks of text with it while editing and in fact that text that it "carries around" ain't there (as you can see if you save the file and cat it).
Argh, I wish Slackware was as easy as Gentoo! Maybe I should go back to Gentoo... or Arch! Dammit!

Sorry for my cursing but I can't stand it anymore! I'm using Slackware cause it's the most stable (not so patched) distro there is and I care for stability and software that works as the creators intended(vanilla).
It's not that simple and it's not a Slackware problem, we also had this problem on OpenBSD. There are many different keyboard layouts in the world (Home and End are not always in the same place on every keyboard) and the default just doesn't work the way we want. Ok, so we can change it. Don't become upset for nothing. Soon you will have this fixed.

First take a look at /etc/inputrc like Taylor mentioned and I mentioned in the post I linked. I took almost everything out of mine since it all looked bad. Of course cp inputrc inputrc.bkup or something before you change it so you can recover if you mess up.
Log off, log on, test. This may fix all your problems (even though it didn't for us )

Next look through that list of keyboards I mentioned earlier in the thread and then just try a few keyboard layouts. You don't have to reboot to make this work, just set the keyboard layout as root. Here's my script:

Code:
#!/bin/sh
# Load the keyboard map. More maps are in /usr/share/kbd/keymaps.
#
if [ -x /usr/bin/loadkeys ]; then
 /usr/bin/loadkeys emacs.map.gz
fi
when you decide which keymap you want, change this script and save it as /etc/rc.d/rc.keymap with chmod +x (as root)

To find out which keymap you want, when you are testing open a root terminal and do:

Code:
/usr/bin/loadkeys nameofyourkeymap.gz
after that log off and log back in and see if it worked.

Do man bash or info bash and look into how to set the environment to vi-style commands if you don't like emacs-style. I didn't have to do this because emacs style is the default.

I don't know what I was looking at when I answered about the termcap/terminfo. On my system there are several termcaps, no terminfo. I can't tell if I modified any of them. Sorry and I will never write about this topic again

I don't use any of the vi editors so I can't answer your question. But my keyboard now works like I want for emacs in x terminals and console.

Last edited by Randux; 08-29-2006 at 08:04 AM.
 
Old 08-29-2006, 01:26 PM   #12
Worksman
Member
 
Registered: Sep 2004
Location: Romania
Distribution: Ubuntu, Debian, Arch Linux, Gentoo, Slackware
Posts: 171
Blog Entries: 1

Rep: Reputation: 31
What's the difference, vi-style commands and emacs-style commands?
Even if you don't use vi, it is a required package for Slackware.
I never (ever) even looked at what Emacs is or looks like. I just go for the simplest thing, a good programming editor and that's it. (I know emacs is more than an editor).
Thank you for your help. I will read your posts soon, cause I'm too busy right now.
 
Old 08-30-2006, 06:46 AM   #13
Randux
Senior Member
 
Registered: Feb 2006
Location: Siberia
Distribution: Slackware & Slamd64. What else is there?
Posts: 1,705

Rep: Reputation: 54
Quote:
Originally Posted by Worksman
What's the difference, vi-style commands and emacs-style commands?
Even if you don't use vi, it is a required package for Slackware.
I never (ever) even looked at what Emacs is or looks like. I just go for the simplest thing, a good programming editor and that's it. (I know emacs is more than an editor).
Thank you for your help. I will read your posts soon, cause I'm too busy right now.
Vi is certainly not a required package for Slackware. Nothing is required in Slackware except the kernel and a few utilities

What's the difference between vi-style commands and Emacs commands? I don't know, because I don't know Vi. When I want to go to the end of a line in Emacs I press C-e. When I want to go to the beginning of a line, I press C-a. When I want to go to the beginning of a file I press Alt-LeftShift-<

The point is that bash is set up for guys who use Emacs or vi so that whatever keys you use in your editor you can use on the command line (within reason). So I don't have problems with home and end keys because I don't use them.
 
Old 08-30-2006, 11:34 AM   #14
Worksman
Member
 
Registered: Sep 2004
Location: Romania
Distribution: Ubuntu, Debian, Arch Linux, Gentoo, Slackware
Posts: 171
Blog Entries: 1

Rep: Reputation: 31
Quote:
Originally Posted by Randux
Vi is certainly not a required package for Slackware. Nothing is required in Slackware except the kernel and a few utilities

What's the difference between vi-style commands and Emacs commands? I don't know, because I don't know Vi. When I want to go to the end of a line in Emacs I press C-e. When I want to go to the beginning of a line, I press C-a. When I want to go to the beginning of a file I press Alt-LeftShift-<

The point is that bash is set up for guys who use Emacs or vi so that whatever keys you use in your editor you can use on the command line (within reason). So I don't have problems with home and end keys because I don't use them.
Strange cause, if I remember correctly, you can't compile the kernel without vi... or do patching. IIRC, when I removed vi (I just wanted vim) I got errors on kernel compilations (and other) about vi not being there. So I guess vi is needed.
 
Old 08-31-2006, 06:36 AM   #15
Randux
Senior Member
 
Registered: Feb 2006
Location: Siberia
Distribution: Slackware & Slamd64. What else is there?
Posts: 1,705

Rep: Reputation: 54
I haven't compiled a kernel on Slackware but I have installed several Slackware machines without vi and they all work
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Eterm Escreen mc problems HOME END keys etc. CMDR_PAIN Linux - Software 4 11-28-2005 12:15 PM
Home / End keys in aterm Vgui Linux - General 4 08-11-2005 12:59 PM
Home/End keys don't work Abdul Linux - Software 2 07-25-2005 08:48 PM
home, delete, end keys problem in vi bujecas Slackware 10 01-12-2005 02:32 PM
Home and End keys in RXVT kevmccor Slackware 3 12-16-2004 04:51 PM


All times are GMT -5. The time now is 11:01 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration