LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 02-11-2010, 11:27 AM   #1
fscessna
LQ Newbie
 
Registered: Feb 2010
Posts: 1

Rep: Reputation: 0
Keyboard mapping issue


Hey all, I have a machine (SLES10) which exhibits some weird keyboard mapping behavior related to the arrow keys...

Using a terminal locally, the arrow keys (and home, end, delete, backspace for that matter) work great as expected. However, once I start to use any other application's cli (db2, irb, etc.) I start getting ^[[A (for up) ^[[D (for left) ^[[C (for right) and ^[[B (for down) dumped to the screen. In fact, all of the "special" keys are not "caught" and instead just printed to the screen. Thankfully, the backspace key still works in all situations.

My /etc/inputrc file looks fine, but I've attached it just in case any of you want to see/try it out to see if the behavior is replicable.

Any hints, tips, or suggestions?

Code:
#
# Eight bit compatible: Umlaute
#
set meta-flag on
set output-meta on
set convert-meta off
set term xy
#
# VI line editing
#
$if mode=vi
set editing-mode vi
set keymap vi
$endif
#
# Common standard keypad and cursor
#
"\e[1~":        beginning-of-line
"\e[2~":        yank
"\e[3~":        delete-char
"\e[4~":        end-of-line
"\e[5~":        history-search-backward
"\e[6~":        history-search-forward
$if term=xterm
"\e[2;2~":      yank
"\e[3;2~":      delete-char
"\e[5;2~":      history-search-backward
"\e[6;2~":      history-search-forward
"\e[2;5~":      yank
"\e[3;5~":      delete-char
"\e[5;5~":      history-search-backward
"\e[6;5~":      history-search-forward
$endif
"\e[C":         forward-char
"\e[D":         backward-char
"\e[A":         previous-history
"\e[B":         next-history
$if term=xterm
"\e[E":         re-read-init-file
"\e[2C":        forward-word
"\e[2D":        backward-word
"\e[2A":        history-search-backward
"\e[2B":        history-search-forward
"\e[1;2C":      forward-word
"\e[1;2D":      backward-word
"\e[1;2A":      history-search-backward
"\e[1;2B":      history-search-forward
"\e[1;3C":      forward-word
"\e[1;3D":      backward-word
"\e[1;3A":      history-search-backward
"\e[1;3B":      history-search-forward
"\e[5C":        forward-word
"\e[5D":        backward-word
"\e[5A":        history-search-backward
"\e[5B":        history-search-forward
"\e[1;5C":      forward-word
"\e[1;5D":      backward-word
"\e[1;5A":      history-search-backward
"\e[1;5B":      history-search-forward
$else
"\e[G":         re-read-init-file
$endif
#
# Avoid network problems
#   ... \177 (ASCII-DEL) and \010 (ASCII-BS)
#       do `backward-delete-char'
# Note: `delete-char' is maped to \033[3~
#       Therefore xterm's responce on pressing
#       key Delete or KP-Delete should be
#       \033[3~ ... NOT \177
#
"\C-?":         backward-delete-char
"\C-H":         backward-delete-char
#
# Home and End
#
$if term=xterm
#
# Normal keypad and cursor of xterm
#
"\e[1~":        history-search-backward
"\e[4~":        set-mark
"\e[H":         beginning-of-line
"\e[F":         end-of-line
"\e[2H":        beginning-of-line
"\e[2F":        end-of-line
"\e[5H":        beginning-of-line
"\e[5F":        end-of-line
# Home and End of application keypad and cursor of xterm
"\eOH":         beginning-of-line
"\eOF":         end-of-line
"\eO2H":        beginning-of-line
"\eO2F":        end-of-line
"\eO5H":        beginning-of-line
"\eO5F":        end-of-line
$else
$if term=kvt
"\e[1~":        history-search-backward
"\e[4~":        set-mark
"\eOH":         beginning-of-line
"\eOF":         end-of-line
$endif
#
# TERM=linux or console or gnome
#
"\e[1~":        beginning-of-line
"\e[4~":        end-of-line
$endif
#
# Application keypad and cursor of xterm
#
$if term=xterm
"\eOD":         backward-char
"\eOC":         forward-char
"\eOA":         previous-history
"\eOB":         next-history
"\eOE":         re-read-init-file
"\eO2D":        backward-word
"\eO2C":        forward-word
"\eO2A":        history-search-backward
"\eO2B":        history-search-forward
"\eO5D":        backward-word
"\eO5C":        forward-word
"\eO5A":        history-search-backward
"\eO5B":        history-search-forward
# DEC keyboard KP_F1 - KP_F4 or
# XTerm of XFree86 in VT220 mode F1 - F4
"\eOP":         prefix-meta
"\eOQ":         undo
"\eOR":         ""
"\eOS":         kill-line
$endif
$if term=gnome
# or gnome terminal F1 - F4
"\eOP":         prefix-meta
"\eOQ":         undo
"\eOR":         ""
"\eOS":         kill-line
$endif
#
# Function keys F1 - F12
#
$if term=linux
#
# On console the first five function keys
#
"\e[[A":        prefix-meta
"\e[[B":        undo
"\e[[C":        ""
"\e[[D":        kill-line
"\e[[E":        ""
$else
#
# The first five standard function keys
#
"\e[11~":       prefix-meta
"\e[12~":       undo
"\e[13~":       ""
"\e[14~":       kill-line
"\e[15~":       ""
$endif
"\e[17~":       ""
"\e[18~":       ""
"\e[19~":       ""
"\e[20~":       ""
"\e[21~":       ""
# Note: F11, F12 are identical with Shift_F1 and Shift_F2
"\e[23~":       ""
"\e[24~":       ""
#
# Shift Function keys F1  - F12
#      identical with F11 - F22
#
#"\e[23~":      ""
#"\e[24~":      ""
"\e[25~":       ""
"\e[26~":       ""
# DEC keyboard: F15=\e[28~ is Help
"\e[28~":       ""
# DEC keyboard: F16=\e[29~ is Menu
"\e[29~":       ""
"\e[31~":       ""
"\e[32~":       ""
"\e[33~":       ""
"\e[34~":       ""
$if term=xterm
# Not common
"\e[35~":       ""
"\e[36~":       ""
$endif
#
$if term=xterm
#
# Application keypad and cursor of xterm
# with NumLock ON
#
# Operators
"\eOo":         "/"
"\eOj":         "*"
"\eOm":         "-"
"\eOk":         "+"
"\eOl":         ","
"\eOM":         accept-line
"\eOn":         "."
# Numbers
"\eOp":         "0"
"\eOq":         "1"
"\eOr":         "2"
"\eOs":         "3"
"\eOt":         "4"
"\eOu":         "5"
"\eOv":         "6"
"\eOw":         "7"
"\eOx":         "8"
"\eOy":         "9"
$endif
#
#  EMACS line editing
#
$if mode=emacs
#
# ... xterm application cursor
#
$if term=xterm
"\e\eOD":       backward-word
"\e\eOC":       forward-word
"\e\eOA":       up-history
"\e\eOB":       down-history
"\C-\eOD":      backward-char
"\C-\eOC":      forward-char
"\C-\eOA":      up-history
"\C-\eOB":      down-history
$endif
#
# Standard cursor
#
"\e\e[D":       backward-word
"\e\e[C":       forward-word
"\e\e[A":       up-history
"\e\e[B":       down-history
"\C-\e[D":      backward-char
"\C-\e[C":      forward-char
"\C-\e[A":      up-history
"\C-\e[B":      down-history
$endif
#
# end
#
 
Old 02-12-2010, 10:46 PM   #2
jstephens84
Senior Member
 
Registered: Sep 2004
Location: Nashville
Distribution: Manjaro, RHEL, CentOS
Posts: 2,098

Rep: Reputation: 102Reputation: 102
I wonder if your term cap is set wrong. can you post the output of
Code:
env
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LoadKeys Binary Keyboard Mapping Issue. ravi13jain Linux - Embedded & Single-board computer 0 08-11-2009 04:29 AM
Keyboard Mapping xsider Linux - Desktop 1 01-15-2008 06:52 PM
Keyboard mapping mendiratta Linux - Laptop and Netbook 0 11-27-2007 11:51 PM
VNC and keyboard mapping issue wslyhbb Linux - Software 0 09-15-2007 08:43 AM
keyboard re-mapping bong.mau Linux - Software 1 10-26-2005 12:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:54 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration