LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 12-19-2011, 10:03 AM   #1
newOperator
LQ Newbie
 
Registered: Dec 2011
Posts: 3

Rep: Reputation: Disabled
Question Putty, SSH, Arrow Keys Produce Character String Instead Of Working As Expected


=========== SOLVED - Please view final post. ===========
Hi all.

Debian Distribution: Squeeze
Putty: 0.62
Configuration:



Problem: When arrow keys or tab pressed, the following character strings disply on screen instead of the cursor moving left or right, or up or down. NB: This only happens when I am not logged in as root. When I do this, everything acts as expected.

Expectation:
Up: previous in command history
Down: next in command history
Left: move cursor left
Right: move curos right
Tab: tab completion

What happens:
Up: ^[[A
Down: ^[[B
Left: ^[[D
Right: ^[[C
Tab: <tab>

Steps Taken, knowledge gained:
Found this: http://www.softpanorama.org/Scriptin.../inputrc.shtml

Tried: Adding following line to /etc/inputrc and ./usr/share/doc/bash/inputrc.arrows and restarting:

Code:
"^[[C" backward-char
Tried: search -name inputrc* which yielded following files:

./etc/inputrc
./usr/share/doc/libreadline6/inputrc.arrows
./usr/share/doc/libereadline5/inputrc.arrows
./usr/share/doc/bash/inputrc.arrows
./usr/share/doc/readline-common/inputrc.arrows
./usr/share/readline/inputrc


./etc/inputrc
Code:
# /etc/inputrc - global inputrc for libreadline
  2 # See readline(3readline) and `info rluserman' for more information.
  3
  4 # Be 8 bit clean.
  5 set input-meta on
  6 set output-meta on
  7
  8 # To allow the use of 8bit-characters like the german umlauts, comment out
  9 # the line below. However this makes the meta key not work as a meta key,
 10 # which is annoying to those which don't need to type in 8-bit characters.
 11
 12 # set convert-meta off
 13
 14 # try to enable the application keypad when it is called.  Some systems
 15 # need this to enable the arrow keys.
 16 # set enable-keypad on
 17
 18 # see /usr/share/doc/bash/inputrc.arrows for other codes of arrow keys
 19
 20 # do not bell on tab-completion
 21 # set bell-style none
 22 # set bell-style visible
 23
 24 # some defaults / modifications for the emacs mode
 25 $if mode=emacs
 26
 27 # allow the use of the Home/End keys
 28 "\e[1~": beginning-of-line
 29 "\e[4~": end-of-line
 30
 31 # allow the use of the Delete/Insert keys
 32 "\e[3~": delete-char
 33 "\e[2~": quoted-insert
 34
 35 # mappings for "page up" and "page down" to step to the beginning/end
 36 # of the history
 37 # "\e[5~": beginning-of-history
 38 # "\e[6~": end-of-history
 39
 40 # alternate mappings for "page up" and "page down" to search the history
 41 # "\e[5~": history-search-backward
 42 # "\e[6~": history-search-forward
 43
 44 # mappings for Ctrl-left-arrow and Ctrl-right-arrow for word moving
 45 "\e[1;5C": forward-word
46 "\e[1;5D": backward-word
 47 "\e[5C": forward-word
 48 "\e[5D": backward-word
 49 "\e\e[C": forward-word
 50 "\e\e[D": backward-word
 51
 52 $if term=rxvt
 53 "\e[8~": end-of-line
 54 "\eOc": forward-word
 55 "\eOd": backward-word
 56 $endif
 57
 58 # for non RH/Debian xterm, can't hurt for RH/Debian xterm
 59 # "\eOH": beginning-of-line
 60 # "\eOF": end-of-line
 61
 62 # for freebsd console
 63 # "\e[H": beginning-of-line
 64 # "\e[F": end-of-line
 65
 66 $endif
./usr/share/doc/bash/inputrc.arrows
Code:
  1 # This file controls the behaviour of line input editing for
  2 # programs that use the Gnu Readline library.
  3 #
  4 # Arrow keys in keypad mode
  5 #
  6 "\C-[OD"        backward-char
  7 "\C-[OC"        forward-char
  8 "\C-[OA"        previous-history
  9 "\C-[OB"        next-history
 10 #
 11 # Arrow keys in ANSI mode
 12 #
 13 "\C-[[D"        backward-char
 14 "\C-[[C"        forward-char
 15 "\C-[[A"        previous-history
 16 "\C-[[B"        next-history
 17 #
 18 # Arrow keys in 8 bit keypad mode
 19 #
 20 "\C-M-OD"       backward-char
 21 "\C-M-OC"       forward-char
 22 "\C-M-OA"       previous-history
 23 "\C-M-OB"       next-history
 24 #
 25 # Arrow keys in 8 bit ANSI mode
 26 #
 27 "\C-M-[D"       backward-char
 28 "\C-M-[C"       forward-char
 29 "\C-M-[A"       previous-history
 30 "\C-M-[B"       next-history
 31
 32 "\C-^[[D"         backward-char
I diff'ed all the inputrc and inputrc.arrows - they're all identical to ./etc/inputrc and ./usr/share/doc/bash/inputrc.arrows So it's not a case of editting the wrong file.

I'm out of ideas on how to proceed from here. I would really appreciate any help anyone can offer.

Thanks.

Last edited by newOperator; 12-21-2011 at 07:51 AM. Reason: Solved.
 
Old 12-20-2011, 07:56 PM   #2
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
What shell does root have? Try typing "bash".
 
Old 12-21-2011, 01:28 AM   #3
newOperator
LQ Newbie
 
Registered: Dec 2011
Posts: 3

Original Poster
Rep: Reputation: Disabled
root has /bin/bash; all other accounts seem to have /bin/sh.
 
Old 12-21-2011, 07:50 AM   #4
newOperator
LQ Newbie
 
Registered: Dec 2011
Posts: 3

Original Poster
Rep: Reputation: Disabled
SOLVED.

Found this article: http://www.cyberciti.biz/faq/howto-s...default-shell/

It gives instructions on how to change the default shell for a given user. I used the following:

Code:
chsh -s /bin/bash user-name
Man chsh for any further details.
 
Old 12-21-2011, 10:45 AM   #5
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
Oh, hah, I read that it ONLY happened with root, not the other way around; glad it got you on the right track, though.

I thought Squeeze defaulted new users to having /bin/bash as their shell. Ah well.
 
  


Reply



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
emacs+gnome-terminal+KDE+openSUSE - ctrl+arrow keys not working openSauce Linux - Software 4 04-03-2009 04:31 AM
Finch without arrow keys working aBiNg Slackware 0 04-08-2008 10:10 AM
Arrow keys not working flamingvan Solaris / OpenSolaris 5 10-03-2006 05:47 AM
Shift-arrow and Alt-arrow keys don't work in xterm Aviv Hurvitz Linux - General 2 09-30-2006 03:43 PM
PuTTY SSH and PPK Keys colabus Linux - Newbie 1 07-13-2004 10:17 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

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

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