Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
 Post subject: SSH & special keys
PostPosted: Sun Jun 27, 2004 6:03 pm 
Offline
Senior Newbie

Joined: Tue Jun 01, 2004 4:03 pm
Posts: 15
Location: Toronto, Canada
Hi,

I noticed that the default RedHat distributions work really well with keyboards -- for example, the 'Home' and 'End' keys function as exepcted while I'm typing at a shell prompt.

It's a little different under Debian, and I'd imagine I have to install something to get the same functionality. Does anyone know what I have to install/change to set that up in a Debian environment? Currently the 'Home' and 'End' keys result in a "~" character with a beep that occurs at the same time. Interestingly, however, in nano-editor, the Home and End keys work just fine.

Thanks for your help!
j.


Top
   
 Post subject:
PostPosted: Sun Jun 27, 2004 7:15 pm 
Offline
Senior Member

Joined: Sat Jun 05, 2004 12:49 am
Posts: 333
Put this in /etc/bash.bashrc to enable for all logins:

Code:
case $TERM in
        xterm*)
                if [ "$COLORTERM" ]; then
                        bind '"\C-h": backward-delete-char'
                        bind '"\e[3~": delete-char'
                        bind '"\e[7~": beginning-of-line'
                        bind '"\e[8~": end-of-line'
                else
                        bind '"\e[1~": beginning-of-line'
                        bind '"\e[3~": delete-char'
                        bind '"\e[4~": end-of-line'
                        bind '"\177": backward-delete-char'
                fi
                ;;
        cons*)
                export COLORTERM=$TERM
                bind '"\C-?": delete-char' # DEL
                bind '"\C-h": backward-delete-char' # BACKSPACE
                bind '"\e[H": beginning-of-line' # HOME
                bind '"\e[F": end-of-line' # END

esac


You'll have to re-login for it to take effect.


Top
   
 Post subject:
PostPosted: Sun Jun 27, 2004 7:31 pm 
Offline
Senior Newbie

Joined: Tue Jun 01, 2004 4:03 pm
Posts: 15
Location: Toronto, Canada
Thanks for the quick reply! -- I copied the code and pasted it directly into /etc/bash.bashrc, then exited and reconnected through SSH but it hasn't seemed to have changed anything. I took a look at 'env' and it reports TERM=xterm and SHELL=/bin/bash.

Any idea why it wouldn't have changed anything? The 'Del' key has always worked, the 'Insert' key doesn't, the 'Home' and 'End' keys still give the beep and the '~' character.

Should I try pasting that code into ~/.bashrc? Or would that do bad things?

Thanks again for your help!
j.


Top
   
 Post subject:
PostPosted: Sun Jun 27, 2004 7:36 pm 
Offline
Senior Member

Joined: Sat Jun 05, 2004 12:49 am
Posts: 333
might try ~/.bashrc maybe the global isn't getting ran for some odd reason.


Top
   
 Post subject:
PostPosted: Sun Jun 27, 2004 7:38 pm 
Offline
Senior Newbie

Joined: Tue Jun 01, 2004 4:03 pm
Posts: 15
Location: Toronto, Canada
Yep -- that worked. Thanks! :)


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group