LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 06-04-2009, 05:44 PM   #1
Cotobear
Member
 
Registered: Nov 2007
Location: Canada
Distribution: Slackware 12.0
Posts: 100

Rep: Reputation: 16
Getting keyboard to function properly in rxvt/urxvt


Hey everyone,

I have installed urxvt (rxvt was installed with the system).

Currently xterm properly uses the keyboard, that is, all the keys do what they should. However rxvt and urxvt both fail to use the home and end keys properly and instead produce a "~".

What is the best solution for this? Since the keyboard is functioning properly for xterm is it possible to link the settings that xterm uses to a file that urxvt/rxvt uses?

Any advice is appreciated,
Coto
 
Old 06-04-2009, 10:12 PM   #2
rigelan
Member
 
Registered: Jul 2005
Location: Iowa
Distribution: Slackware
Posts: 172

Rep: Reputation: 19
Funny, I was working on this exact problem today, but then I got distracted. Haven't come up with a solution yet.
 
Old 06-04-2009, 10:28 PM   #3
rigelan
Member
 
Registered: Jul 2005
Location: Iowa
Distribution: Slackware
Posts: 172

Rep: Reputation: 19
Well, one solution that I came up with to fix urxvt was creating a file in the home directory for my user:

Code:
~/.inputrc
 "/e[7~": beginning-of-line
 "/e[8~": end-of-line
This makes it so that urxvt (rxvt-unicode) works when the HOME key and END key are pressed. It attaches the key "[7" to the command "beginning-of-line" and key "[8" to the command "end-of-line"

Unfortunately, it breaks the other terminal I use: the linux terminal on tty6, where the home and end keys stop working. In that terminal they use keys "/e[1~" & "/e[4~" respectively.

Does anybody have a solution that would make them both work properly? I will continue to look for one.

Last edited by rigelan; 06-04-2009 at 10:45 PM.
 
Old 06-05-2009, 06:08 AM   #4
dangazda
LQ Newbie
 
Registered: Jun 2009
Location: Prague/Czech Republic
Distribution: Slackware
Posts: 5

Rep: Reputation: 0
Hi,
I had similar problem and added something like :
Code:
case "$TERM" in 
        rxvt*)
        bindkey '\e[7~' beginning-of-line
        ;;
        linux)
        bindkey '\e[1~' beginning-of-line
        ;;
esac
to my ~/.zshrc. I didn't test if for bash, so please take it as a hint only ... (e.g. in bash bindkey->bind, I think)

Daniel
 
Old 06-05-2009, 09:52 AM   #5
rigelan
Member
 
Registered: Jul 2005
Location: Iowa
Distribution: Slackware
Posts: 172

Rep: Reputation: 19
Thanks for the tip dangazda, unfortunately it looks as though bindkey doesn't work in bash.

I did end up with a fix for mine, by putting both keys into ~/.inputrc,

Code:
"\e[1~": beginning-of-line
"\e[7~": beginning-of-line
"\e[4~": end-of-line
"\e[8~": end-of-line
Because the key codes don't contradict one another and are completely independent, I can get away with this.

How is your problem looking cotobear?
 
Old 06-05-2009, 10:12 AM   #6
rigelan
Member
 
Registered: Jul 2005
Location: Iowa
Distribution: Slackware
Posts: 172

Rep: Reputation: 19
I changed something again. When I did the last command, it made home and end key work properly, but the page-down and page-up, and delete key stopped working. I think the ~/.inputrc completely replaces the commands in /etc/inputrc, instead of just adding to them. So I took the /etc/inputrc file, made a few changes to it, and copied it to ~/.inputrc. I didn't just make the changes in /etc/inputrc because it is part of a system file, and whenever I upgrade the package, the changes I placed in it would disappear.

-It might make sense for the package maintainer to make this change in /etc/inputrc.

Here is my latest ~/.inputrc (copied and changed from /etc/inputrc)

Code:
# /etc/inputrc - ~/.inputrc
# This file configures keyboard input for programs using readline.
# See "man 3 readline" for more examples.

# Configure the system bell.  Options are none, visible, and audible.
#set bell-style none

# Enable 8 bit input.
set meta-flag On
set input-meta On
set convert-meta Off
set output-meta On

# Set various nice escape sequences:
"\eOd": backward-word
"\eOc": forward-word

# for linux console
"\e[1~": beginning-of-line
"\e[4~": end-of-line
"\e[5~": beginning-of-history
"\e[6~": end-of-history
"\e[3~": delete-char
"\e[2~": quoted-insert

# for rxvt                     #added
"\e[7~": beginning-of-line      
"\e[8~": end-of-line           

# for xterm
"\eOH": beginning-of-line
"\eOF": end-of-line

# for freebsd console
"\e[H": beginning-of-line
"\e[F": end-of-line

Last edited by rigelan; 06-05-2009 at 11:20 AM.
 
Old 06-06-2009, 01:40 PM   #7
Cotobear
Member
 
Registered: Nov 2007
Location: Canada
Distribution: Slackware 12.0
Posts: 100

Original Poster
Rep: Reputation: 16
Hey rigelan,

This has also worked for me. I tried just putting the keycodes in /etc/inputrc without luck. Copying /etc/inputrc to ~/.inputrc has solved the problem.

Additionally, a source for your (experimentally confirmed) idea that the local file replaces the global file:

http://www.linuxfromscratch.org/blfs...s/inputrc.html

Thanks for your suggestions.

Coto
 
  


Reply

Tags
aterm, end, home, keyboard, rxvt


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
Xfce 4.6 Suspend and Hibernate Function does not work properly with my notebook. phys Slackware 2 03-09-2009 05:46 PM
Help new dvdrecorder does not function properly hobz Fedora 2 10-01-2008 08:18 AM
arange windows function doesn't work properly Four Linux - Newbie 0 03-17-2007 11:06 PM
System-wide urxvt (rxvt-unicode) X-resource control colo Linux - Software 2 07-17-2006 08:17 AM
menuconfig fails to function properly in kernel 2.6.4 csvke Linux - Software 7 03-23-2004 07:20 PM


All times are GMT -5. The time now is 06:38 AM.

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